Glyph manipulation

class retrofont.glyph.Pixel(*values)

Pixel values.

empty
filled
retrofont.glyph.decode_glyph(glyph)

Convert a glyph to its text representation.

Parameters:

glyph (bytes) – Glyph.

Return type:

list[str]

Returns:

Text representation of glyph.

retrofont.glyph.encode_glyph(text_glyph)

Convert a glyph from its text representation.

Parameters:

text_glyph (list[str]) – Text representation of a glyph.

Return type:

bytes

Returns:

Glyph.

retrofont.glyph.traverse_glyph(glyph)

Traverse all pixels of a glyph.

Parameters:

glyph (bytes) – Glyph.

Return type:

Iterator[tuple[tuple, object]]

Returns:

Iterator for position and pixel value pairs.