* src/base/ftobjs.c (FT_Render_Glyph_Internal): Protect FT_LOAD_COLOR.

Now only *scalable* COLRv0 layers can be rendered with FT_LOAD_COLOR,
in accordance with Chromium. Fixes #1425, also see !424.
This commit is contained in:
Alexei Podtelezhnikov 2026-05-02 15:17:35 -04:00
parent 590b77014b
commit cbe12767ea

View file

@ -4741,7 +4741,8 @@
/* try to render colored glyph layers as a special case */
if ( slot->internal->load_flags & FT_LOAD_COLOR )
if ( slot->internal->load_flags & FT_LOAD_COLOR &&
slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
FT_LayerIterator iterator;
@ -4777,7 +4778,7 @@
load_flags &= ~FT_LOAD_COLOR;
/* render into the new `face->glyph' glyph slot */
load_flags |= FT_LOAD_RENDER;
load_flags |= FT_LOAD_RENDER | FT_LOAD_NO_BITMAP;
error = FT_Load_Glyph( face, glyph_index, load_flags );
if ( error )