mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
do not call BuildLookupTable if for whatever reason a font has no glyphs
This commit is contained in:
parent
f86885ec39
commit
b666be53f9
3 changed files with 12 additions and 4 deletions
|
|
@ -163,7 +163,7 @@ namespace Dalamud.Interface.GameFonts
|
||||||
font->FrequentKerningPairs.Ref<float>(i) /= fontScale;
|
font->FrequentKerningPairs.Ref<float>(i) /= fontScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rebuildLookupTable)
|
if (rebuildLookupTable && fontPtr.Glyphs.Size > 0)
|
||||||
fontPtr.BuildLookupTable();
|
fontPtr.BuildLookupTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ namespace Dalamud.Interface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rebuildLookupTable)
|
if (rebuildLookupTable && target.Value!.Glyphs.Size > 0)
|
||||||
target.Value!.BuildLookupTable();
|
target.Value!.BuildLookupTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ namespace Dalamud.Interface.Internal
|
||||||
for (int i = 0, i_ = ioFonts.ConfigData.Size; i < i_; i++)
|
for (int i = 0, i_ = ioFonts.ConfigData.Size; i < i_; i++)
|
||||||
{
|
{
|
||||||
var config = ioFonts.ConfigData[i];
|
var config = ioFonts.ConfigData[i];
|
||||||
config.RasterizerGamma = config.RasterizerGamma * fontGamma;
|
config.RasterizerGamma *= fontGamma;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Verbose("[FONT] ImGui.IO.Build will be called.");
|
Log.Verbose("[FONT] ImGui.IO.Build will be called.");
|
||||||
|
|
@ -876,7 +876,15 @@ namespace Dalamud.Interface.Internal
|
||||||
for (int i = 0, i_ = ioFonts.Fonts.Size; i < i_; i++)
|
for (int i = 0, i_ = ioFonts.Fonts.Size; i < i_; i++)
|
||||||
{
|
{
|
||||||
var font = ioFonts.Fonts[i];
|
var font = ioFonts.Fonts[i];
|
||||||
font.FallbackChar = Fallback1Codepoint;
|
if (font.Glyphs.Size == 0)
|
||||||
|
{
|
||||||
|
Log.Warning("[FONT] Font has no glyph: {0}", font.GetDebugName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (font.FindGlyphNoFallback(Fallback1Codepoint).NativePtr != null)
|
||||||
|
font.FallbackChar = Fallback1Codepoint;
|
||||||
|
|
||||||
font.BuildLookupTable();
|
font.BuildLookupTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue