LengthUnit#

Added in version 1.4.

class LengthUnit#

Describes length units.

Unit

Regular Text

Large Text

1px

1px

1px

1pt

1.333333px

1.666667px

1sp

1px

1.25px

New values may be added to this enumeration over time.

Methods#

class LengthUnit
from_px(value: float, settings: Settings | None = None) float#

Converts value from pixels to unit.

Added in version 1.4.

Parameters:
  • value – a value in pixels

  • settings – settings to use, or NULL for default settings

to_px(value: float, settings: Settings | None = None) float#

Converts value from unit to pixels.

Added in version 1.4.

Parameters:
  • value – a value in unit

  • settings – settings to use, or NULL for default settings

Fields#

class LengthUnit
PT#

The type of the None singleton.

PX#

The type of the None singleton.

SP#

The type of the None singleton.