question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add chromacheck color fonts to test suite

See original GitHub issue

I have a working sbix testfont that I know ttx was able to handle properly half a year ago. Today I decompiled it with ttx version 3.21.2 (and before updating, 3.19.0) and tried to recompile it without making any changes.

This resulted in the following error:

$ ttx chromacheck-sbix.ttx
Compiling "chromacheck-sbix.ttx" to "chromacheck-sbix#1.ttf"...
Parsing 'GlyphOrder' table...
Parsing 'head' table...
Parsing 'hhea' table...
Parsing 'maxp' table...
Parsing 'OS/2' table...
Parsing 'hmtx' table...
Parsing 'cmap' table...
Parsing 'loca' table...
Parsing 'glyf' table...
Parsing 'name' table...
Parsing 'post' table...
Parsing 'sbix' table...
ERROR: Unhandled exception has occurred
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttx.py", line 389, in main
    process(jobs, options)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttx.py", line 363, in process
    action(input, output, options)
  File "/usr/local/lib/python3.6/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
    return func(*args, **kwds)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttx.py", line 281, in ttCompile
    ttf.save(output)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttLib/__init__.py", line 221, in save
    self._writeTable(tag, writer, done)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttLib/__init__.py", line 660, in _writeTable
    tabledata = self.getTableData(tag)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttLib/__init__.py", line 671, in getTableData
    return self.tables[tag].compile(self)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttLib/tables/_s_b_i_x.py", line 81, in compile
    current_strike.compile(ttFont)
  File "/usr/local/lib/python3.6/site-packages/fontTools/ttLib/tables/sbixStrike.py", line 86, in compile
    self.glyphDataOffsets += sstruct.pack(sbixGlyphDataOffsetFormat, current_glyph)
TypeError: must be str, not bytes

Any idea what’s going wrong?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RoelNcommented, Jan 11, 2018

@anthrotype But certainly! The ChromaCheck fonts (or, all of it in fact) are free to re-use.

Take heed that I’m updating the fonts at this moment, so I’ll be pushing new versions later tonight. For some reason the COLR font doesn’t render in Firefox any more, and I’m adding a glyf table to the CBDT one to make it spec compliant. So you might want to wait for that before you include them in your test suite.

Curious to find out what your favourite bug is! 😄

0reactions
RoelNcommented, Jan 12, 2018

The color fonts in ChromaCheck have been updated and ready for use! Each font has a unicode character in a specific red (e.g. rgb(50, 0, 0)) and I check if that exact red is being drawn to the canvas. I hope you can do something with 'em!

(Please note that the test for CBDT fails, I’ll be looking into why during lunch)

Read more comments on GitHub >

github_iconTop Results From Across the Web

COLRv1 Color Gradient Vector Fonts in Chrome 98
Compact, compression-friendly, color vector fonts with all your favorite gradient flavors. In Chrome 98, the Chrome and Fonts teams have ...
Read more >
COLRv1 and CSS font-palette: Web Typography Gets Colorful
You can use ChromaCheck to see what color font formats your own browser ... All the PNG images in the font file add...
Read more >
font-tech() and font-format() condition extensions to CSS ...
The font-tech() and font-format() are extensions to the @supports rule CSS Conditional Syntax enable declarative and programmatic access to ...
Read more >
OpenType-SVG color fonts - Adobe Support
In browsers that do not support OpenType-SVG fonts, the fallback style (identical to stylistic set 20) will be displayed. When adding OpenType- ...
Read more >
Colorful typography on the web: get ready for multicolor fonts
Testing your browser. Note: I've created a better test to check browser support for color fonts. It's called ChromaCheck. The hacky table down ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found