1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00
Commit Graph

2665 Commits

Author SHA1 Message Date
Lucie Anglade
9bcece11fe Fix blend mode 2021-07-30 15:12:06 +02:00
Guillaume Ayoub
08583d39bb Handle font collections
Fix #1393.
2021-07-29 20:50:50 +02:00
Guillaume Ayoub
5a53e11608 Clean and fix some cases of SVG gradients 2021-07-25 18:30:32 +02:00
Guillaume Ayoub
6417023f3d Fix translation when viewBox’s origin is not 0,0
Related to #1400.
2021-07-23 23:59:14 +02:00
Guillaume Ayoub
e30907c869 Simplify when begin/end text tags are inserted
The previous behaviour was introduced by 603ee26 as an optimization.
Unfortunately, it was not correct because text decoration can’t be drawn inside
the begin/end text tags. Generated PDF files were incorrect, leading to buggy
rendering by Ghostscript.

Related to #1400.
2021-07-23 23:36:54 +02:00
Guillaume Ayoub
a5b9db5160
Merge pull request #1401 from pbregener/issue-1399
More robust handling of SVG use tags
2021-07-23 22:38:26 +02:00
Guillaume Ayoub
a0ad94b143 Don’t stroke when stroke-width is 0
Related to #1403.
2021-07-23 22:36:05 +02:00
Guillaume Ayoub
8d7bcead0a Fix how x and y attributes are handled
Fix #1403.
2021-07-23 22:17:37 +02:00
pbregener
96daadf742
More robust handling of SVG use tags
Fixes #1399
2021-07-20 18:10:04 +02:00
Guillaume Ayoub
56910a84e7 Take care of ratio when calculating min/max widths of replaced boxes 2021-07-19 19:49:20 +02:00
Guillaume Ayoub
071218ef12 Revert "Don’t crash with Pango 1.42"
This reverts commit 51b90ecf26.
2021-07-18 23:17:01 +02:00
Guillaume Ayoub
51b90ecf26 Don’t crash with Pango 1.42
Debian stable (Buster, 10) includes Pango 1.42. Until the next version of
Debian (Bullseye, 11) is released, keep a workaround to avoid crashes.

This workaround is not documented on purpose, support of Pango 1.42 will not be
improved. Also note that WeasyPrint with Pango 1.42 will suffer from #1199.

Fix #1384.
2021-07-18 14:08:42 +02:00
Guillaume Ayoub
5fba476370 Test and fix text-anchor 2021-07-18 10:09:03 +02:00
Guillaume Ayoub
23b99475c2 Use "in" when possible 2021-07-18 10:08:50 +02:00
Guillaume Ayoub
c7b97fa3bf Handle simple cases of clip-path
Fix #1374.
2021-07-18 09:36:14 +02:00
Guillaume Ayoub
aee609da43 Use stream variable name instead of old context 2021-07-17 14:29:28 +02:00
Guillaume Ayoub
add1dad80b Use named parameters for stream transformation 2021-07-17 14:25:58 +02:00
Guillaume Ayoub
a4cc61c7b8 Use matrix.values instead of indices 2021-07-17 13:46:46 +02:00
Guillaume Ayoub
d8526d4b41 Fix and test resized SVG files
The SVG sample is 10 years old, and viewbox was lowercase. That’s viewBox, not
viewbox. Our new renderer is case-sensitive for attributes.
2021-07-17 00:53:39 +02:00
Guillaume Ayoub
e6be0fc47f Fix text children 2021-07-16 15:17:15 +02:00
Guillaume Ayoub
5fe7ef6b22 Ignore missing glyphs when subsetting fonts
Instead of raising an error, just ignore missing fonts. Also include the notdef
glyph to (hopefully) avoid invalid documents.

Related to #1386.
2021-07-13 20:16:20 +02:00
Guillaume Ayoub
8b8011ac78 Catch font subsetting errors
Fix #1386.
2021-07-13 20:04:56 +02:00
Guillaume Ayoub
1111f7d57e Handle stacking contexts put in contexts by previous generations
Fix #880 and fix #1396.
2021-07-13 16:33:42 +02:00
Guillaume Ayoub
ea44564983 Typo in comment 2021-07-13 00:20:10 +02:00
Guillaume Ayoub
cbd617516f Use cache index instead of Python id() for PDF image name
Cache index is reproducible between renderings, generating equivalent (and
testable) PDF files.
2021-07-12 22:50:05 +02:00
Guillaume Ayoub
04985cb5ab Use image id instead of increasing index for image keys
Pillow images are stored in a cache, to be sure that we use the same image when
we have the same URL (and don’t try to retrieve it twice).

Using the image id as a key prevents WeasyPrint to store the image twice in the
PDF, with a large gain of time and size.

Related to #1392.
2021-07-12 21:40:33 +02:00
Guillaume Ayoub
fa07d36fb0 Don’t force num_resolutions to 1 to make images smaller
Related to #1392.
2021-07-12 21:39:55 +02:00
Guillaume Ayoub
5ae4afd35c Use stream variable name instead of old-fashioned context 2021-07-12 16:57:48 +02:00
Guillaume Ayoub
cef8cf109d Fix and simplify image size management 2021-07-12 15:07:31 +02:00
Guillaume Ayoub
231736d73e Use the original SVG tree when drawing patterns
In Pattern, we want self.tree to be the pattern tree when we call draw(), but
we want self.tree to be the original SVG tree for everything else, like finding
defs.

This commit replaces self.tree with the original SVG tree after we call draw().

Fix #1394.
2021-07-12 11:42:07 +02:00
Guillaume Ayoub
08f3a59d4f Strip quotes from font names in SVG
Fix #1393.
2021-07-12 10:54:11 +02:00
Guillaume Ayoub
010f40adeb Fix padding for columns 2021-07-11 17:40:02 +02:00
Guillaume Ayoub
23dbd70c1f Fix crash with borders whose widths are in em
Fix #1378.
2021-06-13 08:07:46 +02:00
Guillaume Ayoub
c0c9879bc5 Handle stroke-opacity and fill-opacity
This commit also cleans a lot of things about the way opacity is handled,
with many small bug fixes.

Fix #1371.
2021-06-02 20:35:06 +02:00
Guillaume Ayoub
41d4a262d3 Don’t copy the already-cascaded style when copying nodes
Fix #1370.
2021-06-01 22:30:54 +02:00
Guillaume Ayoub
edf47f5311 Copy nodes when drawing them as use tags
Fix #1370.
2021-06-01 22:11:11 +02:00
Guillaume Ayoub
6dde6cb5e9 Fix SVG transform order
Fix #1369.
2021-05-31 22:37:18 +02:00
Guillaume Ayoub
b24198df47 Version 53.0b2 2021-05-30 19:29:00 +02:00
Guillaume Ayoub
451258a3ec Don’t include stroke width in g bounding boxes 2021-05-30 19:09:04 +02:00
Guillaume Ayoub
75e6d79c37 Linting 2021-05-30 18:56:41 +02:00
Guillaume Ayoub
ba41e7610a
Merge pull request #1358 from aschmitz/1352-multipage
Sort anchors across pages
2021-05-30 18:53:16 +02:00
Guillaume Ayoub
0f8deb86a7 Include stroke width in bounding box
Fix #1367.
2021-05-30 09:50:40 +02:00
Guillaume Ayoub
f17acdcd02 Rename SVG.paint 2021-05-30 09:50:30 +02:00
Guillaume Ayoub
bb8eea9066 Fix style attributes in SVG
Fix #1366.
2021-05-27 16:36:34 +02:00
Guillaume Ayoub
41ab0f86e7 Cascade inherited attributes for use tags
Fix #1365.
2021-05-27 12:04:41 +02:00
Guillaume Ayoub
a3028945fc Handle visibility and display attributes
Fix #1362.
2021-05-25 15:01:07 +02:00
aschmitz
ff94e03ac5 fix: remove debugging line 2021-05-19 11:53:09 -05:00
aschmitz
33348b4880 Sort anchors across pages
Previously we had sorted anchors within one page, but if anchors happened to be
out of order *across* pages, they wouldn't be written in order, which caused
lingering issues in some viewers.

Related to #1352 and the change in d4561b13af.
2021-05-19 00:37:49 -05:00
Guillaume Ayoub
500545956a Fix font type of embedded fonts
Fix #1357.
2021-05-18 21:16:50 +02:00
Guillaume Ayoub
fd2901c570 Add docstrings to style classes 2021-05-12 18:28:15 +02:00