TXLWizard.ShapeLibrary.Label¶
Renders arbitrary text in TXLWriter.
Functions¶
GetLabel (TXLWriter, Text[, OriginPoint, ...]) |
Renders arbitrary text. |
-
TXLWizard.ShapeLibrary.Label.
GetLabel
(TXLWriter, Text, OriginPoint=[0, 0], FontSize=100, StrokeWidth=10, RotationAngle=0, FillCharacters=True, RoundCaps=False, Layer=1, **kwargs)[source]¶ Renders arbitrary text. Will have an automatically generated ID.
Parameters: - TXLWriter (
TXLWizard.TXLWriter.TXLWriter
) – Current Instance ofTXLWizard.TXLWriter.TXLWriter
- Text (str) – Text to be displayed
- OriginPoint (list of float, optional) – x- and y-coordinates of the origin point of the label. Defaults to [0,0]
- FontSize (float, optional) – Font size. Character height = font size. Defaults to 100
- StrokeWidth (float) – line thickness of the letters. Defaults to 10
- RotationAngle (float) – Angle by which the text is rotated. Defaults to 0
- FillCharacters (bool, optional) – If set to True, closed boundaries will be filled. Can be useful if there should be no free-standing parts. Defaults to True
- RoundCaps (bool, optional) – If set to True, the paths will habe rounded ends. Should be set to False for better e-Beam Performance Defaults to False.
- Layer (int, optional) – Layer the text should be rendered in. Defaults to 1
- **kwargs – keyword arguments
Returns: Structure object containing the patterns representing the text
Return type: Examples
Import required modules
>>> import TXLWizard.TXLWriter >>> import TXLWizard.ShapeLibrary.Label
Initialize TXLWriter >>> TXLWriter = TXLWizard.TXLWriter.TXLWriter()
Add a Label
>>> SampleLabelObject = TXLWizard.ShapeLibrary.Label.GetLabel( ... TXLWriter, ... Text='This is my text', ... OriginPoint=[ ... -200, 300 ... ], ... FontSize=150, ... StrokeWidth=20, ... RoundCaps=False, # Set to False to improve e-Beam performance ... Layer=1 ... )
Generate files
>>> TXLWriter.GenerateFiles('Tests/Results/ShapeLibrary/Label')
- TXLWriter (