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
Guillaume Ayoub
d4561b13af
Sort anchors
...
Name trees, used to store PDF destinations (HTML anchors) have to be sorted
according to section 7.9.6 of the PDF 1.7 specification.
Fix #1352 .
2021-05-12 18:24:04 +02:00
Guillaume Ayoub
815c01f735
Add a warning when a font size can’t be optimized
2021-05-10 12:05:08 +02:00
Guillaume Ayoub
8acedd3e1b
Don’t duplicate embedded fonts when they have the same face
2021-05-09 20:42:53 +02:00
Guillaume Ayoub
9d7bf5ccd7
Remove useless variable
2021-05-09 19:56:13 +02:00
Guillaume Ayoub
f32cc56e25
Minor performance tweaks
2021-05-09 19:44:56 +02:00
Guillaume Ayoub
6d91c7ad29
Use __missing__ instead of __getitem__ for style
2021-05-08 09:03:45 +02:00
Guillaume Ayoub
2976292f5c
Make Style inherit from dict
2021-05-08 00:48:58 +02:00
Guillaume Ayoub
86796ed044
Use style class instead of computer dictionary
2021-05-07 22:39:57 +02:00
Guillaume Ayoub
b17b08dae7
Don’t crash with ex units in spacing properties
2021-05-07 16:38:51 +02:00
Guillaume Ayoub
bec7c37dc9
Minor cleanups for lazy style
2021-05-07 15:48:44 +02:00
Guillaume Ayoub
8504cfd65c
Calculate CSS properties on demand
...
Instead of calculating all the CSS properties for each element, we only get
them on demand. It saves A LOT of time and memory.
This implementation is just a quick and dirty hack that make tests pass. Even
with this suboptimal code, we get really good results.
Work in progress, has to be improved and cleaned.
2021-05-06 19:32:17 +02:00