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 4: Line 4:
|[[Draft_Facebinder|Facebinder]]
|[[Draft_Facebinder|Facebinder]]
|[[Draft_Text|Text]]
|[[Draft_Text|Text]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Facebinder.svg
|IconL=Draft_Facebinder.svg
|IconR=Draft_Text.svg
|IconR=Draft_Text.svg
Line 76: Line 76:
==Vlastnosti==
==Vlastnosti==


See also: [[property_editor|Property editor]].
See also: [[Property_editor|Property editor]].


A Draft ShapeString object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties:
A Draft ShapeString object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties:
Line 151: Line 151:
|[[Draft_Facebinder|Facebinder]]
|[[Draft_Facebinder|Facebinder]]
|[[Draft_Text|Text]]
|[[Draft_Text|Text]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Facebinder.svg
|IconL=Draft_Facebinder.svg
|IconR=Draft_Text.svg
|IconR=Draft_Text.svg

Revision as of 19:42, 24 August 2021

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.

The Draft ShapeString command is not intended for standard text annotations. The Draft Text command or the Draft Label command should be used for that purpose.

Použití

  1. There are several ways to invoke the command:
    • Press the Draft ShapeString button.
    • Select the Drafting → Shape from text option from the menu.
    • Use the keyboard shortcut: S then S.
  2. The ShapeString task panel opens.
  3. Click a point in the 3D view, or type coordinates.
  4. Optionally press the Reset Point button to reset the point to the origin.
  5. Enter a String.
  6. Specify the Height.
  7. To select a font do one of the following:
    • Enter a file path in the Font file input box.
    • Press the ... button and select a file.
  8. Press the OK button to finish the command.

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.

Notes

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

Tutorials

Preferences

See also: Preferences Editor and Draft Preferences.

  • The default font file can be changed in the preferences: Edit → Preferences... → Draft → Texts and dimensions → Default ShapeString font file. See Draft Preferences.

Vlastnosti

See also: Property editor.

A Draft ShapeString object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:

Data

Draft

  • Ú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

View

Draft

  • PohledPattern (Enumeration): specifies the Draft Pattern with which to fill the faces of the text. This property only works if PohledDisplay Mode is Flat Lines.
  • PohledPattern Size (Float): specifies the size of the Draft Pattern.

Scripting

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 = make_shapestring(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 as App
import Draft

doc = App.newDocument()

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.make_shapestring("This is a sample text", font1, 200)

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

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

S3 = Draft.make_shapestring("Upside-down text", font3, 200, 10)
S3.Placement.Base = App.Vector(0, -1000, 0)
S3.Placement.Rotation = App.Rotation(zaxis, 180)

doc.recompute()