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

1728 Commits

Author SHA1 Message Date
Guillaume Ayoub
c34b1285ba Localize floats used by Cairo tags
According to the documentation (and to the code), Cairo seems to rely on
locale-dependent strings for tag attributes. It's for sure a bad idea, but at
least try to follow this rule and see if it fixes our problems.

Related to #742.
2018-11-22 14:07:40 +01:00
Guillaume Ayoub
2e600dc666 Deactivate Pango layout again as soon as possible 2018-11-21 22:29:04 +01:00
Guillaume Ayoub
4e6d449c5c Don't store Pango layout between page layout and drawing steps
Creating Pango layouts during page layout and recreating them when drawing
pages is a little bit slower but frees A LOT of memory.
2018-11-21 22:16:52 +01:00
Guillaume Ayoub
3cbb2e6143 Don't set hinting twice when drawing lines 2018-11-20 00:55:34 +01:00
Guillaume Ayoub
763fe7318e Use ffi's garbage collector helper for line iter 2018-11-20 00:55:00 +01:00
Guillaume Ayoub
12de567d1c Don't create an iter to get baseline value 2018-11-17 01:37:22 +01:00
Guillaume Ayoub
0a3db7d984 Replace iter_lines by get_first_line
get_first_line only gets the first line and returns the start index of the
second line.
2018-11-17 00:42:16 +01:00
Guillaume Ayoub
32d2359adc Make iter_lines return the first two lines
There's no need to get more.
2018-11-17 00:19:01 +01:00
Guillaume Ayoub
5f0723a727 Only keep two lines when creating text layouts
Layouts are used to render only one line and know if there's a second one. We
can thus ignore the text after the two first lines.
2018-11-16 23:47:32 +01:00
Guillaume Ayoub
0f25c53287 Version 43 2018-11-09 09:19:21 +01:00
Guillaume Ayoub
8acb51da6e Add tools/__init__.py to include tools in packaging
Fix #729.
2018-11-08 14:04:09 +01:00
Guillaume Ayoub
3ca9941568 Make empty strings clear previous values of named strings
Fix #726.
2018-11-02 17:47:21 +01:00
Guillaume Ayoub
9c39fcb14d Version 43rc2 2018-11-02 16:09:12 +01:00
Guillaume Ayoub
36ef44c4ca Warn users when string() is not used in a page margin
Related to #723.
2018-11-02 15:23:46 +01:00
Guillaume Ayoub
f5dae8a3ee Copy bookmarks and string sets when creating replaced boxes
Fix #722.
2018-11-02 14:32:14 +01:00
Guillaume Ayoub
d2169a75f5 Add tests about flexbox
Related to #601.
2018-10-31 16:56:52 +01:00
Guillaume Ayoub
3d2c75fa51 Don't recalculate max content widths when distributing extra space
Fix #691.
2018-10-29 16:58:54 +01:00
Guillaume Ayoub
495af10e1f Display details tags as blocks
Fix #717.
2018-10-29 12:27:05 +01:00
Guillaume Ayoub
07d3da6533 Optimize minimum size calculation of long inline elements
Fix #720.
2018-10-29 11:32:10 +01:00
Guillaume Ayoub
40f4e9af4c Remove query strings from file:// URIs
Fix #687, fix #688.
2018-10-26 19:18:33 +02:00
Guillaume Ayoub
186c6550ed Use filesystem encoding defined in url module for fonts 2018-10-26 19:09:43 +02:00
Guillaume Ayoub
56ec1cb9c2 Use pathlib to generate URI from filename
Also, always use the system's file encoding, as it's utf-8 on macOS and should
be OK on Unix for recent versions of Windows.

Related to #687.
2018-10-26 18:58:21 +02:00
Guillaume Ayoub
b0944e718a Fix text-indent at the beginning of the page
Fix #706.
2018-10-26 18:49:40 +02:00
Guillaume Ayoub
6b24c25d5a Parametrize text-indent test 2018-10-26 18:49:19 +02:00
Guillaume Ayoub
b4500bf25e Fix more escape sequences 2018-10-26 15:32:34 +02:00
Guillaume Ayoub
8fb843556d Fix escape sequences 2018-10-26 15:18:49 +02:00
Guillaume Ayoub
cdb5af097f Fix exception in fetch 2018-10-26 15:00:25 +02:00
Guillaume Ayoub
43800519e7 Take care of original skip_stack in flex layout's resume_at 2018-10-16 11:23:49 +02:00
Guillaume Ayoub
8561930368 Use real children indexes in flex layout's resume_at 2018-10-16 11:13:59 +02:00
Guillaume Ayoub
4a3f78e805 Version 43rc1 2018-10-15 18:40:10 +02:00
Guillaume Ayoub
8b7f529064 Add missing spaces 2018-10-11 13:03:47 +02:00
Guillaume Ayoub
ad3be35620 Ignore absolute blocks when defining page_is_empty 2018-10-10 16:45:49 +02:00
Guillaume Ayoub
f19e030760 Ignore non-flex children when setting height in flex column layout 2018-10-10 13:09:57 +02:00
Guillaume Ayoub
0a0e57fbf7 Fix floating boxes with counters 2018-09-29 09:17:27 +02:00
Guillaume Ayoub
dfab8a8225 Use named destinations instead of pages and position for links
There's a limitation / bug in cairo: we can't add links to pages that have not
been created yet. We have to use named destinations instead as they work even
if the destination has not been created.

This change offers the advantage of advertising targets: generated PDF files
now embed the list of named targets (even if I don't know if PDF readers have a
UI for that feature).

Fix #678.
2018-09-24 15:27:24 +02:00
Guillaume Ayoub
56904baa79 Use the same copyright line everywhere 2018-09-20 18:46:27 +02:00
Guillaume Ayoub
d1d9641449 Add some tests for flex
Related to #601.
2018-09-20 18:46:10 +02:00
Guillaume Ayoub
419d14e415 Handle middle and center values of align presentational hint
Fix #694.
2018-09-20 15:29:27 +02:00
Guillaume Ayoub
6fdf578c6e Fix yet another auto table layout
True story: you can read and implement a quite complicated algorithm, use it
for years, and then get an issue related to this algorithm. You can fix the
code, carefully following the algorithm, but still get a bad rendering. Why?
Because the algorithm is wrong. Of course, as it's written by David Baron, it
can't be that wrong: there's actually a red ISSUE block telling that "The way
this describes distribution of widths from column-spanning cells is wrong" and
that I "should refer to the rules for distributing excess width to columns for
intrinsic width calculation".

I did. Guess what: it works.

Fix #685.
2018-09-19 16:23:19 +02:00
Guillaume Ayoub
6bb86d214d Follow what's in the spec about tables (and break some tests) 2018-09-18 15:32:42 +02:00
Guillaume Ayoub
f9659ab86a Lint 2018-09-18 10:54:16 +02:00
Guillaume Ayoub
49b899e05d Add tests for tables
Related to #685.
2018-09-18 10:43:45 +02:00
Guillaume Ayoub
1ad21601eb Don't include gap for colspan cells in collapsed tables
Related to #685.
2018-09-18 10:15:33 +02:00
Guillaume Ayoub
558165b974 Fix comment 2018-09-18 10:15:28 +02:00
Guillaume Ayoub
ed6e594f87 Merge branch 'master' of github.com:Kozea/WeasyPrint 2018-09-17 18:48:52 +02:00
Guillaume Ayoub
ff72a7972e Fix comment 2018-09-17 18:48:35 +02:00
Guillaume Ayoub
52fdf0acf8 Split columns layout 2018-09-17 18:48:24 +02:00
Tontyna
8624113e13 Improve fontconfig check
Emit warnings about font-less fontconfig on any OS.

Stick to native rendering on Windows and macOS if fontconfig has
neither fonts nor a config file.
2018-09-01 11:20:38 +02:00
Guillaume Ayoub
01b09c6136 Fix crashes in flex layout 2018-08-30 18:57:04 +02:00
Tontyna
66e5a3fc22 Prevent RuntimeError 2018-08-29 21:05:44 +02:00