This is called/shared by both the stb_truetype and the FreeType builder.
| 2830 | |
| 2831 | // This is called/shared by both the stb_truetype and the FreeType builder. |
| 2832 | void ImFontAtlasBuildFinish(ImFontAtlas* atlas) |
| 2833 | { |
| 2834 | // Render into our custom data blocks |
| 2835 | IM_ASSERT(atlas->TexPixelsAlpha8 != NULL || atlas->TexPixelsRGBA32 != NULL); |
| 2836 | ImFontAtlasBuildRenderDefaultTexData(atlas); |
| 2837 | ImFontAtlasBuildRenderLinesTexData(atlas); |
| 2838 | |
| 2839 | // Register custom rectangle glyphs |
| 2840 | for (int i = 0; i < atlas->CustomRects.Size; i++) |
| 2841 | { |
| 2842 | const ImFontAtlasCustomRect* r = &atlas->CustomRects[i]; |
| 2843 | if (r->Font == NULL || r->GlyphID == 0) |
| 2844 | continue; |
| 2845 | |
| 2846 | // Will ignore ImFontConfig settings: GlyphMinAdvanceX, GlyphMinAdvanceY, GlyphExtraSpacing, PixelSnapH |
| 2847 | IM_ASSERT(r->Font->ContainerAtlas == atlas); |
| 2848 | ImVec2 uv0, uv1; |
| 2849 | atlas->CalcCustomRectUV(r, &uv0, &uv1); |
| 2850 | r->Font->AddGlyph(NULL, (ImWchar)r->GlyphID, 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); |
| 2851 | } |
| 2852 | |
| 2853 | // Build all fonts lookup tables |
| 2854 | for (ImFont* font : atlas->Fonts) |
| 2855 | if (font->DirtyLookupTables) |
| 2856 | font->BuildLookupTable(); |
| 2857 | |
| 2858 | atlas->TexReady = true; |
| 2859 | } |
| 2860 | |
| 2861 | // Retrieve list of range (2 int per range, values are inclusive) |
| 2862 | const ImWchar* ImFontAtlas::GetGlyphRangesDefault() |
no test coverage detected