mcfonts.serde.yaff¶
Export to a YAFF font file.
Module Contents¶
- class ToYaffData¶
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type checkSee PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class YaffData¶
-
- global_properties : dict[str, str]¶
- glyphs : dict[Label, YaffGlyphData]¶
- class YaffSaver¶
Bases:
ProtocolProtocol for saving a provider to the Monobit YAFF format.
- save_font(font: mcfonts.font.MinecraftFont) str¶
- Parameters:¶
- font : mcfonts.font.MinecraftFont¶
- Return type:¶
str
-
DICT_GLYPH_MAGIC : str =
'__glyph__'¶ The magic constant that is used as a key for glyph data to be stored under.
- type Label = str | int¶
-
NOTDEF_ASCENT : int =
7¶
-
NOTDEF_GLYPH : list[str] =
['@@@@@', '@...@', '@...@', '@...@', '@...@', '@...@', '@@@@@', '.....']¶
-
NOTDEF_HEIGHT : int =
8¶
-
NOTDEF_NAME : str =
'".notdef"'¶
-
YAFF_OFF : Final[str] =
'.'¶
-
YAFF_ON : Final[str] =
'@'¶