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

2265 Commits

Author SHA1 Message Date
Guillaume Ayoub
5aa34d7dbb Merge pull request #410 from natano/overflow-wrap-break-word
Fix AssertionError in layout.inlines.split_text_box().
2017-01-11 13:00:37 +01:00
Martin Natano
4919f3a643 Fix AssertionError in layout.inlines.split_text_box().
Traceback (most recent call last):
  [...]
  File "/app/env/lib/python3.5/site-packages/weasyprint/layout/inlines.py", line 718, in split_text_box
    'Expected nothing or a preserved line break' % (between,))
AssertionError: Got '1,' between two lines. Expected nothing or a preserved line break

The Assertion Error can be triggered with following minimal test case
(Adobe's Source Sans Pro font must be installed):

	<style type="text/css">
	    p {
		font-family: 'Source Sans Pro';
		font-size: 24pt;
		width: 275pt;
		overflow-wrap: break-word;
	    }
	</style>
	<p>W1D1,W1D7,W2D14,W3D21,W4D28</p>

With the Adobe Source Sans Font the pango line wrapping algorithm
sometimes produces sporadic results. The wrapping seems to be dependent
on the following text, so that a short text doesn't "fit" on a line, but
does if it is followed by more text. This can be worked around in the
split_first_line() function by computing the resume offset at a later
point, so it is in sync with the actual wrapping behaviour.

See https://bugzilla.gnome.org/show_bug.cgi?id=777093.
2017-01-11 12:14:03 +01:00
Guillaume Ayoub
f53e8d05ed Version 0.34 2016-12-21 01:11:23 +01:00
Guillaume Ayoub
18b1931374 Clean and test columns
Fix #403.
2016-12-17 00:43:55 +01:00
Guillaume Ayoub
5a07ec0891 Fix the multi-page columns algorithm
Related to #403.
2016-12-16 17:37:39 +01:00
Guillaume Ayoub
cf0efe64cc Cast the number of columns into int
Should fix #403.
2016-12-15 09:02:14 +01:00
Guillaume Ayoub
282b4622f7 Merge branch 'master' of github.com:Kozea/WeasyPrint 2016-12-07 18:29:25 +01:00
Guillaume Ayoub
bf6911d36f Correctly close files open by mkstemp
Python's tempfile.mkstemp already opens files, we don't have to open
them twice. The documentation is not really clear about that but
there's a good post on Logilab's blog: https://www.logilab.org/17873

Fix #396.
2016-12-07 18:25:58 +01:00
Guillaume Ayoub
8f937fdf69 Merge pull request #399 from ikonst/master
Avoid CairoSVG-2.0.0rc* on Python 2
2016-12-06 23:06:23 +01:00
Ilya Konstantantinov
f6daebc60b Avoid CairoSVG-2.0.0rc* on Python 2
It's funny but:
```
pip install --upgrade 'CairoSVG<2'
```
would pull CairoSVG-2.0.0rc6, while
```
pip install --upgrade 'CairoSVG<2.0.0'
```
would pull the 1.x branch (1.0.22 at time of writing).
2016-12-06 10:21:50 -08:00
Guillaume Ayoub
c9a2a0e60d Add a paragraph in docs about presentational hints
Related to #398, thanks to @aih.
2016-12-06 09:56:04 +01:00
Guillaume Ayoub
12c297d7e7 Honor the presentational_hints option for PDFs
Related to #398.
2016-12-06 08:07:58 +01:00
Guillaume Ayoub
2614c48afc Version 0.33 2016-11-28 21:20:38 +01:00
Guillaume Ayoub
a758a5c674 Update documentation for MacOS and Windows
- Python 3 for both Windows and MacOS.
- Homebrew for MacOS, as it's now tested.
2016-11-28 19:32:29 +01:00
Guillaume Ayoub
b7b0225e7e Update .gitignore 2016-11-27 21:46:55 +01:00
Guillaume Ayoub
ca93c62cc7 Don't build universal wheels 2016-11-27 21:46:30 +01:00
Guillaume Ayoub
7ee1a746d8 Don't call add_top_padding when it's not needed 2016-11-25 01:21:26 +01:00
Guillaume Ayoub
92b3dbd00f Fix logic when finishing block formatting context
Related to #388.
2016-11-24 23:53:06 +01:00
Guillaume Ayoub
eb08c46489 Use second line's index instead of first line length 2016-11-22 02:37:04 +01:00
Guillaume Ayoub
8cb093c021 Always update resume_at when splitting lines
As Pango keeps the extra trailing spaces when it splits lines, we try to
add the next word of the second line to the first line without its
trailing spaces and see if it fits. If it doesn't, we have to update
resume_at as we have split the first line at a position that may be
different from what Pango did earlier.

Fix #389.
2016-11-22 01:11:02 +01:00
Guillaume Ayoub
cc7377f56d Remove the broken "downloads/month" badge 2016-11-21 23:02:32 +01:00
Guillaume Ayoub
292dc436d6 Merge pull request #393 from Kozea/osx-travis
Enable @font-face and add tests on MacOS
2016-11-21 20:16:43 +01:00
Guillaume Ayoub
521173b771 Try to render images as SVG first when sniffing 2016-11-21 09:29:55 +01:00
Guillaume Ayoub
68eb428919 Don't catch logs in mimetype sniffing test 2016-11-20 23:52:19 +01:00
Guillaume Ayoub
f89ef7b64a Fix data url in tests 2016-11-20 23:30:45 +01:00
Guillaume Ayoub
167e4513a8 Set a 1x1 size to sniffed SVG in tests 2016-11-20 22:59:48 +01:00
Guillaume Ayoub
7b965a1f69 Add missing comma 2016-11-20 22:45:33 +01:00
Guillaume Ayoub
e14bd345b7 Remove unused import 2016-11-20 22:16:50 +01:00
Guillaume Ayoub
c426e494e8 Try to fix the travis script 2016-11-20 22:14:37 +01:00
Guillaume Ayoub
c272b8b908 Install DejaVu for MacOS tests 2016-11-20 22:11:35 +01:00
Guillaume Ayoub
b3bf68c2d8 Try with Futura 2016-11-20 21:45:47 +01:00
Guillaume Ayoub
71de28c7fe Try another font for MacOS 2016-11-20 21:20:21 +01:00
Guillaume Ayoub
566c0d6ad0 Use different fonts for different OSes for tests 2016-11-20 14:45:37 +01:00
Guillaume Ayoub
706b8b8adf Try other values for the condensed font test 2016-11-20 13:55:47 +01:00
Guillaume Ayoub
c015d8dbc1 Fix again FcFontMatch's signature
Related to #391.
2016-11-20 12:59:02 +01:00
Guillaume Ayoub
44d6d892aa Use the real signature for FcFontMatch
Fix #391.
2016-11-20 02:39:26 +01:00
Guillaume Ayoub
063572c5a6 Set the font used for the condensed font test 2016-11-19 17:44:26 +01:00
Guillaume Ayoub
4eea3bba23 Remove double import 2016-11-19 16:51:40 +01:00
Guillaume Ayoub
180e297e04 Try to fix unicode test on MacOS 2016-11-19 16:48:56 +01:00
Guillaume Ayoub
9977c9dad6 Let's try fontconfig on MacOS 2016-11-19 16:25:30 +01:00
Guillaume Ayoub
f3e44bb541 Install Ahem on MacOS 2016-11-19 16:14:58 +01:00
Guillaume Ayoub
6b4d799a46 Add missing semicolumn 2016-11-19 15:58:55 +01:00
Guillaume Ayoub
d327cdf147 Set the python version in MacOS commands 2016-11-19 15:51:03 +01:00
Guillaume Ayoub
7ab09776eb Don't launch brew with sudo and upgrade pytest 2016-11-19 14:53:38 +01:00
Guillaume Ayoub
12a292e6ec Try to launch tests on MacOS 2016-11-19 14:48:39 +01:00
Guillaume Ayoub
d8af567fc7 Merge pull request #390 from keithcallenberg/master
check for font_config
2016-11-18 01:38:37 +01:00
Keith Callenberg
0463f0d919 check for font_config
check for font_config before attempting to add_font_face
2016-11-17 15:29:39 -05:00
Guillaume Ayoub
be739e82d6 Add and remove empty lines in CHANGES 2016-11-17 17:10:54 +01:00
Guillaume Ayoub
8bdb827e38 Version 0.32 2016-11-17 17:03:43 +01:00
Guillaume Ayoub
6c1e35d6ad Minor changes about StyleDict's documentation 2016-11-17 16:56:27 +01:00