mcfonts.utils.exporting.yaff
¶
Functions for exporting into the text-only human-readable YAFF format.
Module Contents¶
Functions¶
|
Generate a YAFF glyph out of a |
|
Generate a YAFF glyph out of a |
|
Include glyph into the YAFF font, represented as a dictionary. |
|
Set a simple blank space width to a character. |
|
Set YAFF glyph data to a character. |
Attributes¶
The magic constant that is used as a key for glyph data to be stored under. |
-
mcfonts.utils.exporting.yaff.YAFF_STORE_GLYPH_MAGIC =
'__glyph__'
¶ The magic constant that is used as a key for glyph data to be stored under.
- mcfonts.utils.exporting.yaff.generate_bitmap_yaff(glyph)¶
Generate a YAFF glyph out of a
BitmapGlyph
.- Parameters:¶
- glyph : mcfonts.glyphs.BitmapGlyph¶
A
BitmapGlyph
.
- Returns:¶
A dictionary of the YAFF data. Glyph data is stored under
YAFF_STORE_GLYPH_MAGIC
.- Return type:¶
dict[str, list[str] | str | int]
- mcfonts.utils.exporting.yaff.generate_unihex_yaff(glyph)¶
Generate a YAFF glyph out of a
UnihexGlyph
.- Parameters:¶
- glyph : mcfonts.glyphs.UnihexGlyph¶
A
UnihexGlyph
.
- Returns:¶
A dictionary of the YAFF data. Glyph data is stored under
YAFF_STORE_GLYPH_MAGIC
.- Return type:¶
dict[str, list[str] | str | int]
- mcfonts.utils.exporting.yaff.include_glyph(yaff_store, glyph, character)¶
Include glyph into the YAFF font, represented as a dictionary.
Different Glyph subtypes have different methods of being imported; this function centralizes those varying methods.
-
mcfonts.utils.exporting.yaff.set_space_to_character(yaff_store, character, width, replace=
True
)¶ Set a simple blank space width to a character.
-
mcfonts.utils.exporting.yaff.set_yaff_to_character(yaff_store, yaff_glyph, character, replace=
True
)¶ Set YAFF glyph data to a character.
- Parameters:¶
- yaff_store : dict[str, str | int | dict[str, list[str] | str | int]]¶
The YAFF font, represented as a dictionary.
- yaff_glyph : dict[str, list[str] | str | int]¶
A dictionary of the YAFF data. Glyph data is stored under
YAFF_STORE_GLYPH_MAGIC
.- character : str¶
The character to set a glyph to.
- replace : bool¶
Whether the width should overwrite pre-existing glyph data for character.
- Return type:¶
None