gdstk.text

gdstk.text(text, size, position, vertical=False, layer=0, datatype=0) list

Create polygonal text.

Parameters:
  • text (str) – Text string.

  • size (number) – Full height of the font.

  • position (coordinate pair or complex) – Text starting position.

  • vertical – Writing direction.

  • layer – layer number assigned to the polygons.

  • datatype – data type number assigned to the polygons.

Returns:

List of gdstk.Polygon.

Examples

>>> text = gdstk.text(f"Created with\nGDSTK {gdstk.__version__}", 1,
...                   (0, 0))
>>> rect = gdstk.rectangle((0, -5 / 4), (12 * 9 / 16, 1),
...                        datatype=1)
../_images/text.svg

Notes

The character aspect ratio is 1:2. For horizontal text, spacings between characters and between lines are 9 / 16 and 5 / 4 times the full height size, respectively. For vertical text, characters and columns are respectively spaced by 9 / 8 and 1 times size.