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

2283 Commits

Author SHA1 Message Date
Guillaume Ayoub
210b73820d Log to stderr only with CLI
Fix #412.
2017-03-24 23:12:04 +01:00
Guillaume Ayoub
b965562798 Change the documentation about first-letter 2017-02-25 22:50:51 +01:00
Guillaume Ayoub
e1d7d090e9 Version 0.36 2017-02-25 22:11:03 +01:00
Guillaume Ayoub
9c5a71d40d Merge branch 'master' of github.com:Kozea/WeasyPrint 2017-02-25 22:07:14 +01:00
Guillaume Ayoub
2fe75815d1 Version 0.35 2017-02-25 22:03:46 +01:00
Guillaume Ayoub
d6ab8ff542 Merge pull request #407 from Kozea/first
Handle ::first-letter
2017-02-16 15:46:41 +01:00
Guillaume Ayoub
11bf0c72ef Merge pull request #423 from andreas-p/master
Warn broken cairo version
2017-02-07 10:45:23 +01:00
Andreas Pflug
25fdc0e949 Warn broken cairo version 2017-02-06 16:57:54 +01:00
Guillaume Ayoub
1688667cb0 Merge pull request #411 from kylegibson/patch-1
Fixed typos in __main__.py
2017-01-16 13:26:58 +01:00
Kyle Gibson
8983d96acd Fixed typos 2017-01-15 19:55:12 -05:00
Guillaume Ayoub
b2282dd6f8 Try to use WRAP_CHAR instead of WRAP_WORD_CHAR
And add some comments to explain why it doesn't work. Related to #410.
2017-01-11 13:45:24 +01:00
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
1031371c7b Ignore boxes with no first-letter style 2017-01-02 13:44:03 +01:00
Guillaume Ayoub
5c9a07bf1a Create first-letter box after white space handling
As ::first-letter depends on white space handling, we must create the
box after collapsing spaces, not during the build of the box tree.

This commit makes WeasyPrint pass most of the W3C tests related to
first-letter (and never crash). Known problems left include:

- list markers are considered as the first letter,
- lines may break between the first letter and the rest of the text
  (see #163 and #301),
- the CSS attributes are all kept, some should probably be removed (the
  spec doesn't give a whole list).

Even if W3C tests makes me quite confident (some of them are crazy),
tests must be added in WeasyPrint too.
2017-01-02 13:23:42 +01:00
Guillaume Ayoub
e222779f0a Merge branch 'master' into first 2017-01-02 12:14:49 +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
b9699688f6 Don't pass skip_stack to insert_first_letter 2016-12-04 16:55:29 +01:00
Guillaume Ayoub
4e8379cb90 Always use two colons for pseudo-elements
Tests now mix one and two colons in CSS, but the user agent stylesheet
and internal representation of the pseudo-elements now awlays use two
colons.
2016-12-04 16:43:49 +01:00
Guillaume Ayoub
5fa966bb42 Carefully check first-letter's char category
Use only the punctuation categories listed in the spec.
2016-12-04 16:33:03 +01:00
Guillaume Ayoub
c2cc15fd6a Initial support of ::first-letter
The pseudo-element is currently added at the end of the build, but it
should be done during the layout as the whitespaces at the beginning of
the tags may be skipped.
2016-12-04 16:12:22 +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