Home

Awesome

ChromaCheck

ChromaCheck is a feature test to check if browsers support one of the five color font formats (see list below) when loaded as webfonts through @font-face. See it in action here!

Also, check out this this older article on color font formats, written before COLRv1 existed.

Please note that ChromaCheck currently doesn't work for Edge 18+ :-(

How it works

We test for color font support by rendering color glyphs to canvas, and then reading out the pixels to see if we have any color.

Older versions of Firefox, the first browser to support color fonts, had some bugs that needed to be circumvented. This was done by sticking the font in an SVG image, and then drawing that image on canvas. This is how ChromaCheck still works today.

How to use

Include chromacheck-min.js in your page and it'll add classes to the html element for each supported color format:

Take note that this test is async, so it can take a split millisecond before the classes are added.

Known issues

The SVG-on-canvas method might be replaced or extended with a non-SVG method to address the SVG related issues. Likewise it'd be possible to include two CBDT/CBLC fonts to test with: one on the old specs, one one the new. If you have a need for that right now, check out the feature/regular-test-page branch.

License

ChromaCheck is released under the MIT license.