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

3682 Commits

Author SHA1 Message Date
Guillaume Ayoub
bea6cef5a6 Fix the terribly wrong line width given by Pango
Pango layouts can generate lines whose logical widths are wider than the layout
maximum width, even if the lines can be broken earlier. This "problem" is
caused by Pango returning rounded Harfbuzz values for line extents, while using
real Harfbuzz values internally to split lines.

In Pango < 1.44, the width value was OK.

We could open an issue on Pango to ask if there’s a way to get reliable
information about line widths.

Or we could just shoot Pango and only use Harfbuzz, as other browsers do.

We can do that as soon as we’ve removed Cairo.

I’m not joking. I never am.

Fix #1051.
2020-05-23 17:27:14 +02:00
Guillaume Ayoub
cf7ea6f4de Merge remote-tracking branch 'origin/master' into pydyf 2020-05-23 09:41:49 +02:00
Guillaume Ayoub
f6f9f144c2 Handle most cases for boxes avoiding flots in rtl containers
Fix #1110.
2020-05-22 17:09:17 +02:00
Guillaume Ayoub
ca9f962dcd Remove useless TODO 2020-05-22 02:28:51 +02:00
Guillaume Ayoub
ebe958e2cc Prefer while True to while 1 2020-05-22 00:14:15 +02:00
Guillaume Ayoub
6ccb269945 Merge branch 'master' of github.com:Kozea/WeasyPrint 2020-05-21 18:21:25 +02:00
Guillaume Ayoub
9746b2dc76 Improve rtl text test 2020-05-21 18:20:53 +02:00
Guillaume Ayoub
faf19cbcde
Merge pull request #1106 from kalekseev/fix-dlopen
dlopen shared library symlink using major version name.
2020-05-21 14:55:03 +02:00
Tontyna
2867f21230 create a TargetLookupItem for each anchor 2020-05-20 02:33:10 +02:00
Guillaume Ayoub
35f27b0afa Use subprocess.run
It’s just more simple than Popen.
2020-05-18 23:53:19 +02:00
Guillaume Ayoub
04449a0fa1 Fix comment in PNG generation function
Using GhostScript as a library seems to be awful. Let’s forget this idea.
2020-05-18 22:45:35 +02:00
Guillaume Ayoub
9f11b7bf4a Merge branch 'master' of github.com:Kozea/WeasyPrint 2020-05-18 21:44:29 +02:00
Guillaume Ayoub
d06f081af6 Fix x position of RTL characters with trailing space
When a line has an unwanted trailing space, the space is removed and the
textbox’ width (and its ancestor’s) is recalculated.

If the line characters have a main RTL Unicode direction (not the CSS box
direction, the text direction), the trailing space is at the left of the
box. Recalculating the width is not enough, we also need to fix the x position.

Testing would be better with Arabic characters, but none is included in
Ahem. Forcing the text direction works well too.

Fix #1111.
2020-05-18 21:36:41 +02:00
Guillaume Ayoub
32f0f22ac2 Clean return condition in document.py 2020-05-18 11:54:37 +02:00
Guillaume Ayoub
e019278d9f Don’t make write_png return size 2020-05-18 01:36:48 +02:00
Guillaume Ayoub
58599d325e Don’t crash when trying to display images 2020-05-18 01:29:59 +02:00
Guillaume Ayoub
c422c1b77e Disable antialiasing by default 2020-05-18 01:29:37 +02:00
Guillaume Ayoub
0ecb246501 Use less code to compare PNG files in tests 2020-05-18 00:49:21 +02:00
Guillaume Ayoub
57fd7f3f0c Don’t return useless document in html_to_pixels 2020-05-17 23:54:25 +02:00
Guillaume Ayoub
e2700082fc Don’t write GhostScript renderings on disk 2020-05-17 23:48:41 +02:00
Guillaume Ayoub
15035f8c97 Mark some tests are failing
These tests were failing with Cairo too, but the rendering was OK because Cairo
was lucky
2020-05-17 23:37:35 +02:00
Guillaume Ayoub
7686fbd4ae Always end path when clipping 2020-05-17 23:11:19 +02:00
Guillaume Ayoub
fee0f91c56 Save layout max width to avoid calling unavailable clip_extents 2020-05-17 22:48:38 +02:00
Guillaume Ayoub
23dccecc3a Set some optional arguments as needed as they are always given 2020-05-17 22:47:52 +02:00
Guillaume Ayoub
38dae61b23 Fix box drawing tests 2020-05-17 20:11:22 +02:00
Guillaume Ayoub
c85d58a86e Linting 2020-05-17 20:01:49 +02:00
Guillaume Ayoub
b8749863d1 Fix all PDF tests not relying on images 2020-05-17 18:59:31 +02:00
Guillaume Ayoub
d1dcea7b1c Fix anchors 2020-05-17 17:12:23 +02:00
Guillaume Ayoub
7e9f80e7a2 Add comment for outlines 2020-05-17 17:12:16 +02:00
Guillaume Ayoub
f7ce6a6db0 Don’t use references for states and xobjects dicts 2020-05-17 17:04:45 +02:00
Guillaume Ayoub
e1e3974d00 Fix typo 2020-05-17 16:59:58 +02:00
Guillaume Ayoub
522b240474 Don’t set links on lineboxes 2020-05-17 15:54:02 +02:00
Guillaume Ayoub
b0da0290ba Disable antialiasing for tests 2020-05-17 15:06:45 +02:00
Guillaume Ayoub
e711363490 Add an option to enable antialiasing for PNG generation 2020-05-17 15:06:17 +02:00
Guillaume Ayoub
3de277ce0e Handle opacity 2020-05-17 14:46:41 +02:00
Guillaume Ayoub
78594746d5
Merge pull request #1116 from balazsdukai/master
Add missing validation package to setup.cfg
2020-05-16 21:22:05 +02:00
Guillaume Ayoub
bf3c7324cb Fix many tests 2020-05-16 17:06:30 +02:00
Guillaume Ayoub
8d2ea802f0 Add various dictionaries only when needed 2020-05-16 17:05:48 +02:00
Guillaume Ayoub
07ac9e855f Fix attachments name discovery 2020-05-16 17:05:11 +02:00
Balázs Dukai
1aa1e1e95d Add missing validation package to setup.cfg 2020-05-16 16:44:54 +02:00
Guillaume Ayoub
5f2107fde8 Remove embedded files dictionary when empty 2020-05-16 16:25:06 +02:00
Guillaume Ayoub
9e486a345a Fix outlines 2020-05-16 16:19:28 +02:00
Guillaume Ayoub
0c9312167e Don’t remove seconds when timezone is set 2020-05-16 15:23:20 +02:00
Guillaume Ayoub
b2797dafe1 Fix lint 2020-05-16 14:27:03 +02:00
Guillaume Ayoub
ae2f6ed3b8 Remove @requires decorator 2020-05-16 00:25:11 +02:00
Guillaume Ayoub
feb25b479d Remove pango_cairo_* definitions 2020-05-16 00:20:31 +02:00
Guillaume Ayoub
efd231ea15 Remove useless cairo import 2020-05-16 00:19:41 +02:00
Guillaume Ayoub
70e195f464 Use transform instead of scale and translate 2020-05-16 00:19:25 +02:00
Guillaume Ayoub
47b8f80695 Don’t use Cairo for tests 2020-05-16 00:04:18 +02:00
Guillaume Ayoub
1383592243 Fix multi-page PNG generation 2020-05-16 00:04:09 +02:00