1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00

Warn users with cairo < 1.15.4

Related to #339, #565, #616.
This commit is contained in:
Guillaume Ayoub 2018-04-13 10:44:19 +02:00
parent f4b3371b9e
commit f6bd84e4ab
3 changed files with 17 additions and 10 deletions

View File

@ -4,7 +4,7 @@ Installing
WeasyPrint |version| depends on:
* CPython_ ≥ 3.4
* cairo_ ≥ 1.15.0 [#]_
* cairo_ ≥ 1.15.4 [#]_
* Pango_ ≥ 1.29.3
* CFFI_ ≥ 0.6
* html5lib_ ≥ 0.999999999
@ -75,11 +75,13 @@ If everything goes well, youre ready to :doc:`start using </tutorial>`
WeasyPrint! Otherwise, please copy the full error message and
`report the problem <http://weasyprint.org/community/>`_.
.. [#] cairo ≥ 1.15 is best but older versions may work too. The test suite
passes on cairo 1.12 and 1.14, and passes with some tests marked as
“expected failures” on 1.8 and 1.10 due to behavior changes or bugs in
cairo. With cairo 1.14, WeasyPrint sometimes creates PDF files that may
not be correctly interpreted by GhostScript or CUPS.
.. [#] cairo ≥ 1.15.4 is best but older versions may work too. The test suite
passes on cairo 1.14, and passes with some tests marked as “expected
failures” on 1.10 and 1.12 due to behavior changes or bugs in cairo. If
you get incomplete SVG renderings, please read `#339
<https://github.com/Kozea/WeasyPrint/issues/339>`_. If you get invalid
PDF files, please read `#565
<https://github.com/Kozea/WeasyPrint/issues/565>`.
.. [#] Without it, PNG and SVG are the only supported image formats.
JPEG, GIF and others are not available.

View File

@ -11,6 +11,7 @@ import functools
import io
import math
import shutil
import warnings
import cairocffi as cairo
@ -27,6 +28,14 @@ from .logger import LOGGER
from .pdf import write_pdf_metadata
if cairo.cairo_version() < 11504:
warnings.warn(
'There are known rendering problems with cairo < 1.15.4. WeasyPrint '
'may work with older versions, but please read the note about the '
'needed cairo version on the "Install" page of the documentation '
'before reporting bugs.')
def _get_matrix(box):
"""Return the matrix for the CSS transforms on this box.

View File

@ -10,7 +10,6 @@
"""
import re
import warnings
import cairocffi as cairo
import cffi
@ -18,9 +17,6 @@ import pyphen
from .logger import LOGGER
if cairo.cairo_version() <= 11400:
warnings.warn('There are known rendering problems with Cairo <= 1.14.0')
CAIRO_DUMMY_CONTEXT = {
True: cairo.Context(cairo.ImageSurface(cairo.FORMAT_ARGB32, 1, 1)),