Skip to content

Add colored emoji support on Windows (DirectWrite) - #83

Closed
eman007 wants to merge 1 commit into
alacritty:masterfrom
eman007:windows-color-emoji
Closed

Add colored emoji support on Windows (DirectWrite)#83
eman007 wants to merge 1 commit into
alacritty:masterfrom
eman007:windows-color-emoji

Conversation

@eman007

@eman007 eman007 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Adds colored emoji (COLR) rendering to the DirectWrite backend on Windows. Color glyphs are decomposed into their per-color layers via IDWriteFactory2::TranslateColorGlyphRun and composited into an RGBA bitmap; non-color glyphs continue through the existing ClearType greyscale path unchanged.

Before this change, emoji rendered as monochrome outline glyphs on Windows. They now render in full color.

Changes

  • Add a ColorFactory wrapping IDWriteFactory2, used to enumerate color glyph runs.
  • Decompose color glyph runs and composite their per-color layers into an RGBA BitmapBuffer.
  • Fall back to the existing greyscale path when a glyph has no color layers (DWRITE_E_NOCOLOR), and honor the foreground palette index (0xFFFF).
  • Enable the winapi dwrite/dwrite_1/dwrite_2/d2d1/dcommon/unknwnbase/winerror features required for the color APIs.

Testing

  • cargo check builds clean on stable (Windows).
  • Verified visually in Alacritty built against this crossfont: emoji render in color.
  • No effect on non-Windows backends — the new code lives entirely in the existing cfg(windows) DirectWrite module.

Decompose color glyph runs via IDWriteFactory2::TranslateColorGlyphRun and
composite the per-color layers into an RGBA bitmap; non-color glyphs continue
through the existing ClearType greyscale path. Enables colored emoji rendering
on Windows.

Adds the winapi dwrite_2/d2d1 feature flags required for the color APIs.
@eman007
eman007 force-pushed the windows-color-emoji branch from a22514a to e569d14 Compare July 18, 2026 02:59
@chrisduerr

Copy link
Copy Markdown
Member

@chrisduerr chrisduerr closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants