fix: t6 font crash (#881)

* fix: make sure t6 always has at least one kerning pair

* chore: ignore nonesense kerning pairs when dumping
This commit is contained in:
Jan
2026-07-05 23:17:34 +02:00
committed by GitHub
parent a8bb7d5599
commit 5564db4f5a
2 changed files with 31 additions and 7 deletions
+11 -4
View File
@@ -306,14 +306,21 @@ namespace
}
SortKerningPairs(font);
if (!EnsureFontContainsGlyphsOfKerningPairs(font))
return false;
}
else
{
font.kerningPairs = nullptr;
// The game is bugged here and accesses the kerning pairs even when kerningPairsCount is set to 0.
// It always checks the first entry so we add a nonsense entry here that never matches
// to ensure that no kerning is applied on randomly matching bytes.
font.kerningPairsCount = 1;
font.kerningPairs = m_memory.Alloc<KerningPairs>(1);
font.kerningPairs[0].wFirst = 0;
font.kerningPairs[0].wSecond = 0;
font.kerningPairs[0].iKernAmount = 0;
}
if (!EnsureFontContainsGlyphsOfKerningPairs(font))
return false;
#endif
return true;