Draft Textform

From FreeCAD Documentation
Revision as of 11:55, 4 November 2021 by Roy 043 (talk | contribs)

Entwurf FormZeichenfolge

Menüeintrag
Entwurf → Form aus Text ...
Arbeitsbereich
Entwurf, Architektur
Standardtastenkürzel
S S
Eingeführt in Version
0.14
Siehe auch
Entwurf Text, Part Extrudieren,

Makro Schriftarten Win10 PYMP


Beschreibung

Das Werkzeug Entwurf FormZeichenfolge fügt eine Verbundform ein, die eine TextZeichenfolge darstellt. Texthöhe, Laufweite und Schriftart können angegeben werden. Die resultierende Form kann mit dem Werkzeug Teil Extrusion verwendet werden, um 3D Buchstaben zu erzeugen.

Alternativ: Um ein einfacheres Textelement ohne geschlossene Form einzufügen, verwende Entwurf Text. Um eine Textbeschriftung mit einem Anfang und einem Pfeil zu erstellen, verwende Entwurf Beschriftung

Einfacher Punkt zur Positionierung des Formzeichenfolge erforderlich

Anwendung

For Windows users: please read the Font file selection on Windows paragraph first.

Wenn der Entwurf Benutzeroberflächenmodus auf Aufgabenansicht eingestellt ist:

  1. Drücke den Entwurf Formfolge oder drücke die Tasten S und dann S.
  2. Ein Dialogfeld erscheint, in dem Du deine Parameter angeben kannst.
  3. Drücke die Taste OK, um die Formfolge zu erstellen.

Optionen

  • Um Koordinaten von Hand einzugeben, gib einfach die Zahlen ein und drücke dann Enter zwischen jeder X-, Y- und Z-Komponente. Du kannst den Punkt hinzufügent drücken, wenn Du die gewünschten Werte zum Einfügen des Punktes hast.
  • Drücke die Taste Esc oder die Taste Close, um den aktuellen Befehl abzubrechen.

Notes

Begrenzungen

  • Sehr kleine Texthöhen können durch Detailverlust bei der Skalierung zu verzerrten Zeichenformen führen.
  • Die aktuelle Version ist auf die von Links nach Rechts Schreiben begrenzt.
  • Um kreisförmig angeordneten Text zu erstellen, verwende den Rundtext.

Font file selection on Windows

On Windows access to the default font folder is restricted. This affects the font file selection for ShapeStrings. There are three cases in FreeCAD where a font file for ShapeStrings can be specified: in the task panel of this command, when changing the DatenFont File property of a ShapeString, and when specifying the default font file in the Preferences Editor.

Pressing the ... button and then selecting a file from the default Windows font folder is not possible when using the native file dialog. There are a number of workarounds:

  • Make sure DontUseNativeFontDialog is set to true, which is the default value for this preference. This will only call a different, non-native, file dialog when pressing the ... in the task panel of this command. With this file dialog the default Windows font folder can be accessed.
  • Change DontUseNativeDialog to true. This instructs FreeCAD to always use the non-native file dialog.
  • Specify the font file in the input box. You can of course type the full path or copy-paste the path from the Windows File Explorer. But there is also another way to enter the path. If you enter C:\ a dropdown list will appear. Select Windows from that list and add \F. Select Fonts from the new dropdown list. Finally add \ and the first letter of the font file, and then select it from the dropdown list.
  • Create a custom folder for your font files.

See the Preferences paragraph below for the location of the mentioned preferences.

Tutorien

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.
  • For Windows users:
    • Set Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeFontDialog to true to use the non-native file dialog when selecting a font file from the task panel of this command.
    • Set Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeDialog to true to always use the non-native file dialog.

Eigenschaften

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

  • Daten-EigenschaftPosition: gibt die Position des Basispunktes der verbundenen Form an.
  • Daten-EigenschaftWinkel: gibt die Rotation der Grundlinie der Form an.
  • Daten-EigenschaftAchse: gibt die Achse an, die für die Rotation verwendet werden soll.
  • Daten-EigenschaftFolge: gibt die anzuzeigende Textzeichenfolge an; im Gegensatz zum Werkzeug Entwurf Text kann das Werkzeug Entwurf FormFolge nur eine einzelne Zeile anzeigen.
  • Daten-EigenschaftGröße: gibt die allgemeine Höhe der Buchstaben an.
  • Daten-EigenschaftLaufweite: gibt den zusätzlichen Abstand zwischen den Zeichen in der Zeichenkette an.
  • Daten-EigenschaftSchriftartdatei: gibt den vollständigen Pfad der Schriftdatei an, die zum Zeichnen der Zeichenkette verwendet wird.

View

Draft

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

Scripting

Skripten

Siehe auch: Draft API und FreeCAD Skripten Grundlagen.

Das FormFolge Werkzeug kann in Makros und von der Python Konsole aus mit der folgenden Funktion benutzt werden:

shapestring = make_shapestring(String, FontFile, Size=100, Tracking=0)

Die Platzierung der FormFolge kann durch Überschreiben seines Placement Attributs oder durch individuelles Überschreiben seiner Placement.Base und Placement.Rotation Attribute geändert werden.

Beispiel:

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()