Draft ShapeString/cs: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 19: Line 19:
</div>
</div>


'''Alterinatively''': To insert a simpler text element without a closed shape use [[Draft Text|Draft Text]]. To create a text label with a lead and an arrow use [[Draft Label|Draft Label]].
'''Alternatively''': To insert a simpler text element without a closed shape use [[Image:Draft_Text.svg|24px]] [[Draft Text|Draft Text]]. To create a text label with a lead and an arrow use [[Image:Draft_Label.svg|24px]] [[Draft Label|Draft Label]].


[[Image:Draft_ShapeString_Example400.png]]
[[Image:Draft_ShapeString_Example400.png]]
Line 41: Line 41:


If your Draft interface mode is set to TaskView:
If your Draft interface mode is set to TaskView:
# Press the {{Button|[[Image:Draft_ShapeString16.png]] [[Draft_ShapeString|Draft ShapeString]]}} button, or press {{KEY|S}} then {{KEY|S}} keys.
# Press the {{Button|[[Image:Draft_ShapeString.svg|16px]] [[Draft_ShapeString|Draft ShapeString]]}} button, or press {{KEY|S}} then {{KEY|S}} keys.
# A dialog will appear where you can specify your parameters.
# A dialog will appear where you can specify your parameters.
# Press {{KEY|OK}} to create the ShapeString.
# Press {{KEY|OK}} to create the ShapeString.

Revision as of 22:36, 10 February 2020

Draft ShapeString

Umístění Menu
Draft -> ShapeString
Pracovní stoly
Kreslení
Výchozí zástupce
S S
Představen ve verzi
-
Viz také
Draft Text, Part Extrude

Popis

Nástroj ShapeString vkládá složený tvar, který reprezentuje textový řetězec na daný bod v aktuálním dokumentu. Výška textu, mezery a font mohou být specifikovány.

Alternatively: To insert a simpler text element without a closed shape use Draft Text. To create a text label with a lead and an arrow use Draft Label.

Použití

  1. Stiskněte tlačítko Kreslení ShapeString nebo klávesy S a potom S
  2. Klikněte na bod ve 3D pohledu nebo zadejte jeho souřadnice
  3. Zadejte požadovaný text a stiskněte ENTER
  4. Zadejte požadovanou šířku mezer mezi písmeny a stiskněte ENTER
  5. Stiskněte ENTER pro potvrzení zobrazeného souboru s fontem nebo
  6. Stiskněte ... pro výběr souboru s fontem.

If your Draft interface mode is set to TaskView:

  1. Press the Draft ShapeString button, or press S then S keys.
  2. A dialog will appear where you can specify your parameters.
  3. Press OK to create the ShapeString.


  • The text, size, tracking, and font can be changed after creation, by modifying the values in the Property Editor.
  • You will want to set the default font file in Draft Preferences, in the Texts and dimensions tab. This will prefill the font file box in the dialog.
  • Supported fonts include TrueType (.ttf), OpenType (.otf), and Type 1 (.pfb).

Omezení

  • Tento nástroj není dosud obecně dostupný. Bude zahrnut v budoucí verzi. (post v0.13)
  • Jsou podporovány soubory s fonty TrueType(*.ttf), OpenType(*.otf) a Type1(*.pfb).
  • Velmi malé výšky textu mohou zapříčinit deformaci znaků kvůli ztrátě detailů.
  • Aktuální verze je omezena na zarovnání zleva doprava na horizontální základně.

Volby

  • Pro zadání souřadnic ručně, jednoduše zadejte číslo a stiskněte ENTER mezi každou z komponent X, Y a Z.
  • Stiskněte klávesu ESC pro ukončení aktuálního příkazu.
  • Defaultní soubor s fontem můžete přednastavit v Kreslení/Předvolby.

Vlastnosti

  • ÚdajePozice: Základní bod složeného písma
  • ÚdajeString: Text řetězce
  • ÚdajeVelikost: Výška textu v jednotkách FC
  • ÚdajeMezery: Šířka mezer mezi písmeny v jednotkách FC
  • ÚdajeFont File: Soubor s definicí fontu pro kreslený text

Skriptování

Nástroj ShapeString může být použit v makrech a z konzoly Pythonu použitím následující funkce:

ShapeString = makeShapeString(String, FontFile, Size=100, Tracking=0)
  • Změní textový řetězec na složené písmo s použitím specifikovaného fontu.

The placement of the ShapeString can be changed by overwriting its Placement attribute, or by individually overwriting its Placement.Base and Placement.Rotation attributes.

Příklad:

import FreeCAD, Draft

font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
font2 = "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf"
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"

S1 = Draft.makeShapeString("This is a sample text", font1, 200)

S2 = Draft.makeShapeString("Inclined text", font2, 200, 10)

ZAxis = FreeCAD.Vector(0, 0, 1)
p2 = FreeCAD.Vector(-1000, 500, 0)
place2 = FreeCAD.Placement(p2, FreeCAD.Rotation(ZAxis, 45))
S2.Placement = place2

S3 = Draft.makeShapeString("Upside-down text", font3, 200, 10)
S3.Placement.Base = FreeCAD.Vector(0, -1000, 0)
S3.Placement.Rotation = FreeCAD.Rotation(ZAxis, 180)

Tutorials

Notes

  • Many fonts will generate problematic geometric. This is because font contours are allowed to overlap, have small gaps and have varying directions within a glyph. These conditions are considered errors in the Wires used to define Faces. Options are to correct the font definition with a tool like FontForge or to use another font.