Closed Bug 1425812 Opened 5 years ago Closed 4 years ago

COLR color font stopped working on OSX High Sierra


(Core :: Graphics: Text, defect, P2)

56 Branch



Tracking Status
firefox62 --- fixed


(Reporter: roel, Assigned: jfkthame)


(Depends on 1 open bug)



(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36 OPR/49.0.2725.39

Steps to reproduce:

Use a COLR/CPAL color font in Firefox. A simple test font can be found here: (it should show a green checkmark under "Microsoft COLR/CPAL") and a JavaScript check can be found here:

Works on OSX Sierra, Not in High Sierra for any version above 56 (didn't test below).

This is mosty likely because Apple introduced native COLR/CPAL support in High Sierra, which might clash with Firefox' internal support.

Actual results:

The font is rendered in "black and white". COLR information is ignored.

Expected results:

The font should be loaded and a green checkmark should be shown on the first page, and the ChromaCheck page should show a green message saying COLR/CPAL is supported.
Component: Untriaged → Layout: Text
OS: Unspecified → Mac OS X
Product: Firefox → Core
Hardware: Unspecified → x86
Blocks: highsierra
Markus, can you confirm this? (I'm not currently on 10.13, but offhand I don't see why a change in Apple's support should have affected how we render these fonts.)
Flags: needinfo?(mstange)
I can confirm that 'COLR'-format fonts seem to be broken in Firefox on macOS 10.13; they just render solid black glyphs.
Ever confirmed: true
Flags: needinfo?(mstange)
Priority: -- → P3
I checked that we're calling gfxFont::RenderColorGlyph as expected, and this in turn calls aDrawTarget->FillGlyphs() for each of the component layers that make up the color glyph, passing the correct color value from the font's palette. But the end result is that we render a solid black glyph.

I believe this used to work on 10.12, and works on 10.10 (which we're running in CI), such that our basic color-font reftests aren't failing; but if we had CI running 10.13 we'd be seeing the failure there. I don't know why the DrawTarget::FillGlyphs() calls are no longer resulting in the correct colors; AFAICS this seems to be an issue on the Graphics side.
Component: Layout: Text → Graphics: Text
Priority: P3 → P2
Hardware: x86 → All
Depends on: 1456856
Some observations:

I can get to work if I set the CPAL table version to 1 instead of 0:

  <version value="1"/>
  <numPaletteEntries value="2"/>
  <palette index="0">

Strangely, the COLR font used in ChromaCheck is still at CPAL table version 0, but *does* work. This was caused by compiling the font with an updated version of TTX/FontTools. Please see this commit: and specifically the changes to the COLR font:

I don't get why these changes suddenly made ChromaCheck's COLR font work in Firefox again, though.
(Recompiling the font with the new TTX/FontTools, but CPAL table version back to the original version of 0, still results in a broken COLR font)
Interesting, thanks. Does the CPAL-version-1 font work in Safari?
It appears that on HighSierra, when Core Text renders glyphs from a font with COLR/CPAL tables, it ignores any color we've set in the context and uses the colors from the font's palette; but when we render the individual glyphs that make up the layers of a composite, full-color glyphs, those individual-layer glyphs do not themselves have an inherent color (as the layer colors are associated with the "parent" composite glyph, which we don't directly ask Core Text to paint), and it just paints them black. So it looks like the easiest fix will be for us to disable our painting of the individual component glyphs on 10.13, and let Core Text do it for us.
Attachment #8981466 - Flags: review?(lsalzman)
Assignee: nobody → jfkthame
Try build with this patch: This  renders COLR glyphs successfully on 10.13 for me locally; we can't reftest it on treeherder because we don't have HighSierra test machines.

(We already have COLR-font reftests that would be failing because of this issue if our testing infrastructure were updated.)
Attachment #8981466 - Flags: review?(lsalzman) → review+
Pushed by
Rely on native Core Text support for COLR/CPAL fonts on High Sierra. r=lsalzman
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
That was quick! Thanks for the great work!

I wonder if this will also fix
(In reply to Roel Nieskens from comment #11)
> That was quick! Thanks for the great work!
> I wonder if this will also fix

I don't believe so, unfortunately; that'll require further investigation.
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.