Fonts: rename many internal functions for consistency. No other changes.
This commit is contained in:
@@ -15704,10 +15704,10 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
|
|||||||
if (ImGuiFreeType::DebugEditFontBuilderFlags(&loader_flags))
|
if (ImGuiFreeType::DebugEditFontBuilderFlags(&loader_flags))
|
||||||
{
|
{
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
ImFontAtlasBuildDestroyFontOutput(atlas, font);
|
ImFontAtlasFontDestroyOutput(atlas, font);
|
||||||
atlas->FontBuilderFlags = loader_flags;
|
atlas->FontBuilderFlags = loader_flags;
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
ImFontAtlasBuildInitFontOutput(atlas, font);
|
ImFontAtlasFontInitOutput(atlas, font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -15733,7 +15733,7 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
|
|||||||
atlas->CompactCache();
|
atlas->CompactCache();
|
||||||
SameLine();
|
SameLine();
|
||||||
if (Button("Grow"))
|
if (Button("Grow"))
|
||||||
ImFontAtlasBuildGrowTexture(atlas);
|
ImFontAtlasTextureGrow(atlas);
|
||||||
SameLine();
|
SameLine();
|
||||||
if (Button("Clear All"))
|
if (Button("Clear All"))
|
||||||
ImFontAtlasBuildClear(atlas);
|
ImFontAtlasBuildClear(atlas);
|
||||||
@@ -16666,9 +16666,9 @@ void ImGui::DebugNodeFont(ImFont* font)
|
|||||||
Text("FreeType Loader Flags: 0x%08X", loader_flags);
|
Text("FreeType Loader Flags: 0x%08X", loader_flags);
|
||||||
if (ImGuiFreeType::DebugEditFontBuilderFlags(&loader_flags))
|
if (ImGuiFreeType::DebugEditFontBuilderFlags(&loader_flags))
|
||||||
{
|
{
|
||||||
ImFontAtlasBuildDestroyFontOutput(atlas, font);
|
ImFontAtlasFontDestroyOutput(atlas, font);
|
||||||
src->FontBuilderFlags = loader_flags;
|
src->FontBuilderFlags = loader_flags;
|
||||||
ImFontAtlasBuildInitFontOutput(atlas, font);
|
ImFontAtlasFontInitOutput(atlas, font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+59
-59
@@ -2643,7 +2643,7 @@ void ImFontAtlas::Clear()
|
|||||||
|
|
||||||
void ImFontAtlas::CompactCache()
|
void ImFontAtlas::CompactCache()
|
||||||
{
|
{
|
||||||
ImFontAtlasBuildCompactTexture(this);
|
ImFontAtlasTextureCompact(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlas::ClearInputData()
|
void ImFontAtlas::ClearInputData()
|
||||||
@@ -2651,9 +2651,9 @@ void ImFontAtlas::ClearInputData()
|
|||||||
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
||||||
|
|
||||||
for (ImFont* font : Fonts)
|
for (ImFont* font : Fonts)
|
||||||
ImFontAtlasBuildDestroyFontOutput(this, font);
|
ImFontAtlasFontDestroyOutput(this, font);
|
||||||
for (ImFontConfig& font_cfg : Sources)
|
for (ImFontConfig& font_cfg : Sources)
|
||||||
ImFontAtlasBuildDestroyFontSourceData(this, &font_cfg);
|
ImFontAtlasFontDestroySourceData(this, &font_cfg);
|
||||||
for (ImFont* font : Fonts)
|
for (ImFont* font : Fonts)
|
||||||
{
|
{
|
||||||
// When clearing this we lose access to the font name and other information used to build the font.
|
// When clearing this we lose access to the font name and other information used to build the font.
|
||||||
@@ -2972,17 +2972,6 @@ bool ImFontAtlas::Build()
|
|||||||
}
|
}
|
||||||
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
|
||||||
void ImFontAtlasBuildDestroyFontSourceData(ImFontAtlas* atlas, ImFontConfig* src)
|
|
||||||
{
|
|
||||||
IM_UNUSED(atlas);
|
|
||||||
if (src->FontDataOwnedByAtlas)
|
|
||||||
IM_FREE(src->FontData);
|
|
||||||
src->FontData = NULL;
|
|
||||||
if (src->GlyphExcludeRanges)
|
|
||||||
IM_FREE((void*)src->GlyphExcludeRanges);
|
|
||||||
src->GlyphExcludeRanges = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
|
ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
|
||||||
{
|
{
|
||||||
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
||||||
@@ -3040,10 +3029,10 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
|
|||||||
// Pointers to Sources are otherwise dangling
|
// Pointers to Sources are otherwise dangling
|
||||||
font->SourcesCount++;
|
font->SourcesCount++;
|
||||||
ImFontAtlasBuildUpdatePointers(this);
|
ImFontAtlasBuildUpdatePointers(this);
|
||||||
if (!ImFontAtlasBuildAddFont(this, font_cfg))
|
if (!ImFontAtlasFontInitSource(this, font_cfg))
|
||||||
{
|
{
|
||||||
// Rollback (this is a fragile/rarely exercised code-path. TestSuite's "misc_atlas_add_invalid_font" aim to test this)
|
// Rollback (this is a fragile/rarely exercised code-path. TestSuite's "misc_atlas_add_invalid_font" aim to test this)
|
||||||
ImFontAtlasBuildDestroyFontSourceData(this, font_cfg);
|
ImFontAtlasFontDestroySourceData(this, font_cfg);
|
||||||
Sources.pop_back();
|
Sources.pop_back();
|
||||||
font->SourcesCount--;
|
font->SourcesCount--;
|
||||||
if (!font_cfg->MergeMode)
|
if (!font_cfg->MergeMode)
|
||||||
@@ -3195,9 +3184,9 @@ void ImFontAtlas::RemoveFont(ImFont* font)
|
|||||||
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
|
||||||
font->ClearOutputData();
|
font->ClearOutputData();
|
||||||
|
|
||||||
ImFontAtlasBuildDestroyFontOutput(this, font);
|
ImFontAtlasFontDestroyOutput(this, font);
|
||||||
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
||||||
ImFontAtlasBuildDestroyFontSourceData(this, &font->Sources[src_n]);
|
ImFontAtlasFontDestroySourceData(this, &font->Sources[src_n]);
|
||||||
|
|
||||||
bool removed = Fonts.find_erase(font);
|
bool removed = Fonts.find_erase(font);
|
||||||
IM_ASSERT(removed);
|
IM_ASSERT(removed);
|
||||||
@@ -3251,14 +3240,14 @@ void ImFontAtlas::RemoveCustomRect(ImFontAtlasRectId id)
|
|||||||
// ImFont* myfont = io.Fonts->AddFontFromFileTTF(....);
|
// ImFont* myfont = io.Fonts->AddFontFromFileTTF(....);
|
||||||
// myfont->GetFontBaked(16.0f);
|
// myfont->GetFontBaked(16.0f);
|
||||||
// myfont->Flags |= ImFontFlags_LockBakedSizes;
|
// myfont->Flags |= ImFontFlags_LockBakedSizes;
|
||||||
int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar codepoint, int width, int height, float advance_x, const ImVec2& offset)
|
ImFontAtlasRectId ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar codepoint, int width, int height, float advance_x, const ImVec2& offset)
|
||||||
{
|
{
|
||||||
float font_size = font->DefaultSize;
|
float font_size = font->DefaultSize;
|
||||||
return AddCustomRectFontGlyphForSize(font, font_size, codepoint, width, height, advance_x, offset);
|
return AddCustomRectFontGlyphForSize(font, font_size, codepoint, width, height, advance_x, offset);
|
||||||
}
|
}
|
||||||
// FIXME: we automatically set glyph.Colored=true by default.
|
// FIXME: we automatically set glyph.Colored=true by default.
|
||||||
// If you need to alter this, you can write 'font->Glyphs.back()->Colored' after calling AddCustomRectFontGlyph().
|
// If you need to alter this, you can write 'font->Glyphs.back()->Colored' after calling AddCustomRectFontGlyph().
|
||||||
int ImFontAtlas::AddCustomRectFontGlyphForSize(ImFont* font, float font_size, ImWchar codepoint, int width, int height, float advance_x, const ImVec2& offset)
|
ImFontAtlasRectId ImFontAtlas::AddCustomRectFontGlyphForSize(ImFont* font, float font_size, ImWchar codepoint, int width, int height, float advance_x, const ImVec2& offset)
|
||||||
{
|
{
|
||||||
#ifdef IMGUI_USE_WCHAR32
|
#ifdef IMGUI_USE_WCHAR32
|
||||||
IM_ASSERT(codepoint <= IM_UNICODE_CODEPOINT_MAX);
|
IM_ASSERT(codepoint <= IM_UNICODE_CODEPOINT_MAX);
|
||||||
@@ -3277,7 +3266,7 @@ int ImFontAtlas::AddCustomRectFontGlyphForSize(ImFont* font, float font_size, Im
|
|||||||
ImFontAtlasTextureBlockQueueUpload(this, TexData, r->x, r->y, r->w, r->h);
|
ImFontAtlasTextureBlockQueueUpload(this, TexData, r->x, r->y, r->w, r->h);
|
||||||
|
|
||||||
if (baked->IsGlyphLoaded(codepoint))
|
if (baked->IsGlyphLoaded(codepoint))
|
||||||
ImFontAtlasBuildDiscardFontBakedGlyph(this, font, baked, baked->FindGlyph(codepoint));
|
ImFontAtlasBakedDiscardFontGlyph(this, font, baked, baked->FindGlyph(codepoint));
|
||||||
|
|
||||||
ImFontGlyph glyph;
|
ImFontGlyph glyph;
|
||||||
glyph.Codepoint = codepoint;
|
glyph.Codepoint = codepoint;
|
||||||
@@ -3337,9 +3326,9 @@ void ImFontAtlasBuildMain(ImFontAtlas* atlas)
|
|||||||
IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!");
|
IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!");
|
||||||
if (atlas->TexData && atlas->TexData->Format != atlas->TexDesiredFormat)
|
if (atlas->TexData && atlas->TexData->Format != atlas->TexDesiredFormat)
|
||||||
{
|
{
|
||||||
ImVec2i new_tex_size = ImFontAtlasBuildGetTextureSizeEstimate(atlas);
|
ImVec2i new_tex_size = ImFontAtlasTextureGetSizeEstimate(atlas);
|
||||||
ImFontAtlasBuildDestroy(atlas);
|
ImFontAtlasBuildDestroy(atlas);
|
||||||
ImFontAtlasBuildAddTexture(atlas, new_tex_size.x, new_tex_size.y);
|
ImFontAtlasTextureAdd(atlas, new_tex_size.x, new_tex_size.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atlas->Builder == NULL)
|
if (atlas->Builder == NULL)
|
||||||
@@ -3372,7 +3361,7 @@ void ImFontAtlasBuildSetupFontLoader(ImFontAtlas* atlas, const ImFontLoader* fon
|
|||||||
IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!");
|
IM_ASSERT(!atlas->Locked && "Cannot modify a locked ImFontAtlas!");
|
||||||
|
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
ImFontAtlasBuildDestroyFontOutput(atlas, font);
|
ImFontAtlasFontDestroyOutput(atlas, font);
|
||||||
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderShutdown)
|
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderShutdown)
|
||||||
atlas->FontLoader->LoaderShutdown(atlas);
|
atlas->FontLoader->LoaderShutdown(atlas);
|
||||||
|
|
||||||
@@ -3383,7 +3372,7 @@ void ImFontAtlasBuildSetupFontLoader(ImFontAtlas* atlas, const ImFontLoader* fon
|
|||||||
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderInit)
|
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderInit)
|
||||||
atlas->FontLoader->LoaderInit(atlas);
|
atlas->FontLoader->LoaderInit(atlas);
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
ImFontAtlasBuildInitFontOutput(atlas, font);
|
ImFontAtlasFontInitOutput(atlas, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preload all glyph ranges for legacy backends.
|
// Preload all glyph ranges for legacy backends.
|
||||||
@@ -3550,7 +3539,7 @@ static void ImFontAtlasBuildUpdateLinesTexData(ImFontAtlas* atlas)
|
|||||||
//-----------------------------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Was tempted to lazily init FontSrc but wouldn't save much + makes it more complicated to detect invalid data at AddFont()
|
// Was tempted to lazily init FontSrc but wouldn't save much + makes it more complicated to detect invalid data at AddFont()
|
||||||
bool ImFontAtlasBuildInitFontOutput(ImFontAtlas* atlas, ImFont* font)
|
bool ImFontAtlasFontInitOutput(ImFontAtlas* atlas, ImFont* font)
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
||||||
@@ -3565,7 +3554,7 @@ bool ImFontAtlasBuildInitFontOutput(ImFontAtlas* atlas, ImFont* font)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Keep source/input FontData
|
// Keep source/input FontData
|
||||||
void ImFontAtlasBuildDestroyFontOutput(ImFontAtlas* atlas, ImFont* font)
|
void ImFontAtlasFontDestroyOutput(ImFontAtlas* atlas, ImFont* font)
|
||||||
{
|
{
|
||||||
font->ClearOutputData();
|
font->ClearOutputData();
|
||||||
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
||||||
@@ -3579,7 +3568,7 @@ void ImFontAtlasBuildDestroyFontOutput(ImFontAtlas* atlas, ImFont* font)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool ImFontAtlasBuildAddFont(ImFontAtlas* atlas, ImFontConfig* src)
|
bool ImFontAtlasFontInitSource(ImFontAtlas* atlas, ImFontConfig* src)
|
||||||
{
|
{
|
||||||
ImFont* font = src->DstFont;
|
ImFont* font = src->DstFont;
|
||||||
if (src->MergeMode == false)
|
if (src->MergeMode == false)
|
||||||
@@ -3599,6 +3588,17 @@ bool ImFontAtlasBuildAddFont(ImFontAtlas* atlas, ImFontConfig* src)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImFontAtlasFontDestroySourceData(ImFontAtlas* atlas, ImFontConfig* src)
|
||||||
|
{
|
||||||
|
IM_UNUSED(atlas);
|
||||||
|
if (src->FontDataOwnedByAtlas)
|
||||||
|
IM_FREE(src->FontData);
|
||||||
|
src->FontData = NULL;
|
||||||
|
if (src->GlyphExcludeRanges)
|
||||||
|
IM_FREE((void*)src->GlyphExcludeRanges);
|
||||||
|
src->GlyphExcludeRanges = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a compact, baked "..." if it doesn't exist, by using the ".".
|
// Create a compact, baked "..." if it doesn't exist, by using the ".".
|
||||||
// This may seem overly complicated right now but the point is to exercise and improve a technique which should be increasingly used.
|
// This may seem overly complicated right now but the point is to exercise and improve a technique which should be increasingly used.
|
||||||
// FIXME-NEWATLAS: This borrows too much from FontLoader's FontLoadGlyph() handlers and suggest that we should add further helpers.
|
// FIXME-NEWATLAS: This borrows too much from FontLoader's FontLoadGlyph() handlers and suggest that we should add further helpers.
|
||||||
@@ -3721,7 +3721,7 @@ void ImFontAtlasBuildSetupFontSpecialGlyphs(ImFontAtlas* atlas, ImFont* font, Im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlasBuildDiscardFontBakedGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph)
|
void ImFontAtlasBakedDiscardFontGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph)
|
||||||
{
|
{
|
||||||
if (glyph->PackId != ImFontAtlasRectId_Invalid)
|
if (glyph->PackId != ImFontAtlasRectId_Invalid)
|
||||||
{
|
{
|
||||||
@@ -3736,7 +3736,7 @@ void ImFontAtlasBuildDiscardFontBakedGlyph(ImFontAtlas* atlas, ImFont* font, ImF
|
|||||||
baked->IndexAdvanceX[c] = baked->FallbackAdvanceX;
|
baked->IndexAdvanceX[c] = baked->FallbackAdvanceX;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImFontBaked* ImFontAtlasBuildAddFontBaked(ImFontAtlas* atlas, ImFont* font, float font_size, ImGuiID baked_id)
|
ImFontBaked* ImFontAtlasBakedAdd(ImFontAtlas* atlas, ImFont* font, float font_size, ImGuiID baked_id)
|
||||||
{
|
{
|
||||||
IMGUI_DEBUG_LOG_FONT("[font] Created baked %.2fpx\n", font_size);
|
IMGUI_DEBUG_LOG_FONT("[font] Created baked %.2fpx\n", font_size);
|
||||||
ImFontBaked* baked = atlas->Builder->BakedPool.push_back(ImFontBaked());
|
ImFontBaked* baked = atlas->Builder->BakedPool.push_back(ImFontBaked());
|
||||||
@@ -3769,7 +3769,7 @@ ImFontBaked* ImFontAtlasBuildAddFontBaked(ImFontAtlas* atlas, ImFont* font, floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME-OPT: This is not a fast query. Adding a BakedCount field in Font might allow to take a shortcut for the most common case.
|
// FIXME-OPT: This is not a fast query. Adding a BakedCount field in Font might allow to take a shortcut for the most common case.
|
||||||
ImFontBaked* ImFontAtlasBuildGetClosestFontBakedMatch(ImFontAtlas* atlas, ImFont* font, float font_size)
|
ImFontBaked* ImFontAtlasBakedGetClosestMatch(ImFontAtlas* atlas, ImFont* font, float font_size)
|
||||||
{
|
{
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
ImFontBaked* closest_larger_match = NULL;
|
ImFontBaked* closest_larger_match = NULL;
|
||||||
@@ -3792,7 +3792,7 @@ ImFontBaked* ImFontAtlasBuildGetClosestFontBakedMatch(ImFontAtlas* atlas, ImFont
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlasBuildDiscardFontBaked(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked)
|
void ImFontAtlasBakedDiscard(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked)
|
||||||
{
|
{
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
IMGUI_DEBUG_LOG_FONT("[font] Discard baked %.2f for \"%s\"\n", baked->Size, font->GetDebugName());
|
IMGUI_DEBUG_LOG_FONT("[font] Discard baked %.2f for \"%s\"\n", baked->Size, font->GetDebugName());
|
||||||
@@ -3822,14 +3822,14 @@ void ImFontAtlasBuildDiscardFontBaked(ImFontAtlas* atlas, ImFont* font, ImFontBa
|
|||||||
font->LastBaked = NULL;
|
font->LastBaked = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlasBuildDiscardFontBakes(ImFontAtlas* atlas, ImFont* font)
|
void ImFontAtlasFontDiscardOutputBakes(ImFontAtlas* atlas, ImFont* font)
|
||||||
{
|
{
|
||||||
if (ImFontAtlasBuilder* builder = atlas->Builder) // This can be called from font destructor
|
if (ImFontAtlasBuilder* builder = atlas->Builder) // This can be called from font destructor
|
||||||
for (int baked_n = 0; baked_n < builder->BakedPool.Size; baked_n++)
|
for (int baked_n = 0; baked_n < builder->BakedPool.Size; baked_n++)
|
||||||
{
|
{
|
||||||
ImFontBaked* baked = &builder->BakedPool[baked_n];
|
ImFontBaked* baked = &builder->BakedPool[baked_n];
|
||||||
if (baked->ContainerFont == font && !baked->WantDestroy)
|
if (baked->ContainerFont == font && !baked->WantDestroy)
|
||||||
ImFontAtlasBuildDiscardFontBaked(atlas, font, baked);
|
ImFontAtlasBakedDiscard(atlas, font, baked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3844,7 +3844,7 @@ void ImFontAtlasBuildDiscardBakes(ImFontAtlas* atlas, int unused_frames)
|
|||||||
continue;
|
continue;
|
||||||
if (baked->WantDestroy || (baked->ContainerFont->Flags & ImFontFlags_LockBakedSizes))
|
if (baked->WantDestroy || (baked->ContainerFont->Flags & ImFontFlags_LockBakedSizes))
|
||||||
continue;
|
continue;
|
||||||
ImFontAtlasBuildDiscardFontBaked(atlas, baked->ContainerFont, baked);
|
ImFontAtlasBakedDiscard(atlas, baked->ContainerFont, baked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3905,7 +3905,7 @@ static void ImFontAtlasBuildSetTexture(ImFontAtlas* atlas, ImTextureData* tex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a new texture, discard previous one
|
// Create a new texture, discard previous one
|
||||||
ImTextureData* ImFontAtlasBuildAddTexture(ImFontAtlas* atlas, int w, int h)
|
ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h)
|
||||||
{
|
{
|
||||||
ImTextureData* old_tex = atlas->TexData;
|
ImTextureData* old_tex = atlas->TexData;
|
||||||
ImTextureData* new_tex;
|
ImTextureData* new_tex;
|
||||||
@@ -3955,13 +3955,13 @@ static void ImFontAtlasDebugWriteTexToDisk(ImTextureData* tex, const char* descr
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ImFontAtlasBuildRepackTexture(ImFontAtlas* atlas, int w, int h)
|
void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h)
|
||||||
{
|
{
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
builder->LockDisableResize = true;
|
builder->LockDisableResize = true;
|
||||||
|
|
||||||
ImTextureData* old_tex = atlas->TexData;
|
ImTextureData* old_tex = atlas->TexData;
|
||||||
ImTextureData* new_tex = ImFontAtlasBuildAddTexture(atlas, w, h);
|
ImTextureData* new_tex = ImFontAtlasTextureAdd(atlas, w, h);
|
||||||
new_tex->UseColors = old_tex->UseColors;
|
new_tex->UseColors = old_tex->UseColors;
|
||||||
IMGUI_DEBUG_LOG_FONT("[font] Texture #%03d: resize+repack %dx%d => Texture #%03d: %dx%d\n", old_tex->UniqueID, old_tex->Width, old_tex->Height, new_tex->UniqueID, new_tex->Width, new_tex->Height);
|
IMGUI_DEBUG_LOG_FONT("[font] Texture #%03d: resize+repack %dx%d => Texture #%03d: %dx%d\n", old_tex->UniqueID, old_tex->Width, old_tex->Height, new_tex->UniqueID, new_tex->Width, new_tex->Height);
|
||||||
//for (int baked_n = 0; baked_n < builder->BakedPool.Size; baked_n++)
|
//for (int baked_n = 0; baked_n < builder->BakedPool.Size; baked_n++)
|
||||||
@@ -3995,7 +3995,7 @@ void ImFontAtlasBuildRepackTexture(ImFontAtlas* atlas, int w, int h)
|
|||||||
builder->Rects.swap(old_rects);
|
builder->Rects.swap(old_rects);
|
||||||
builder->RectsIndex = old_index;
|
builder->RectsIndex = old_index;
|
||||||
ImFontAtlasBuildSetTexture(atlas, old_tex);
|
ImFontAtlasBuildSetTexture(atlas, old_tex);
|
||||||
ImFontAtlasBuildGrowTexture(atlas, w, h); // Recurse
|
ImFontAtlasTextureGrow(atlas, w, h); // Recurse
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IM_ASSERT(ImFontAtlasRectId_GetIndex(new_r_id) == builder->RectsIndex.index_from_ptr(&index_entry));
|
IM_ASSERT(ImFontAtlasRectId_GetIndex(new_r_id) == builder->RectsIndex.index_from_ptr(&index_entry));
|
||||||
@@ -4027,7 +4027,7 @@ void ImFontAtlasBuildRepackTexture(ImFontAtlas* atlas, int w, int h)
|
|||||||
//ImFontAtlasDebugWriteTexToDisk(new_tex, "After Pack");
|
//ImFontAtlasDebugWriteTexToDisk(new_tex, "After Pack");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlasBuildGrowTexture(ImFontAtlas* atlas, int old_tex_w, int old_tex_h)
|
void ImFontAtlasTextureGrow(ImFontAtlas* atlas, int old_tex_w, int old_tex_h)
|
||||||
{
|
{
|
||||||
//ImFontAtlasDebugWriteTexToDisk(atlas->TexData, "Before Grow");
|
//ImFontAtlasDebugWriteTexToDisk(atlas->TexData, "Before Grow");
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
@@ -4056,10 +4056,10 @@ void ImFontAtlasBuildGrowTexture(ImFontAtlas* atlas, int old_tex_w, int old_tex_
|
|||||||
if (new_tex_w == old_tex_w && new_tex_h == old_tex_h)
|
if (new_tex_w == old_tex_w && new_tex_h == old_tex_h)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImFontAtlasBuildRepackTexture(atlas, new_tex_w, new_tex_h);
|
ImFontAtlasTextureRepack(atlas, new_tex_w, new_tex_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImFontAtlasBuildMakeSpace(ImFontAtlas* atlas)
|
void ImFontAtlasTextureMakeSpace(ImFontAtlas* atlas)
|
||||||
{
|
{
|
||||||
// Can some baked contents be ditched?
|
// Can some baked contents be ditched?
|
||||||
//IMGUI_DEBUG_LOG_FONT("[font] ImFontAtlasBuildMakeSpace()\n");
|
//IMGUI_DEBUG_LOG_FONT("[font] ImFontAtlasBuildMakeSpace()\n");
|
||||||
@@ -4068,12 +4068,12 @@ void ImFontAtlasBuildMakeSpace(ImFontAtlas* atlas)
|
|||||||
|
|
||||||
// Currently using a heuristic for repack without growing.
|
// Currently using a heuristic for repack without growing.
|
||||||
if (builder->RectsDiscardedSurface < builder->RectsPackedSurface * 0.20f)
|
if (builder->RectsDiscardedSurface < builder->RectsPackedSurface * 0.20f)
|
||||||
ImFontAtlasBuildGrowTexture(atlas);
|
ImFontAtlasTextureGrow(atlas);
|
||||||
else
|
else
|
||||||
ImFontAtlasBuildRepackTexture(atlas, atlas->TexData->Width, atlas->TexData->Height);
|
ImFontAtlasTextureRepack(atlas, atlas->TexData->Width, atlas->TexData->Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImVec2i ImFontAtlasBuildGetTextureSizeEstimate(ImFontAtlas* atlas)
|
ImVec2i ImFontAtlasTextureGetSizeEstimate(ImFontAtlas* atlas)
|
||||||
{
|
{
|
||||||
int min_w = ImUpperPowerOfTwo(atlas->TexMinWidth);
|
int min_w = ImUpperPowerOfTwo(atlas->TexMinWidth);
|
||||||
int min_h = ImUpperPowerOfTwo(atlas->TexMinHeight);
|
int min_h = ImUpperPowerOfTwo(atlas->TexMinHeight);
|
||||||
@@ -4110,26 +4110,26 @@ ImVec2i ImFontAtlasBuildGetTextureSizeEstimate(ImFontAtlas* atlas)
|
|||||||
// Clear all output. Invalidates all AddCustomRect() return values!
|
// Clear all output. Invalidates all AddCustomRect() return values!
|
||||||
void ImFontAtlasBuildClear(ImFontAtlas* atlas)
|
void ImFontAtlasBuildClear(ImFontAtlas* atlas)
|
||||||
{
|
{
|
||||||
ImVec2i new_tex_size = ImFontAtlasBuildGetTextureSizeEstimate(atlas);
|
ImVec2i new_tex_size = ImFontAtlasTextureGetSizeEstimate(atlas);
|
||||||
ImFontAtlasBuildDestroy(atlas);
|
ImFontAtlasBuildDestroy(atlas);
|
||||||
ImFontAtlasBuildAddTexture(atlas, new_tex_size.x, new_tex_size.y);
|
ImFontAtlasTextureAdd(atlas, new_tex_size.x, new_tex_size.y);
|
||||||
ImFontAtlasBuildInit(atlas);
|
ImFontAtlasBuildInit(atlas);
|
||||||
}
|
}
|
||||||
|
|
||||||
// You should not need to call this manually!
|
// You should not need to call this manually!
|
||||||
// If you think you do, let us know and we can advise about policies auto-compact.
|
// If you think you do, let us know and we can advise about policies auto-compact.
|
||||||
void ImFontAtlasBuildCompactTexture(ImFontAtlas* atlas)
|
void ImFontAtlasTextureCompact(ImFontAtlas* atlas)
|
||||||
{
|
{
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
ImFontAtlasBuildDiscardBakes(atlas, 1);
|
ImFontAtlasBuildDiscardBakes(atlas, 1);
|
||||||
|
|
||||||
ImTextureData* old_tex = atlas->TexData;
|
ImTextureData* old_tex = atlas->TexData;
|
||||||
ImVec2i old_tex_size = ImVec2i(old_tex->Width, old_tex->Height);
|
ImVec2i old_tex_size = ImVec2i(old_tex->Width, old_tex->Height);
|
||||||
ImVec2i new_tex_size = ImFontAtlasBuildGetTextureSizeEstimate(atlas);
|
ImVec2i new_tex_size = ImFontAtlasTextureGetSizeEstimate(atlas);
|
||||||
if (builder->RectsDiscardedCount == 0 && new_tex_size.x == old_tex_size.x && new_tex_size.y == old_tex_size.y)
|
if (builder->RectsDiscardedCount == 0 && new_tex_size.x == old_tex_size.x && new_tex_size.y == old_tex_size.y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImFontAtlasBuildRepackTexture(atlas, new_tex_size.x, new_tex_size.y);
|
ImFontAtlasTextureRepack(atlas, new_tex_size.x, new_tex_size.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start packing over current empty texture
|
// Start packing over current empty texture
|
||||||
@@ -4153,7 +4153,7 @@ void ImFontAtlasBuildInit(ImFontAtlas* atlas)
|
|||||||
|
|
||||||
// Create initial texture size
|
// Create initial texture size
|
||||||
if (atlas->TexData == NULL || atlas->TexData->Pixels == NULL)
|
if (atlas->TexData == NULL || atlas->TexData->Pixels == NULL)
|
||||||
ImFontAtlasBuildAddTexture(atlas, ImUpperPowerOfTwo(atlas->TexMinWidth), ImUpperPowerOfTwo(atlas->TexMinHeight));
|
ImFontAtlasTextureAdd(atlas, ImUpperPowerOfTwo(atlas->TexMinWidth), ImUpperPowerOfTwo(atlas->TexMinHeight));
|
||||||
|
|
||||||
atlas->Builder = IM_NEW(ImFontAtlasBuilder)();
|
atlas->Builder = IM_NEW(ImFontAtlasBuilder)();
|
||||||
if (atlas->FontLoader->LoaderInit)
|
if (atlas->FontLoader->LoaderInit)
|
||||||
@@ -4170,7 +4170,7 @@ void ImFontAtlasBuildInit(ImFontAtlas* atlas)
|
|||||||
// Register fonts
|
// Register fonts
|
||||||
ImFontAtlasBuildUpdatePointers(atlas);
|
ImFontAtlasBuildUpdatePointers(atlas);
|
||||||
for (ImFontConfig& cfg : atlas->Sources)
|
for (ImFontConfig& cfg : atlas->Sources)
|
||||||
ImFontAtlasBuildAddFont(atlas, &cfg);
|
ImFontAtlasFontInitSource(atlas, &cfg);
|
||||||
|
|
||||||
// Update UV coordinates etc. stored in bound ImDrawListSharedData instance
|
// Update UV coordinates etc. stored in bound ImDrawListSharedData instance
|
||||||
ImFontAtlasUpdateDrawListsSharedData(atlas);
|
ImFontAtlasUpdateDrawListsSharedData(atlas);
|
||||||
@@ -4182,7 +4182,7 @@ void ImFontAtlasBuildInit(ImFontAtlas* atlas)
|
|||||||
void ImFontAtlasBuildDestroy(ImFontAtlas* atlas)
|
void ImFontAtlasBuildDestroy(ImFontAtlas* atlas)
|
||||||
{
|
{
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
ImFontAtlasBuildDestroyFontOutput(atlas, font);
|
ImFontAtlasFontDestroyOutput(atlas, font);
|
||||||
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderShutdown)
|
if (atlas->Builder && atlas->FontLoader && atlas->FontLoader->LoaderShutdown)
|
||||||
{
|
{
|
||||||
atlas->FontLoader->LoaderShutdown(atlas);
|
atlas->FontLoader->LoaderShutdown(atlas);
|
||||||
@@ -4299,7 +4299,7 @@ ImFontAtlasRectId ImFontAtlasPackAddRect(ImFontAtlas* atlas, int w, int h, ImFon
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resize or repack atlas! (this should be a rare event)
|
// Resize or repack atlas! (this should be a rare event)
|
||||||
ImFontAtlasBuildMakeSpace(atlas);
|
ImFontAtlasTextureMakeSpace(atlas);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder->MaxRectBounds.x = ImMax(builder->MaxRectBounds.x, r.x + r.w + pack_padding);
|
builder->MaxRectBounds.x = ImMax(builder->MaxRectBounds.x, r.x + r.w + pack_padding);
|
||||||
@@ -4992,7 +4992,7 @@ ImFont::~ImFont()
|
|||||||
void ImFont::ClearOutputData()
|
void ImFont::ClearOutputData()
|
||||||
{
|
{
|
||||||
if (ImFontAtlas* atlas = ContainerAtlas)
|
if (ImFontAtlas* atlas = ContainerAtlas)
|
||||||
ImFontAtlasBuildDiscardFontBakes(atlas, this);
|
ImFontAtlasFontDiscardOutputBakes(atlas, this);
|
||||||
FallbackChar = EllipsisChar = 0;
|
FallbackChar = EllipsisChar = 0;
|
||||||
memset(Used8kPagesMap, 0, sizeof(Used8kPagesMap));
|
memset(Used8kPagesMap, 0, sizeof(Used8kPagesMap));
|
||||||
LastBaked = NULL;
|
LastBaked = NULL;
|
||||||
@@ -5197,7 +5197,7 @@ ImFontBaked* ImFont::GetFontBaked(float size)
|
|||||||
|
|
||||||
ImFontAtlas* atlas = ContainerAtlas;
|
ImFontAtlas* atlas = ContainerAtlas;
|
||||||
ImFontAtlasBuilder* builder = atlas->Builder;
|
ImFontAtlasBuilder* builder = atlas->Builder;
|
||||||
baked = ImFontAtlasBuildGetFontBaked(atlas, this, size);
|
baked = ImFontAtlasBakedGetOrAdd(atlas, this, size);
|
||||||
if (baked == NULL)
|
if (baked == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
baked->LastUsedFrame = builder->FrameCount;
|
baked->LastUsedFrame = builder->FrameCount;
|
||||||
@@ -5205,7 +5205,7 @@ ImFontBaked* ImFont::GetFontBaked(float size)
|
|||||||
return baked;
|
return baked;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImFontBaked* ImFontAtlasBuildGetFontBaked(ImFontAtlas* atlas, ImFont* font, float font_size)
|
ImFontBaked* ImFontAtlasBakedGetOrAdd(ImFontAtlas* atlas, ImFont* font, float font_size)
|
||||||
{
|
{
|
||||||
// FIXME-NEWATLAS: Design for picking a nearest size based on some criteria?
|
// FIXME-NEWATLAS: Design for picking a nearest size based on some criteria?
|
||||||
// FIXME-NEWATLAS: Altering font density won't work right away.
|
// FIXME-NEWATLAS: Altering font density won't work right away.
|
||||||
@@ -5223,7 +5223,7 @@ ImFontBaked* ImFontAtlasBuildGetFontBaked(ImFontAtlas* atlas, ImFont* font, floa
|
|||||||
// FIXME-OPT: This is not an optimal query.
|
// FIXME-OPT: This is not an optimal query.
|
||||||
if ((font->Flags & ImFontFlags_LockBakedSizes) || atlas->Locked)
|
if ((font->Flags & ImFontFlags_LockBakedSizes) || atlas->Locked)
|
||||||
{
|
{
|
||||||
baked = ImFontAtlasBuildGetClosestFontBakedMatch(atlas, font, font_size);
|
baked = ImFontAtlasBakedGetClosestMatch(atlas, font, font_size);
|
||||||
if (baked != NULL)
|
if (baked != NULL)
|
||||||
return baked;
|
return baked;
|
||||||
if (atlas->Locked)
|
if (atlas->Locked)
|
||||||
@@ -5234,7 +5234,7 @@ ImFontBaked* ImFontAtlasBuildGetFontBaked(ImFontAtlas* atlas, ImFont* font, floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create new
|
// Create new
|
||||||
baked = ImFontAtlasBuildAddFontBaked(atlas, font, font_size, baked_id);
|
baked = ImFontAtlasBakedAdd(atlas, font, font_size, baked_id);
|
||||||
*p_baked_in_map = baked; // To avoid 'builder->BakedMap.SetVoidPtr(baked_id, baked);' while we can.
|
*p_baked_in_map = baked; // To avoid 'builder->BakedMap.SetVoidPtr(baked_id, baked);' while we can.
|
||||||
return baked;
|
return baked;
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -3772,32 +3772,32 @@ IMGUI_API void ImFontAtlasBuildUpdatePointers(ImFontAtlas* atlas);
|
|||||||
IMGUI_API void ImFontAtlasBuildRenderBitmapFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char);
|
IMGUI_API void ImFontAtlasBuildRenderBitmapFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char);
|
||||||
IMGUI_API void ImFontAtlasBuildClear(ImFontAtlas* atlas); // Clear output and custom rects
|
IMGUI_API void ImFontAtlasBuildClear(ImFontAtlas* atlas); // Clear output and custom rects
|
||||||
|
|
||||||
IMGUI_API ImTextureData* ImFontAtlasBuildAddTexture(ImFontAtlas* atlas, int w, int h);
|
IMGUI_API ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h);
|
||||||
IMGUI_API void ImFontAtlasBuildMakeSpace(ImFontAtlas* atlas);
|
IMGUI_API void ImFontAtlasTextureMakeSpace(ImFontAtlas* atlas);
|
||||||
IMGUI_API void ImFontAtlasBuildRepackTexture(ImFontAtlas* atlas, int w, int h);
|
IMGUI_API void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h);
|
||||||
IMGUI_API void ImFontAtlasBuildGrowTexture(ImFontAtlas* atlas, int old_w = -1, int old_h = -1);
|
IMGUI_API void ImFontAtlasTextureGrow(ImFontAtlas* atlas, int old_w = -1, int old_h = -1);
|
||||||
IMGUI_API void ImFontAtlasBuildCompactTexture(ImFontAtlas* atlas);
|
IMGUI_API void ImFontAtlasTextureCompact(ImFontAtlas* atlas);
|
||||||
IMGUI_API ImVec2i ImFontAtlasBuildGetTextureSizeEstimate(ImFontAtlas* atlas);
|
IMGUI_API ImVec2i ImFontAtlasTextureGetSizeEstimate(ImFontAtlas* atlas);
|
||||||
|
|
||||||
IMGUI_API bool ImFontAtlasBuildAddFont(ImFontAtlas* atlas, ImFontConfig* src);
|
|
||||||
IMGUI_API void ImFontAtlasBuildSetupFontSpecialGlyphs(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src);
|
IMGUI_API void ImFontAtlasBuildSetupFontSpecialGlyphs(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src);
|
||||||
IMGUI_API void ImFontAtlasBuildPreloadAllGlyphRanges(ImFontAtlas* atlas); // Legacy
|
IMGUI_API void ImFontAtlasBuildPreloadAllGlyphRanges(ImFontAtlas* atlas); // Legacy
|
||||||
IMGUI_API void ImFontAtlasBuildGetOversampleFactors(ImFontConfig* src, float size, int* out_oversample_h, int* out_oversample_v);
|
IMGUI_API void ImFontAtlasBuildGetOversampleFactors(ImFontConfig* src, float size, int* out_oversample_h, int* out_oversample_v);
|
||||||
IMGUI_API bool ImFontAtlasBuildInitFontOutput(ImFontAtlas* atlas, ImFont* font); // Using DestroyFontOutput/InitFontOutput sequence useful notably if font loader params have changed
|
|
||||||
IMGUI_API void ImFontAtlasBuildDestroyFontOutput(ImFontAtlas* atlas, ImFont* font);
|
|
||||||
IMGUI_API void ImFontAtlasBuildDestroyFontSourceData(ImFontAtlas* atlas, ImFontConfig* src);
|
|
||||||
|
|
||||||
IMGUI_API ImFontBaked* ImFontAtlasBuildGetFontBaked(ImFontAtlas* atlas, ImFont* font, float font_size);
|
|
||||||
IMGUI_API ImFontBaked* ImFontAtlasBuildAddFontBaked(ImFontAtlas* atlas, ImFont* font, float font_size, ImGuiID baked_id);
|
|
||||||
IMGUI_API ImFontBaked* ImFontAtlasBuildGetClosestFontBakedMatch(ImFontAtlas* atlas, ImFont* font, float font_size);
|
|
||||||
IMGUI_API void ImFontAtlasBuildDiscardBakes(ImFontAtlas* atlas, int unused_frames);
|
IMGUI_API void ImFontAtlasBuildDiscardBakes(ImFontAtlas* atlas, int unused_frames);
|
||||||
IMGUI_API void ImFontAtlasBuildDiscardFontBakes(ImFontAtlas* atlas, ImFont* font);
|
|
||||||
IMGUI_API void ImFontAtlasBuildDiscardFontBaked(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked);
|
|
||||||
IMGUI_API void ImFontAtlasBuildDiscardFontBakedGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph);
|
|
||||||
|
|
||||||
IMGUI_API ImFontGlyph* ImFontAtlasBakedAddFontGlyph(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, const ImFontGlyph* in_glyph);
|
IMGUI_API bool ImFontAtlasFontInitSource(ImFontAtlas* atlas, ImFontConfig* src);
|
||||||
IMGUI_API void ImFontAtlasBakedSetFontGlyphBitmap(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImFontGlyph* glyph, ImTextureRect* r, const unsigned char* src_pixels, ImTextureFormat src_fmt, int src_pitch);
|
IMGUI_API void ImFontAtlasFontDestroySourceData(ImFontAtlas* atlas, ImFontConfig* src);
|
||||||
|
IMGUI_API bool ImFontAtlasFontInitOutput(ImFontAtlas* atlas, ImFont* font); // Using FontDestroyOutput/FontInitOutput sequence useful notably if font loader params have changed
|
||||||
|
IMGUI_API void ImFontAtlasFontDestroyOutput(ImFontAtlas* atlas, ImFont* font);
|
||||||
|
IMGUI_API void ImFontAtlasFontDiscardOutputBakes(ImFontAtlas* atlas, ImFont* font);
|
||||||
|
|
||||||
IMGUI_API ImGuiID ImFontAtlasBakedGetId(ImGuiID font_id, float baked_size);
|
IMGUI_API ImGuiID ImFontAtlasBakedGetId(ImGuiID font_id, float baked_size);
|
||||||
|
IMGUI_API ImFontBaked* ImFontAtlasBakedGetOrAdd(ImFontAtlas* atlas, ImFont* font, float font_size);
|
||||||
|
IMGUI_API ImFontBaked* ImFontAtlasBakedGetClosestMatch(ImFontAtlas* atlas, ImFont* font, float font_size);
|
||||||
|
IMGUI_API ImFontBaked* ImFontAtlasBakedAdd(ImFontAtlas* atlas, ImFont* font, float font_size, ImGuiID baked_id);
|
||||||
|
IMGUI_API void ImFontAtlasBakedDiscard(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked);
|
||||||
|
IMGUI_API ImFontGlyph* ImFontAtlasBakedAddFontGlyph(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, const ImFontGlyph* in_glyph);
|
||||||
|
IMGUI_API void ImFontAtlasBakedDiscardFontGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph);
|
||||||
|
IMGUI_API void ImFontAtlasBakedSetFontGlyphBitmap(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImFontGlyph* glyph, ImTextureRect* r, const unsigned char* src_pixels, ImTextureFormat src_fmt, int src_pitch);
|
||||||
|
|
||||||
IMGUI_API void ImFontAtlasPackInit(ImFontAtlas* atlas);
|
IMGUI_API void ImFontAtlasPackInit(ImFontAtlas* atlas);
|
||||||
IMGUI_API ImFontAtlasRectId ImFontAtlasPackAddRect(ImFontAtlas* atlas, int w, int h, ImFontAtlasRectEntry* overwrite_entry = NULL);
|
IMGUI_API ImFontAtlasRectId ImFontAtlasPackAddRect(ImFontAtlas* atlas, int w, int h, ImFontAtlasRectEntry* overwrite_entry = NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user