FreeType: Fix CBDT/COLR bitmap color emoji font loading (#6302) - #9483
Open
Turtle-PB wants to merge 1 commit into
Open
FreeType: Fix CBDT/COLR bitmap color emoji font loading (#6302)#9483Turtle-PB wants to merge 1 commit into
Turtle-PB wants to merge 1 commit into
Conversation
CBDT fonts (NotoColorEmoji, Twemoji COLR) are not scalable — FT_Request_Size() returns 0x0 glyphs because the font has no scalable outline. Fix: Detect CBDT table via FT_Load_Sfnt_Table(). When present: - Use FT_Select_Size() to pick the closest bitmap strike size - Set FT_LOAD_COLOR flag for color glyph rendering Based on solution by @sakiodre in issue ocornut#6302. Tested with NotoColorEmoji_WindowsCompatible.ttf and Twemoji COLR v0.7.0.
Turtle-PB
added a commit
to Turtle-PB/imgui_xl
that referenced
this pull request
Jul 20, 2026
Turtle-PB
added a commit
to Turtle-PB/imgui_xl
that referenced
this pull request
Jul 20, 2026
- Hero badges: '3 PRs merged' + '3 PRs open' + 'Audio + MIDI + GUI Builder' - Stats: 6 upstream PRs, 3 merged, 12 widget types, 2 royalty-free tracks - PR list: All 6 PRs with correct status dots (merged=purple, open=green) - ocornut#9467 Android CI (merged) - ocornut#9473 OpenGL GL_UNPACK (merged) - ocornut#9474 Android touch + SDL2 (merged) - ocornut#9481 Texture destroy deferral (open) - ocornut#9483 CBDT/COLR emoji fonts (open) - ocornut#9469 Android backend + pressure (open)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #6302: NotoColorEmoji and other CBDT/COLR bitmap color emoji fonts fail to load in ImGui's FreeType backend. Glyphs render as empty boxes because
FT_Request_Size()returns 0x0 dimensions for non-scalable bitmap fonts.Root cause: CBDT fonts (NotoColorEmoji, Twemoji COLR, etc.) are not scalable (
FT_IS_SCALABLE(face)is false). They contain pre-rendered bitmap strikes at fixed sizes.FT_Request_Size()fails because it tries to scale an unscalable outline.Fix
Detect CBDT table via
FT_Load_Sfnt_Table(). When present:FT_Select_Size()to pick the closest available bitmap strike sizeFT_LOAD_COLORflag for color glyph renderingFalls back to standard
FT_Request_Size()path for scalable fonts (no behavioral change).Implementation
Based on solution proposed by @sakiodre in issue #6302:
Testing
References