text¶
- photonforge.text(text_string, size, origin=(0, 0), rotation=0, x_reflection=False, typeface=0)¶
Create polygonal text.
The typefaces are designed such that the minimal edge size in the resulting polygons is
size * 0.025
and the all rotation angles between adjacent edges are less than 90 degrees (with tolerance of 1%). Additionally, glyphs in typeface 0 contain no holes.- Parameters:
text_string – String to convert into polygons.
size – Font scaling. This is the maximal vertical dimension if each glyph.
origin – Lower left anchor for the first line of text.
rotation – Text rotation (in degrees).
x_reflection – Reflection across the horizontal axis.
typeface – Typeface to use. Two types are available: 0 and 1.
- Returns:
List of polygons.
Note
Only printable ASCII characters can be rendered. The full list can be obtained in the
string
module:string.printable
.