From bdff1ee3259db038c574590ecc33d9023abc4368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bethmont?= Date: Wed, 28 Sep 2016 10:30:54 +0700 Subject: [PATCH 1/5] Fixed a typo. --- weasyprint/navigator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weasyprint/navigator.py b/weasyprint/navigator.py index 66c1d85f..b0f4ea84 100644 --- a/weasyprint/navigator.py +++ b/weasyprint/navigator.py @@ -136,7 +136,7 @@ def app(environ, start_response): return make_response( body, content_type='application/pdf', headers=[('Content-Disposition', - 'attachement; filename=%s.pdf' % filename)]) + 'attachment; filename=%s.pdf' % filename)]) elif path.startswith('/view/'): url = normalize_url(path[6:], environ.get('QUERY_STRING')) From f77f883dc6e809414cc71d3fd1dee41e6887dd41 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 7 Oct 2016 15:57:56 +0200 Subject: [PATCH 2/5] Check that white-space is used for shrink-to-fit Fix #368 --- weasyprint/tests/test_tables.py | 15 +++++++++++++++ weasyprint/text.py | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/weasyprint/tests/test_tables.py b/weasyprint/tests/test_tables.py index f83560f7..c5aaf4d8 100644 --- a/weasyprint/tests/test_tables.py +++ b/weasyprint/tests/test_tables.py @@ -1061,6 +1061,21 @@ def test_auto_layout_table(): ''') + # Test regression: https://github.com/Kozea/WeasyPrint/issues/368 + # Check that white-space is used for the shrink-to-fit algorithm + page, = parse(''' + + +
a a
+ ''') + html, = page.children + body, = html.children + div, = body.children + table_wrapper, = div.children + table, = table_wrapper.children + assert table.width == 16 * 3 + # Cell width as percentage in auto-width table page, = parse('''
diff --git a/weasyprint/text.py b/weasyprint/text.py index a7a9c489..cae157ed 100644 --- a/weasyprint/text.py +++ b/weasyprint/text.py @@ -802,6 +802,10 @@ def create_layout(text, style, hinting, max_width): or ``None`` for unlimited width. """ + text_wrap = style.white_space in ('pre', 'nowrap') + if text_wrap: + max_width = None + layout = Layout(hinting, style.font_size, style) layout.set_text(text) From 88f961c60875fa6e84022233e9e4bc42c6d4f305 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 21 Oct 2016 12:47:05 +0200 Subject: [PATCH 3/5] Add the lxml installation in doc for Windows Fix #370. --- docs/install.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/install.rst b/docs/install.rst index 51bb3356..60745dea 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -184,5 +184,11 @@ Windows - reboot, - install `Visual C++ compiler for Python 2.7 `_, +- download `lxml `_: + + - "lxml-x.x.x-cp27-cp27m-win32.whl" on Windows 32 bit, + - "lxml-x.x.x-cp27-cp27m-win_amd64.whl" on Windows 64 bit, + +- install lxml with ``python -m pip install path/to/lxml-xxx.whl`` - install WeasyPrint with ``python -m pip install weasyprint``, - test with ``python -m weasyprint http://weasyprint.org weasyprint.pdf``. From 653aca0613e4b038d5e6c7c0a24241225e5209eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn?= Date: Tue, 25 Oct 2016 12:51:27 +0200 Subject: [PATCH 4/5] Require libffi headers at Fedora --- docs/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index 60745dea..62de9dd4 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -124,7 +124,7 @@ with pip after installing the following packages: .. code-block:: sh - sudo yum install redhat-rpm-config python-devel python-pip python-lxml python-cffi cairo pango gdk-pixbuf2 + sudo yum install redhat-rpm-config python-devel python-pip python-lxml python-cffi libffi-devel cairo pango gdk-pixbuf2 Archlinux ~~~~~~~~~ From e7aa1c292a4cc07ce7fffb00c666a311ae8ddffc Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 25 Oct 2016 18:12:37 +0200 Subject: [PATCH 5/5] Remove GTK+ link in doc and probably fix lxml's --- docs/install.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index 60745dea..bb619c4f 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -22,7 +22,6 @@ WeasyPrint |version| depends on: .. _CFFI: https://cffi.readthedocs.org/ .. _html5lib: http://html5lib.readthedocs.org/ .. _cairocffi: http://pythonhosted.org/cairocffi/ -.. _GTK+: http://www.gtk.org/ .. _lxml: http://lxml.de/ .. _tinycss: http://packages.python.org/tinycss/ .. _cssselect: http://packages.python.org/cssselect/