Draft ShapeString: Difference between revisions
({{Draft Tools navi}} and {{Userdocnavi}}) |
(More details) |
||
Line 19: | Line 19: | ||
<!--T:4--> |
<!--T:4--> |
||
# Press the {{ |
# Press the {{Button|[[Image:Draft_ShapeString16.png]] [[Draft_ShapeString|Draft ShapeString]]}} button, or press {{KEY|S}} then {{KEY|S}} keys. |
||
# Click a point on the 3D view, or type a [[Draft_Coordinates|coordinate]] |
# Click a point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. |
||
# Enter the desired text, press {{KEY| |
# Enter the desired text, and press {{KEY|Enter}}. |
||
# Enter the desired size, press {{KEY| |
# Enter the desired size, and press {{KEY|Enter}}. |
||
# Enter the desired tracking, press {{KEY| |
# Enter the desired tracking, and press {{KEY|Enter}}. |
||
# Press {{KEY| |
# Press {{KEY|Enter}} to accept the displayed font file, or press {{Button|...}} to select a font file. |
||
# Press {{KEY|...}} to select a font file. |
|||
The text, size, tracking, and font can be changed after creation, by modifying its properties. |
|||
==Options== <!--T:5--> |
==Options== <!--T:5--> |
Revision as of 17:32, 8 November 2018
Draft ShapeString |
Menu location |
---|
Draft → Shape from text ... |
Workbenches |
Draft, Arch |
Default shortcut |
S S |
Introduced in version |
- |
See also |
Draft Text, Part Extrude |
Description
The ShapeString tool inserts a compound shape that represents a text string. Text height, tracking and font can be specified. The resulting shape can be used with the Part Extrude tool to create 3D letters.
The Draft Text tool is a simpler alternative that does not produce a closed shape.
How to use
- Press the Draft ShapeString button, or press S then S keys.
- Click a point on the 3D view, or type a coordinate and press the add point button.
- Enter the desired text, and press Enter.
- Enter the desired size, and press Enter.
- Enter the desired tracking, and press Enter.
- Press Enter to accept the displayed font file, or press ... to select a font file.
The text, size, tracking, and font can be changed after creation, by modifying its properties.
Options
- To enter coordinates manually, simply enter the numbers, then press ENTER between each X, Y and Z component.
- Pressing ESC will cancel the operation.
- You can set a default font file in Draft/Prefences.
Properties
- 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
Scripting
The ShapeString tool can be used in macros and from the Python console by using the following function:
ShapeString = makeShapeString(String, FontFile, Size=100, Tracking=0)
- Creates a
ShapeString
compound shape using the specifiedString
FontFile
is mandatory and must be the full path of a supported font fileSize
is the height of the resulting text in millimetersTracking
is the additional inter-character spacing in millimeters
Example:
import FreeCAD, Draft
Draft.makeShapeString("This is a sample text",
"/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
200.0, 10)
Selecting A Font
ShapeString uses the internal geometry of a font to make FreeCAD shapes. To do this it must read the actual font file (*.tff, etc). If the Font Selection box is empty, you must type the full path to the font file or use ... to select a font file.
Limitations
- This tool is not available in FreeCAD versions anterior to 0.14
- 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.
- For creating curved text you can use the macro Circular Text
Tutorials
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub