Skip to content

Select fonts by requested emoji presentation - #745

Open
kane50613 wants to merge 2 commits into
linebender:mainfrom
kane50613:emoji-variation-selector-selection
Open

Select fonts by requested emoji presentation#745
kane50613 wants to merge 2 commits into
linebender:mainfrom
kane50613:emoji-variation-selector-selection

Conversation

@kane50613

@kane50613 kane50613 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

LLM Contributions: Claude fact check + generates, Codex review.

Now font selection only checks for "who has the first char?". Variation selectors like U+FE0F are ignored, same for U+FE0E. It also happened in the downstream kane50613/takumi#1218.

Per candidate font, an exact cmap format 14 match for the whole sequence wins first. Otherwise U+FE0F prefers fonts with color tables and U+FE0E fonts without. When no font matches the requested presentation, the base character still renders from a mismatched font instead of tofu.

To check whether the font has color tables, I've mirrored ColorTableLookup from Blink.

#692 seems to be solving the same bug, but only by moving the emoji generic family to the front, which overrides user-selected fonts that have their own emoji glyphs. Checking each font's capability avoids that.

#620 is the segmentation layer above this and complementary.

Changelog

  • Adds fontique::Charmap::map_variant, with MapVariant re-exported from read-fonts.
  • Adds FontInfo::has_color_tables().
  • Adds public QueryFont.has_color_tables.
  • [Breaking change:] QueryFont struct literals must provide the new has_color_tables field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant