mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-09-09 15:37:05 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user