mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-23 21:09:01 +08:00
imgui_freetype: Fixed a crash in build font atlas when using merged fonts and the first font in a merged set has no loaded glyph. (#8081)
This commit is contained in:
parent
3543dfda95
commit
3b683927ee
@ -72,6 +72,8 @@ Other changes:
|
|||||||
automatically copy window contents into clipboard using CTRL+C. This is experimental
|
automatically copy window contents into clipboard using CTRL+C. This is experimental
|
||||||
because (1) it currently breaks on nested Begin/End, (2) text output quality varies,
|
because (1) it currently breaks on nested Begin/End, (2) text output quality varies,
|
||||||
and (3) text output comes in submission order rather than spatial order.
|
and (3) text output comes in submission order rather than spatial order.
|
||||||
|
- imgui_freetype: Fixed a crash in build font atlas when using merged fonts and the
|
||||||
|
first font in a merged set has no loaded glyph. (#8081)
|
||||||
- Backends: DX12: Unmap() call specify written range. The range is informational and
|
- Backends: DX12: Unmap() call specify written range. The range is informational and
|
||||||
may be used by debug tools.
|
may be used by debug tools.
|
||||||
- Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the
|
- Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the
|
||||||
|
@ -681,8 +681,6 @@ bool ImFontAtlasBuildWithFreeTypeEx(FT_Library ft_library, ImFontAtlas* atlas, u
|
|||||||
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
|
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
|
||||||
{
|
{
|
||||||
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
|
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
|
||||||
if (src_tmp.GlyphsCount == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// When merging fonts with MergeMode=true:
|
// When merging fonts with MergeMode=true:
|
||||||
// - We can have multiple input fonts writing into a same destination font.
|
// - We can have multiple input fonts writing into a same destination font.
|
||||||
@ -693,6 +691,9 @@ bool ImFontAtlasBuildWithFreeTypeEx(FT_Library ft_library, ImFontAtlas* atlas, u
|
|||||||
const float ascent = src_tmp.Font.Info.Ascender;
|
const float ascent = src_tmp.Font.Info.Ascender;
|
||||||
const float descent = src_tmp.Font.Info.Descender;
|
const float descent = src_tmp.Font.Info.Descender;
|
||||||
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
|
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
|
||||||
|
|
||||||
|
if (src_tmp.GlyphsCount == 0)
|
||||||
|
continue;
|
||||||
const float font_off_x = cfg.GlyphOffset.x;
|
const float font_off_x = cfg.GlyphOffset.x;
|
||||||
const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
|
const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user