1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00
Commit Graph

3910 Commits

Author SHA1 Message Date
Guillaume Ayoub
562318f66c Fix the way tests are launched on GitHub 2020-12-11 00:29:33 +01:00
Guillaume Ayoub
81f73ead2e Use the weasyprint.otf font everywhere
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.
2020-12-11 00:22:33 +01:00
Guillaume Ayoub
3798b220d6 Mark expected failing tests as xfail 2020-12-10 23:05:44 +01:00
Guillaume Ayoub
30c21d92e9 Fully remove Cairo from documentation and code 2020-12-10 22:47:27 +01:00
Guillaume Ayoub
f10b3b56c8 Fix error raised when SVG images are rendered 2020-12-08 15:51:35 +01:00
Guillaume Ayoub
7fe4e74b2e Don’t round glyph positions to PDF points
Fix #1199.
2020-12-08 00:03:50 +01:00
Guillaume Ayoub
cfb9017e84 Remove CairoSVG
Fix #1263.
2020-12-07 12:27:18 +01:00
Guillaume Ayoub
db111e96c4 Add pydyf requirement
Related to #1263.
2020-12-07 12:04:30 +01:00
Guillaume Ayoub
4f82a4a34e Packaging!
Related to #1247, #1232.
2020-12-06 20:19:59 +01:00
Guillaume Ayoub
9dab1c85c9 Merge branch '52.x' 2020-12-06 19:44:08 +01:00
Guillaume Ayoub
b1a86735f1 Update NEWS 2020-12-06 19:43:50 +01:00
Guillaume Ayoub
d6cbf25880 Merge branch '52.x' 2020-12-06 19:40:51 +01:00
Guillaume Ayoub
bf45c2eb9f Merge 52.2 2020-12-06 19:35:24 +01:00
Guillaume Ayoub
5ec1881c51 Version 52.2 2020-12-06 19:14:14 +01:00
Guillaume Ayoub
5c91212624 Really print a lot of things when tests fail 2020-12-06 14:09:22 +01:00
Guillaume Ayoub
b4e0619158 Print a lot of things when tests fail 2020-12-06 13:49:58 +01:00
Guillaume Ayoub
a677b3d3ae Print command result when test fails 2020-12-06 13:27:33 +01:00
Guillaume Ayoub
a2e02086d7 Assert at least one magic number in Ghostscript output 2020-12-06 13:12:13 +01:00
Guillaume Ayoub
b1446dc102 Upgrade cffi on Windows for tests 2020-12-06 12:52:15 +01:00
Guillaume Ayoub
a849f9e88b Try to clean tests 2020-12-06 12:47:20 +01:00
Guillaume Ayoub
b65c3649cb Fix Ghostscript’s stdout for Windows 2020-12-02 01:33:22 +01:00
Guillaume Ayoub
f886a04e36 Install Ghostscript 2020-12-02 01:06:46 +01:00
Guillaume Ayoub
e5542c9539 Use better names for harfbuzz library discovery 2020-12-02 01:05:56 +01:00
Guillaume Ayoub
7c8f7caa63 Remove python from msys 2020-12-02 00:58:22 +01:00
Guillaume Ayoub
eacd4d7c37 Use preinstalled msys 2020-12-02 00:51:28 +01:00
Guillaume Ayoub
0fe7e7f84d Get Python path for tests 2020-12-02 00:30:55 +01:00
Guillaume Ayoub
80e2a48b52 Try another syntax for PATH 2020-12-02 00:07:20 +01:00
Guillaume Ayoub
5d5fcd842f Fix condition for Ubuntu tests 2020-12-01 13:00:57 +01:00
Guillaume Ayoub
2ce686b7ff Install pango instead of gtk+ for Windows tests 2020-12-01 12:59:21 +01:00
Guillaume Ayoub
61422dfdd2 Fix package name for DejaVu fonts 2020-12-01 12:51:09 +01:00
Guillaume Ayoub
578a191f52 Don’t use capture_output, unsupported by Python 3.6 2020-12-01 12:49:19 +01:00
Guillaume Ayoub
2dde098fe5 Set PATH environment variable for Windows 2020-12-01 12:49:10 +01:00
Guillaume Ayoub
3e698e9ff7 Use Ubuntu 20.04 for tests 2020-12-01 12:37:40 +01:00
Guillaume Ayoub
a99fca40e1 Install Ghostscript for macOS tests 2020-12-01 12:37:27 +01:00
Guillaume Ayoub
be46228372 Install pydyf for tests 2020-12-01 12:26:08 +01:00
Guillaume Ayoub
374e41469f Don’t use forbidden set-env command for Windows tests 2020-12-01 12:25:41 +01:00
Guillaume Ayoub
5ed5b54d59 Handle transparent colors in gradients correctly
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.
2020-11-30 20:54:26 +01:00
Guillaume Ayoub
29a90fcf2b Merge branch 'pydyf' of github.com:Kozea/WeasyPrint into pydyf 2020-11-30 19:12:59 +01:00
Guillaume Ayoub
5f5f30d3e8 Support transparent gradients 2020-11-30 19:12:41 +01:00
Lucie Anglade
8f5a5ce6df Delete useless .travis.yml 2020-11-30 18:39:08 +01:00
Lucie Anglade
c72539f7ca Remove print 2020-11-29 20:14:37 +01:00
Guillaume Ayoub
f6456f9c0c Remove useless @requires from one test 2020-11-28 14:14:43 +01:00
Guillaume Ayoub
6b1a7970cb Correctly draw borders on the last line of split tables
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.
2020-11-25 14:19:32 +01:00
Guillaume Ayoub
e453158dd4 Remove useless "results" folder from package
Related to #1248.
2020-11-25 14:16:41 +01:00
Felix Schwarz
e4f4fb6e06 include missing test data (#1247) 2020-11-25 14:16:32 +01:00
Guillaume Ayoub
f0231c8b15 Correctly draw borders on the last line of split tables
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.
2020-11-23 20:46:09 +01:00
Guillaume Ayoub
3e4872443c Remove useless "results" folder from package
Related to #1248.
2020-11-23 19:15:27 +01:00
Guillaume Ayoub
1772b95030
Merge pull request #1248 from FelixSchwarz/add-missing-test-resources
include missing test data (#1247)
2020-11-23 19:14:43 +01:00
Guillaume Ayoub
236d1dd309 Don’t render table cells as if they are on empty pages
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.
2020-11-21 19:24:48 +01:00
Guillaume Ayoub
6606927007 Fix URL handling with tinycss2
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.
2020-11-21 19:24:43 +01:00