From fea0a1e4ca7e57ebe0bd6ae51de98abe30bef68f Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 1 Nov 2023 23:46:39 +0100 Subject: [PATCH] port: pal: swap all the characters in extended fonts --- port/src/preprocess.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/port/src/preprocess.c b/port/src/preprocess.c index d3ca3a6da..15f54f470 100644 --- a/port/src/preprocess.c +++ b/port/src/preprocess.c @@ -1063,7 +1063,21 @@ void preprocessFont(u8 *data, u32 size) PD_SWAP_VAL(fnt->kerning[i]); } - for (s32 i = 0; i < ARRAYCOUNT(fnt->chars); ++i) { + s32 numchars = 94; + +#if PAL + // PAL has more characters in these fonts + extern u8 *_fonthandelgothicsmSegmentRomStart; + extern u8 *_fonthandelgothicxsSegmentRomStart; + extern u8 *_fonthandelgothicmdSegmentRomStart; + if (data == _fonthandelgothicsmSegmentRomStart + || data == _fonthandelgothicxsSegmentRomStart + || data == _fonthandelgothicmdSegmentRomStart) { + numchars = 135; + } +#endif + + for (s32 i = 0; i < numchars; ++i) { PD_SWAP_VAL(fnt->chars[i].kerningindex); PD_SWAP_PTR(fnt->chars[i].pixeldata); }