fxconv: preliminary support for fonts in PythonExtra

This commit is contained in:
Lephenixnoir 2024-03-21 08:29:06 +01:00
parent 2acc439ed4
commit 4c307af02b
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 13 additions and 0 deletions

View File

@ -807,6 +807,19 @@ def convert_topti(input, params):
# Object file generation
#---
if params["py"]["enabled"]:
l = [ "import gint\n",
f"{params['name']} = gint.font({title or None}, {flags}, ",
f"{line_height}, {grid.h}, {len(blocks)}, {glyph_count}, ",
f"{char_spacing}, ",
data_blocks,
data_glyphs ]
if proportional:
l += [data_index, data_width]
else:
l += [f"{grid.w}, {(grid.w * grid.h + 31) >> 5}"]
return l + [")\n"]
# Base data: always put the raw data and blocks first since they are
# 4-aligned, to preserve alignment on the rest of the references.
o = ObjectData()