Types Module

Data Types for Sutton SignWriting font functionality.

class sutton_signwriting_font.datatypes.ScaleObject

Bases: TypedDict

Scaling options to set the width or height of an image.

width: NotRequired[int]

Width for image.

height: NotRequired[int]

Height for image.

class sutton_signwriting_font.datatypes.SignSpatial

Bases: TypedDict

A spatial symbol in a sign.

symbol: str

Symbol identifier.

coord: List[int]

Coordinate [x, y].

detail: NotRequired[List[str]]

Array for CSS name or hex color for line and optional fill.

class sutton_signwriting_font.datatypes.DetailSym

Bases: TypedDict

A symbol-specific style configuration for custom colors.

index: int

The index of the symbol.

detail: List[str]

Array of CSS names or hex colors for line and optional fill.

class sutton_signwriting_font.datatypes.StyleObject

Bases: TypedDict

The elements of a style string.

colorize: NotRequired[bool]

Boolean to use standardized colors for symbol groups.

padding: NotRequired[int]

Integer value for padding around symbol or sign.

background: NotRequired[str]

CSS name or hex color for background.

detail: NotRequired[List[str]]

Array for CSS name or hex color for line and optional fill.

zoom: NotRequired[int | float | str]

Value for specific zoom level or the letter ‘x’ for expandable.

detailsym: NotRequired[List[DetailSym]]

Custom colors for individual symbols

classes: NotRequired[str]

List of class names separated with spaces used for SVG.

id: NotRequired[str]

ID name used for SVG.

class sutton_signwriting_font.datatypes.ColumnOptions

Bases: TypedDict

Options for column layout.

height: NotRequired[int]

The height of the columns.

width: NotRequired[int]

The widths of the columns.

offset: NotRequired[int]

The lane offset for left and right lanes.

pad: NotRequired[int]

Amount of padding before and after signs as well as at top, left, and right of columns.

margin: NotRequired[int]

Amount of space at bottom of column that is not available.

dynamic: NotRequired[bool]

Enables variable width columns.

background: NotRequired[str]

Background color for columns.

style: NotRequired[StyleObject]

An object of style options.

punctuation: NotRequired[ColumnPunctuation]

An object of punctuation options.

class sutton_signwriting_font.datatypes.SegmentInfo

Bases: TypedDict

Information about a text segment.

minX: int

The min x value within the segment.

minY: int

The min y value within the segment.

width: int

The width of the text segment.

height: int

The height of the text segment.

lane: int

Left as -1, Middle as 0, Right as 1.

padding: int

The padding of the text segment affects colored background.

segment: str

‘sign’ or ‘symbol’.

zoom: int | float | str

The zoom size of the segment.

class sutton_signwriting_font.datatypes.ColumnSegment

Bases: SegmentInfo

A segment in a column layout (extends SegmentInfo with position and text).

x: int

The x position in the column.

y: int

The y position in the column.

text: str

The text of the sign or symbol with optional style string.