|Draft -> ShapeString|
|Introduced in version|
The ShapeString tool inserts a compound shape representing a text string at a given point in the current document. Text height, tracking and font can be specified.
How to use
- Press the button, or press then keys
- Click a point on the 3D view, or type a coordinate
- Enter the desired text, press
- Enter the desired size, press
- Enter the desired tracking, press
- Press to accept the displayed font file, or,
- Press to select a font file.
- To enter coordinates manually, simply enter the numbers, then press between each X, Y and Z component.
- Pressing will cancel the operation.
- You can set a default font file in Draft/Prefences.
- DataPosition: The base point of the compound shape
- DataString: The contents of the text string
- DataSize: The height of the letters in FC units
- DataTracking: The inter-character spacing in FC units
- DataFont File: The font definition file used to draw the string
The ShapeString tool can by used in macros and from the python console by using the following function:
- Turns a text string into a Compound Shape using a specified font.
import FreeCAD,Draft Draft.makeShapeString("This is a sample text", "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf", 200.0,10)
- 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.