Kreslení Shapestring

From FreeCAD Documentation
Revision as of 17:13, 21 January 2014 by Honza32 (talk | contribs) (Created page with "==Vlastnosti==")

Draft_ShapeString

Menu location
Draft -> ShapeString
Workbenches
Kreslení
Default shortcut
S S
Introduced in version
-
See also
None

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, tracking a font mohou být specifikovány.

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žadovaný text a stiskněte ENTER
  5. Zadejte požadovaný tracking a stiskněte ENTER
  6. Stiskněte ENTER pro potvrzení zobrazeného souboru s fontem nebo
  7. Stiskněte ... pro výběr souboru s fontem.

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

  • ÚdajePosition: The base point of the compound shape
  • ÚdajeString: The contents of the text string
  • ÚdajeSize: The height of the letters in FC units
  • ÚdajeTracking: The inter-character spacing in FC units
  • ÚdajeFont File: The font definition file used to draw the string

Scripting

The ShapeString tool can by used in macros and from the python console by using the following function:

makeShapeString(String,FontFile,[Size],[Tracking])
  • Turns a text string into a Compound Shape using a specified font.

Example:

import FreeCAD,Draft
 Draft.makeShapeString("This is a sample text",
                       "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
                       200.0,10)

Limitations

  • This tool is not yet generally available. It will be included in a future version. (post v0.13)
  • TrueType(*.ttf), OpenType(*.otf) and Type1(*.pfb) font files are supported.
  • Very small text heights may result in deformed character glyphs due to loss of detail in scaling.
  • The current version is limited to left-to-right layouts on a horizontal baseline.