Skip to content

3D Fluent Emojis #19038

Open
Feature
@tusharsnx

Description

@tusharsnx

Description of the new feature

Windows added 3D Fluent emoji support in 23H2. Supporting 3D Fluent emoji in Windows Terminal would be a nice addition.

Image

Proposed technical implementation details

3D Fluent emojis are implemented in COLRv1 format. We'd have to support drawing DWRITE_GLYPH_IMAGE_FORMATS_COLR here:

void Microsoft::Console::Render::Atlas::ColorGlyphRunDraw(ID2D1DeviceContext4* d2dRenderTarget4, ID2D1SolidColorBrush* emojiBrush, ID2D1SolidColorBrush* foregroundBrush, const DWRITE_COLOR_GLYPH_RUN1* colorGlyphRun) noexcept
{
ID2D1Brush* runBrush = nullptr;
if (colorGlyphRun->paletteIndex == /*DWRITE_NO_PALETTE_INDEX*/ 0xffff)
{
runBrush = foregroundBrush;
}
else
{
emojiBrush->SetColor(&colorGlyphRun->runColor);
runBrush = emojiBrush;
}
const D2D1_POINT_2F baselineOrigin{ colorGlyphRun->baselineOriginX, colorGlyphRun->baselineOriginY };
switch (colorGlyphRun->glyphImageFormat)
{
case DWRITE_GLYPH_IMAGE_FORMATS_NONE:
break;
case DWRITE_GLYPH_IMAGE_FORMATS_PNG:
case DWRITE_GLYPH_IMAGE_FORMATS_JPEG:
case DWRITE_GLYPH_IMAGE_FORMATS_TIFF:
case DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8:
d2dRenderTarget4->DrawColorBitmapGlyphRun(colorGlyphRun->glyphImageFormat, baselineOrigin, &colorGlyphRun->glyphRun, colorGlyphRun->measuringMode, D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT);
break;
case DWRITE_GLYPH_IMAGE_FORMATS_SVG:
d2dRenderTarget4->DrawSvgGlyphRun(baselineOrigin, &colorGlyphRun->glyphRun, runBrush, nullptr, 0, colorGlyphRun->measuringMode);
break;
default:
d2dRenderTarget4->DrawGlyphRun(baselineOrigin, &colorGlyphRun->glyphRun, colorGlyphRun->glyphRunDescription, runBrush, colorGlyphRun->measuringMode);
break;
}
}

Resources:

https://learn.microsoft.com/en-us/windows/win32/directwrite/color-fonts-preview#layers-of-solid-color-glyphs
https://learn.microsoft.com/en-us/typography/opentype/spec/colr#colr-version-1-rendering-algorithm
https://blogs.windows.com/windows-insider/2023/07/12/announcing-windows-11-insider-preview-build-25905
https://learn.microsoft.com/en-us/windows/win32/api/dcommon/ne-dcommon-dwrite_glyph_image_formats

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsResolution-Won't-FixWe're just really obstinate about this. There's probably a good reason.Tracking-ExternalThis bug isn't resolved, but it's following an external workitem.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions