Browse Source

ImFontAtlas: Fixed multiple rebuild with same inputs erroneously increased ConfigDataCount. CI: Update Ubuntu 18.04 > 20.04 (motivated by #3369)

Fix Freetype warning.
pull/3397/head
ocornut 4 years ago
parent
commit
90b152f265
  1. 2
      .github/workflows/build.yml
  2. 1
      imgui_draw.cpp
  3. 2
      misc/freetype/imgui_freetype.cpp

2
.github/workflows/build.yml

@ -180,7 +180,7 @@ jobs:
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release' run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
Linux: Linux:
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:

1
imgui_draw.cpp

@ -2328,6 +2328,7 @@ void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* f
font->ClearOutputData(); font->ClearOutputData();
font->FontSize = font_config->SizePixels; font->FontSize = font_config->SizePixels;
font->ConfigData = font_config; font->ConfigData = font_config;
font->ConfigDataCount = 0;
font->ContainerAtlas = atlas; font->ContainerAtlas = atlas;
font->Ascent = ascent; font->Ascent = ascent;
font->Descent = descent; font->Descent = descent;

2
misc/freetype/imgui_freetype.cpp

@ -382,7 +382,7 @@ bool ImFontAtlasBuildWithFreeType(FT_Library ft_library, ImFontAtlas* atlas, uns
dst_tmp.GlyphsSet.Create(dst_tmp.GlyphsHighest + 1); dst_tmp.GlyphsSet.Create(dst_tmp.GlyphsHighest + 1);
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2) for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
for (int codepoint = src_range[0]; codepoint <= src_range[1]; codepoint++) for (int codepoint = src_range[0]; codepoint <= (int)src_range[1]; codepoint++)
{ {
if (dst_tmp.GlyphsSet.TestBit(codepoint)) // Don't overwrite existing glyphs. We could make this an option (e.g. MergeOverwrite) if (dst_tmp.GlyphsSet.TestBit(codepoint)) // Don't overwrite existing glyphs. We could make this an option (e.g. MergeOverwrite)
continue; continue;

Loading…
Cancel
Save