|
|
|
@ -1577,7 +1577,6 @@ bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
|
|
|
|
|
const float off_x = cfg.GlyphOffset.x;
|
|
|
|
|
const float off_y = cfg.GlyphOffset.y + (float)(int)(dst_font->Ascent + 0.5f);
|
|
|
|
|
|
|
|
|
|
dst_font->FallbackGlyph = NULL; // Always clear fallback so FindGlyph can return NULL. It will be set again in BuildLookupTable()
|
|
|
|
|
for (int i = 0; i < tmp.RangesCount; i++)
|
|
|
|
|
{
|
|
|
|
|
stbtt_pack_range& range = tmp.Ranges[i];
|
|
|
|
@ -1619,14 +1618,12 @@ void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* f
|
|
|
|
|
{
|
|
|
|
|
if (!font_config->MergeMode)
|
|
|
|
|
{
|
|
|
|
|
font->ContainerAtlas = atlas;
|
|
|
|
|
font->ConfigData = font_config;
|
|
|
|
|
font->ConfigDataCount = 0;
|
|
|
|
|
font->ClearOutputData();
|
|
|
|
|
font->FontSize = font_config->SizePixels;
|
|
|
|
|
font->ConfigData = font_config;
|
|
|
|
|
font->ContainerAtlas = atlas;
|
|
|
|
|
font->Ascent = ascent;
|
|
|
|
|
font->Descent = descent;
|
|
|
|
|
font->Glyphs.resize(0);
|
|
|
|
|
font->MetricsTotalSurface = 0;
|
|
|
|
|
}
|
|
|
|
|
font->ConfigDataCount++;
|
|
|
|
|
}
|
|
|
|
@ -1903,7 +1900,8 @@ ImFont::ImFont()
|
|
|
|
|
{
|
|
|
|
|
Scale = 1.0f;
|
|
|
|
|
FallbackChar = (ImWchar)'?';
|
|
|
|
|
Clear();
|
|
|
|
|
DisplayOffset = ImVec2(0.0f, 1.0f);
|
|
|
|
|
ClearOutputData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImFont::~ImFont()
|
|
|
|
@ -1916,13 +1914,12 @@ ImFont::~ImFont()
|
|
|
|
|
if (g.Font == this)
|
|
|
|
|
g.Font = NULL;
|
|
|
|
|
*/
|
|
|
|
|
Clear();
|
|
|
|
|
ClearOutputData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ImFont::Clear()
|
|
|
|
|
void ImFont::ClearOutputData()
|
|
|
|
|
{
|
|
|
|
|
FontSize = 0.0f;
|
|
|
|
|
DisplayOffset = ImVec2(0.0f, 1.0f);
|
|
|
|
|
Glyphs.clear();
|
|
|
|
|
IndexAdvanceX.clear();
|
|
|
|
|
IndexLookup.clear();
|
|
|
|
|