MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ImFontAtlasBuildFinish

Function ImFontAtlasBuildFinish

libs/imgui/imgui_draw.cpp:1906–1927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1904}
1905
1906void ImFontAtlasBuildFinish(ImFontAtlas* atlas)
1907{
1908 // Render into our custom data block
1909 ImFontAtlasBuildRenderDefaultTexData(atlas);
1910
1911 // Register custom rectangle glyphs
1912 for (int i = 0; i < atlas->CustomRects.Size; i++)
1913 {
1914 const ImFontAtlas::CustomRect& r = atlas->CustomRects[i];
1915 if (r.Font == NULL || r.ID > 0x10000)
1916 continue;
1917
1918 IM_ASSERT(r.Font->ContainerAtlas == atlas);
1919 ImVec2 uv0, uv1;
1920 atlas->CalcCustomRectUV(&r, &uv0, &uv1);
1921 r.Font->AddGlyph((ImWchar)r.ID, r.GlyphOffset.x, r.GlyphOffset.y, r.GlyphOffset.x + r.Width, r.GlyphOffset.y + r.Height, uv0.x, uv0.y, uv1.x, uv1.y, r.GlyphAdvanceX);
1922 }
1923
1924 // Build all fonts lookup tables
1925 for (int i = 0; i < atlas->Fonts.Size; i++)
1926 atlas->Fonts[i]->BuildLookupTable();
1927}
1928
1929// Retrieve list of range (2 int per range, values are inclusive)
1930const ImWchar* ImFontAtlas::GetGlyphRangesDefault()

Callers 1

Calls 4

CalcCustomRectUVMethod · 0.80
AddGlyphMethod · 0.80
BuildLookupTableMethod · 0.80

Tested by

no test coverage detected