FL.objects.TTStem.TTStem

class FL.objects.TTStem.TTStem(ttstem_or_width: TTStem | int | None = None, upm: int | None = None)

Bases: Copyable

TTStem - class to represent a TrueType stem definition

TTStem.__doc__ reports only ‘TTStem’ … so use this information with care

__init__(ttstem_or_width: TTStem | int | None = None, upm: int | None = None) None
Parameters:
  • ttstem_or_width (TTStem | int | None, optional) – _description_. Defaults to None.

  • upm (int | None, optional) – _description_. Defaults to None.

Raises:

RuntimeError – When the arguments don’t match the expectations.

Methods

__init__([ttstem_or_width, upm])

fake_deserialize(data)

fake_recalc_ppms(width, upm)

Calculate the ppms at which the scaled stem width will round up to the next pixel

Attributes

name

Name of the stem

ppm2

From this ppm-size the stem becomes 2 pixels wide

ppm3

From this ppm-size the stem becomes 3 pixels wide

ppm4

From this ppm-size the stem becomes 4 pixels wide

ppm5

From this ppm-size the stem becomes 5 pixels wide

ppm6

From this ppm-size the stem becomes 6 pixels wide

width

Width of the stem

fake_recalc_ppms(width: int, upm: int) None

Calculate the ppms at which the scaled stem width will round up to the next pixel

Parameters:
  • width (int) – The width of the stem

  • upm (int) – The units per em of the font

property name: str

Name of the stem

Returns:

_description_

Return type:

str

property ppm2: int

From this ppm-size the stem becomes 2 pixels wide

Returns:

_description_

Return type:

int

property ppm3: int

From this ppm-size the stem becomes 3 pixels wide

Returns:

_description_

Return type:

int

property ppm4: int

From this ppm-size the stem becomes 4 pixels wide

Returns:

_description_

Return type:

int

property ppm5: int

From this ppm-size the stem becomes 5 pixels wide

Returns:

_description_

Return type:

int

property ppm6: int

From this ppm-size the stem becomes 6 pixels wide

Returns:

_description_

Return type:

int

property width: int

Width of the stem

Returns:

_description_

Return type:

int