From 4c307af02beca85acb30cb6374724d34263a0a26 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 21 Mar 2024 08:29:06 +0100 Subject: [PATCH] fxconv: preliminary support for fonts in PythonExtra --- fxconv/fxconv.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fxconv/fxconv.py b/fxconv/fxconv.py index 50ffb92..fe2d244 100644 --- a/fxconv/fxconv.py +++ b/fxconv/fxconv.py @@ -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()