Pango has a PANGO_SCALE value of 1024, making it really happy when fonts have a
cadratin value of 1024. Unfortunately, AHEM uses 1000, leading to rounding
errors.
We now use weasyprint.otf everywhere, with 1024. It breaks the exact 20/80
ratio between descent and ascent values, so that we need to use approximate
values for tests relying on an exact position of the baseline.
All the tests should pass, or be explicitely marked as failing.
Gradients must be drawn using a pre-multiplied color space. It means that stop
colors are "weighted" by their alpha channel when we define how transition is
done between two colors.
To explain why this is needed, the best example is "transparent". The
"trasparent" color is set to rgba(0, 0, 0, 0), also known as transparent
black. When there’s a transition from red to transparent, we don’t want to have
a transition to black, as it would be if RGBA values were extrapolated. We want
to have a transition to transparent red.
This problem appears for each transition between colors whose RGB and A
channels are both different.
To fix this, we use the same plain color as the one from the previous stop for
transitions to transparent, and the same plain color as the one from the next
stop for transitions from transparent. For semi-transparent colors, we set a
weight proportional to the color alpha, meaning that opaque colors will take
more place than transparent ones.
This bug appears in Safari: https://bugs.webkit.org/show_bug.cgi?id=150940.
It obviously means that we’re better than Apple. Obviously.