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.
The previous logic used to find if a row is in the footer was broken. Code is
now cleaner, shorter, with an example in comments and a non-regression test.
Fix#1250.
The previous logic used to find if a row is in the footer was broken. Code is
now cleaner, shorter, with an example in comments and a non-regression test.
Fix#1250.
The page_is_empty was probably set to True to force rendering, but using
max_position=inf should already allow all cells to be rendered.
When cells are rendered with page_is_empty set to True, the top margin of their
first children is removed, because margins are always removed at the top of
blocks split between multiple pages.
Fix#1254.
URLs used to be dedicated tokens in the CSS specification, but it’s now a
common function unless its value isn’t quoted.
tinycss2 1.1.0 includes this change, and WeasyPrint has to take care of these
two different tokens.