justvanrossum / fontgoggles

FontGoggles: Visual OTL Preview and QA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some glyphs fails to render in COLRv1 variable font which renders fine in Chrome

yarmola opened this issue · comments

A sample VF built with FontLab using latest varLib and Nabla sources fails to render certain glyphs in the latest FG.
Same font renders fine in Chrome.

Font is attached ("A" is modified as a marker).

It is possible that font has its own issues (we continue testing it), but I think it may actually be an issue in FG rendering, as COLRv1 is relatively new tech.

Nabla-VF.ttf.zip

FG (with the original Nabla and modified/problematic version):

Screenshot 2022-09-18 at 18 22 32

Same modified font in Chrome:

Screenshot 2022-09-18 at 18 21 56

Thanks for reporting! It's a good old ZeroDivisionError :)

https://github.com/BlackFoundryCom/black-renderer/blob/main/Lib/blackrenderer/font.py#L459-L469

I'lve opened an issue in blackrenderer: BlackFoundryCom/black-renderer#113

(Most likely because the points of a linear gradient are simply overlapping.)

Btw. the fonttools subsetter stumbles over the the CPAL table, which is format 1. Not sure if the font is faulty or fonttools buggy.

the fonttools subsetter stumbles over the the CPAL table

Will check that, thanks! That happens with the original or modified font?

Will check that, thanks! That happens with the original or modified font?

The modified font, the original has a format 0 CPAL table.

Some investigation:

I checked how B (gid 13) is built and found that the original font has one of the gradients made like this:

Screenshot 2022-09-18 at 21 01 15

If I read COLRv1 spec correctly, that makes zero-length gradient line, which is technically wrong:

If either point p₁ or p₂ is the same as point p₀, the gradient is ill-formed and must not be rendered.

I think that we have 1) problem in the source Nabla font 2) same problem but packed differently in the converted font 3) issue in the renderer which should be more tolerant to such cases.

I've fixed the ZeroDivisionError in the meantime (BlackFoundryCom/black-renderer#114), but I need to investigate the zero-length gradient (justvanrossum/nabla#41).

That's the first gradient "shape" in B, easy to spot.

This should be fixed in FontGoggle 1.7.0: https://github.com/justvanrossum/fontgoggles/releases