Draft ShapeString: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
Line 1: Line 1:
{{GuiCommand|Name=Draft_ShapeString|Workbenches=[[Draft Module|Draft]]|MenuLocation=Draft -> ShapeString|Shortcut=S S}}
{{GuiCommand|Name=Draft_ShapeString|Workbenches=[[Draft Module|Draft]]|MenuLocation=Draft -> ShapeString|Shortcut=S S}}
<translate>
<translate>
==Description==
==Description== <!--T:1-->


<!--T:2-->
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. </translate>
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. </translate>


[[Image:Draft_ShapeString_Example400.png]]
[[Image:Draft_ShapeString_Example400.png]]
<translate>
<translate>
==How to use==
==How to use== <!--T:3-->


<!--T:4-->
# Press the {{KEY|[[Image:Draft_ShapeString16.png]] [[Draft ShapeString]]}} button, or press {{KEY|S}} then {{KEY|S}} keys
# Press the {{KEY|[[Image:Draft_ShapeString16.png]] [[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]]
Line 17: Line 19:
# Press {{KEY|...}} to select a font file.
# Press {{KEY|...}} to select a font file.


==Options==
==Options== <!--T:5-->


<!--T:6-->
* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
* Pressing {{KEY|ESC}} will cancel the operation.
* Pressing {{KEY|ESC}} will cancel the operation.


==Properties==
==Properties== <!--T:7-->


<!--T:8-->
* {{PropertyData|Position}}: The base point of the compound shape
* {{PropertyData|Position}}: The base point of the compound shape
* {{PropertyData|String}}: The contents of the text string
* {{PropertyData|String}}: The contents of the text string
Line 30: Line 34:
* {{PropertyData|Font File}}: The font definition file used to draw the string
* {{PropertyData|Font File}}: The font definition file used to draw the string


==Scripting==
==Scripting== <!--T:9-->


<!--T:10-->
The ShapeString tool can by used in [[macros]] and from the python console by using the following function:
The ShapeString tool can by used in [[macros]] and from the python console by using the following function:
</translate>
</translate>
Line 38: Line 43:
Compound Shape using a specified font.
Compound Shape using a specified font.


<translate>Example: </translate>
<translate><!--T:11-->
Example: </translate>
<syntaxhighlight>
<syntaxhighlight>
import FreeCAD,Draft
import FreeCAD,Draft
Line 45: Line 51:
200.0,10)</syntaxhighlight>
200.0,10)</syntaxhighlight>
<translate>
<translate>
==Limitations==
==Limitations== <!--T:12-->
* This tool is not yet generally available. It will be included in a future version. (post v0.13)
* 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. </translate>
* TrueType(*.ttf), OpenType(*.otf) and Type1(*.pfb) font files are supported. </translate>

Revision as of 00:15, 16 April 2013

Draft_ShapeString

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

Description

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

  1. Press the Draft ShapeString button, or press S then S keys
  2. Click a point on the 3D view, or type a coordinate
  3. Enter the desired text, press ENTER
  4. Enter the desired size, press ENTER
  5. Enter the desired tracking, press ENTER
  6. Press ENTER to accept the displayed font, or,
  7. Press ... to select a font file.

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.

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 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.