weasyprint 65.1__tar.gz → 67.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. {weasyprint-65.1 → weasyprint-67.0}/PKG-INFO +5 -6
  2. {weasyprint-65.1 → weasyprint-67.0}/README.rst +1 -1
  3. {weasyprint-65.1 → weasyprint-67.0}/docs/api_reference.rst +45 -21
  4. {weasyprint-65.1 → weasyprint-67.0}/docs/changelog.rst +279 -1
  5. {weasyprint-65.1 → weasyprint-67.0}/docs/common_use_cases.rst +26 -0
  6. {weasyprint-65.1 → weasyprint-67.0}/docs/first_steps.rst +12 -4
  7. {weasyprint-65.1 → weasyprint-67.0}/pyproject.toml +5 -6
  8. {weasyprint-65.1 → weasyprint-67.0}/tests/conftest.py +2 -2
  9. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_common.py +39 -12
  10. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_counters.py +7 -7
  11. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_descriptors.py +11 -11
  12. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_errors.py +4 -4
  13. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_expanders.py +88 -87
  14. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_fonts.py +5 -5
  15. weasyprint-67.0/tests/css/test_layers.py +85 -0
  16. weasyprint-67.0/tests/css/test_math.py +264 -0
  17. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_nesting.py +2 -2
  18. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_pages.py +2 -2
  19. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_target.py +1 -1
  20. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_ua.py +1 -1
  21. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_validation.py +177 -150
  22. {weasyprint-65.1 → weasyprint-67.0}/tests/css/test_variables.py +67 -16
  23. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/__init__.py +5 -2
  24. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_bounding_box.py +25 -5
  25. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_gradients.py +1 -1
  26. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_images.py +77 -0
  27. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_opacity.py +2 -2
  28. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_text.py +1 -1
  29. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_transform.py +25 -0
  30. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_absolute.py +42 -5
  31. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_background.py +20 -20
  32. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_before_after.py +3 -3
  33. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_box.py +21 -30
  34. weasyprint-67.0/tests/draw/test_cmyk_color_profiles.py +78 -0
  35. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_column.py +3 -3
  36. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_current_color.py +4 -4
  37. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_float.py +173 -3
  38. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_footnote.py +15 -9
  39. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_footnote_column.py +3 -3
  40. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_gradient.py +68 -8
  41. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_image.py +16 -17
  42. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_leader.py +1 -1
  43. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_list.py +2 -2
  44. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_opacity.py +1 -1
  45. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_overflow.py +3 -3
  46. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_page.py +2 -2
  47. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_table.py +4 -8
  48. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_text.py +9 -7
  49. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_block.py +107 -16
  50. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_column.py +55 -11
  51. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_flex.py +173 -22
  52. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_float.py +17 -2
  53. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_footnotes.py +169 -4
  54. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_grid.py +734 -2
  55. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_image.py +59 -11
  56. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_inline.py +19 -19
  57. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_inline_block.py +1 -1
  58. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_list.py +8 -8
  59. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_page.py +26 -31
  60. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_position.py +98 -3
  61. weasyprint-65.1/tests/layout/test_shrink_to_fit.py → weasyprint-67.0/tests/layout/test_preferred.py +46 -1
  62. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/test_table.py +181 -106
  63. weasyprint-67.0/tests/resources/cmyk.icc +0 -0
  64. weasyprint-67.0/tests/resources/cmyk_with_icc.jpg +0 -0
  65. weasyprint-67.0/tests/resources/cmyk_without_icc.jpg +0 -0
  66. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/weasyprint.otf +0 -0
  67. {weasyprint-65.1 → weasyprint-67.0}/tests/test_api.py +82 -40
  68. {weasyprint-65.1 → weasyprint-67.0}/tests/test_boxes.py +10 -11
  69. {weasyprint-65.1 → weasyprint-67.0}/tests/test_fonts.py +4 -4
  70. {weasyprint-65.1 → weasyprint-67.0}/tests/test_pdf.py +15 -6
  71. {weasyprint-65.1 → weasyprint-67.0}/tests/test_presentational_hints.py +2 -1
  72. {weasyprint-65.1 → weasyprint-67.0}/tests/test_stacking.py +12 -6
  73. {weasyprint-65.1 → weasyprint-67.0}/tests/test_text.py +216 -44
  74. {weasyprint-65.1 → weasyprint-67.0}/tests/test_url.py +2 -2
  75. {weasyprint-65.1 → weasyprint-67.0}/tests/testing_utils.py +3 -3
  76. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/__init__.py +17 -7
  77. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/__main__.py +21 -10
  78. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/anchors.py +4 -4
  79. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/__init__.py +732 -67
  80. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/computed_values.py +65 -170
  81. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/counters.py +1 -1
  82. weasyprint-67.0/weasyprint/css/functions.py +206 -0
  83. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/html5_ua.css +3 -7
  84. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/html5_ua_form.css +2 -2
  85. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/media_queries.py +3 -1
  86. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/properties.py +6 -2
  87. weasyprint-65.1/weasyprint/css/utils.py → weasyprint-67.0/weasyprint/css/tokens.py +306 -397
  88. weasyprint-67.0/weasyprint/css/units.py +91 -0
  89. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/validation/__init__.py +1 -1
  90. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/validation/descriptors.py +47 -19
  91. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/validation/expanders.py +7 -8
  92. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/validation/properties.py +341 -357
  93. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/document.py +20 -19
  94. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/draw/__init__.py +56 -63
  95. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/draw/border.py +121 -69
  96. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/draw/color.py +1 -1
  97. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/draw/text.py +60 -41
  98. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/formatting_structure/boxes.py +24 -5
  99. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/formatting_structure/build.py +33 -45
  100. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/images.py +76 -62
  101. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/__init__.py +32 -26
  102. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/absolute.py +7 -6
  103. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/background.py +7 -7
  104. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/block.py +195 -152
  105. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/column.py +19 -24
  106. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/flex.py +54 -26
  107. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/float.py +12 -7
  108. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/grid.py +284 -90
  109. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/inline.py +121 -68
  110. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/page.py +45 -12
  111. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/percent.py +14 -10
  112. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/preferred.py +105 -63
  113. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/replaced.py +9 -6
  114. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/table.py +16 -9
  115. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/__init__.py +58 -18
  116. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/anchors.py +3 -4
  117. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/fonts.py +126 -69
  118. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/metadata.py +36 -4
  119. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/pdfa.py +19 -3
  120. weasyprint-67.0/weasyprint/pdf/pdfua.py +17 -0
  121. weasyprint-67.0/weasyprint/pdf/pdfx.py +83 -0
  122. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/stream.py +57 -49
  123. weasyprint-67.0/weasyprint/pdf/tags.py +307 -0
  124. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/stacking.py +14 -15
  125. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/__init__.py +59 -32
  126. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/bounding_box.py +4 -2
  127. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/defs.py +4 -9
  128. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/images.py +11 -3
  129. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/text.py +11 -2
  130. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/utils.py +15 -8
  131. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/text/constants.py +1 -1
  132. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/text/ffi.py +4 -3
  133. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/text/fonts.py +13 -5
  134. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/text/line_break.py +146 -43
  135. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/urls.py +41 -13
  136. weasyprint-65.1/weasyprint/draw/stack.py +0 -13
  137. weasyprint-65.1/weasyprint/pdf/pdfua.py +0 -125
  138. {weasyprint-65.1 → weasyprint-67.0}/LICENSE +0 -0
  139. {weasyprint-65.1 → weasyprint-67.0}/docs/conf.py +0 -0
  140. {weasyprint-65.1 → weasyprint-67.0}/docs/contribute.rst +0 -0
  141. {weasyprint-65.1 → weasyprint-67.0}/docs/going_further.rst +0 -0
  142. {weasyprint-65.1 → weasyprint-67.0}/docs/index.rst +0 -0
  143. {weasyprint-65.1 → weasyprint-67.0}/docs/manpage.rst +0 -0
  144. {weasyprint-65.1 → weasyprint-67.0}/docs/support.rst +0 -0
  145. {weasyprint-65.1 → weasyprint-67.0}/tests/__init__.py +0 -0
  146. {weasyprint-65.1 → weasyprint-67.0}/tests/css/__init__.py +0 -0
  147. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/__init__.py +0 -0
  148. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_clip.py +0 -0
  149. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_defs.py +0 -0
  150. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_markers.py +0 -0
  151. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_paths.py +0 -0
  152. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_patterns.py +0 -0
  153. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_shapes.py +0 -0
  154. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_units.py +0 -0
  155. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/svg/test_visibility.py +0 -0
  156. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_transform.py +0 -0
  157. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_visibility.py +0 -0
  158. {weasyprint-65.1 → weasyprint-67.0}/tests/draw/test_whitespace.py +0 -0
  159. {weasyprint-65.1 → weasyprint-67.0}/tests/layout/__init__.py +0 -0
  160. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/acid2-reference.html +0 -0
  161. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/acid2-test.html +0 -0
  162. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/blue.jpg +0 -0
  163. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/border.svg +0 -0
  164. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/border2.svg +0 -0
  165. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/doc1.html +0 -0
  166. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/doc1_UTF-16BE.html +0 -0
  167. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/icon.png +0 -0
  168. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/latin1-test.css +0 -0
  169. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/logo_small.png +0 -0
  170. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/mask.svg +0 -0
  171. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/mini_ua.css +0 -0
  172. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/not-optimized-exif.jpg +0 -0
  173. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/not-optimized.jpg +0 -0
  174. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/pattern-transparent.svg +0 -0
  175. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/pattern.gif +0 -0
  176. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/pattern.palette.png +0 -0
  177. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/pattern.png +0 -0
  178. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/pattern.svg +0 -0
  179. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/really-a-png.svg +0 -0
  180. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/really-a-svg.png +0 -0
  181. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/sheet2.css +0 -0
  182. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/sub_directory/sheet1.css +0 -0
  183. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/tests_ua.css +0 -0
  184. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/user.css +0 -0
  185. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/utf8-test.css +0 -0
  186. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/weasyprint.otb +0 -0
  187. {weasyprint-65.1 → weasyprint-67.0}/tests/resources/weasyprint.woff +0 -0
  188. {weasyprint-65.1 → weasyprint-67.0}/tests/test_acid2.py +0 -0
  189. {weasyprint-65.1 → weasyprint-67.0}/tests/test_unicode.py +0 -0
  190. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/html5_ph.css +0 -0
  191. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/css/targets.py +0 -0
  192. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/html.py +0 -0
  193. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/leader.py +0 -0
  194. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/layout/min_max.py +0 -0
  195. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/logger.py +0 -0
  196. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/matrix.py +0 -0
  197. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/debug.py +0 -0
  198. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/pdf/sRGB2014.icc +0 -0
  199. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/css.py +0 -0
  200. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/path.py +0 -0
  201. {weasyprint-65.1 → weasyprint-67.0}/weasyprint/svg/shapes.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weasyprint
3
- Version: 65.1
3
+ Version: 67.0
4
4
  Summary: The Awesome Document Factory
5
5
  Keywords: html,css,pdf,converter
6
6
  Author-email: Simon Sapin <simon.sapin@exyr.org>
7
7
  Maintainer-email: CourtBouillon <contact@courtbouillon.org>
8
- Requires-Python: >=3.9
8
+ Requires-Python: >=3.10
9
9
  Description-Content-Type: text/x-rst
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
@@ -14,7 +14,6 @@ Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3 :: Only
17
- Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
@@ -29,11 +28,11 @@ License-File: LICENSE
29
28
  Requires-Dist: pydyf >=0.11.0
30
29
  Requires-Dist: cffi >=0.6
31
30
  Requires-Dist: tinyhtml5 >=2.0.0b1
32
- Requires-Dist: tinycss2 >=1.4.0
31
+ Requires-Dist: tinycss2 >=1.5.0
33
32
  Requires-Dist: cssselect2 >=0.8.0
34
33
  Requires-Dist: Pyphen >=0.9.1
35
34
  Requires-Dist: Pillow >=9.1.0
36
- Requires-Dist: fonttools[woff] >=4.0.0
35
+ Requires-Dist: fonttools[woff] >=4.59.2
37
36
  Requires-Dist: sphinx ; extra == "doc"
38
37
  Requires-Dist: furo ; extra == "doc"
39
38
  Requires-Dist: pytest ; extra == "test"
@@ -62,7 +61,7 @@ WebKit or Gecko. The CSS layout engine is written in Python, designed for
62
61
  pagination, and meant to be easy to hack on.
63
62
 
64
63
  * Free software: BSD license
65
- * For Python 3.9+, tested on CPython and PyPy
64
+ * For Python 3.10+, tested on CPython and PyPy
66
65
  * Documentation: https://doc.courtbouillon.org/weasyprint
67
66
  * Examples: https://weasyprint.org/#samples
68
67
  * Changelog: https://github.com/Kozea/WeasyPrint/releases
@@ -13,7 +13,7 @@ WebKit or Gecko. The CSS layout engine is written in Python, designed for
13
13
  pagination, and meant to be easy to hack on.
14
14
 
15
15
  * Free software: BSD license
16
- * For Python 3.9+, tested on CPython and PyPy
16
+ * For Python 3.10+, tested on CPython and PyPy
17
17
  * Documentation: https://doc.courtbouillon.org/weasyprint
18
18
  * Examples: https://weasyprint.org/#samples
19
19
  * Changelog: https://github.com/Kozea/WeasyPrint/releases
@@ -182,14 +182,35 @@ specifications.
182
182
  Fonts
183
183
  ~~~~~
184
184
 
185
- WeasyPrint can use any font that Pango can find installed on the system. Fonts
186
- are automatically embedded in PDF files.
185
+ WeasyPrint can use any font that Pango_ can find installed on the system. Fonts are
186
+ automatically embedded in PDF files and are subset by default to only include the glyphs
187
+ used in the PDF. Subsetting is done with hb-subset_ when available on the system,
188
+ or by the slower fontTools_ library as a fallback.
187
189
 
188
- Pango always uses fontconfig to access fonts, even on Windows and macOS. You
190
+ Pango_ always uses Fontconfig_ to access fonts, even on Windows and macOS. You
189
191
  can list the available fonts thanks to the ``fc-list`` command, and know which
190
192
  font is matched by a given pattern thanks to ``fc-match``. Copying a font file
191
193
  into the ``~/.local/share/fonts`` directory is generally enough to install a
192
- new font. WeasyPrint should support the major font formats handled by Harfbuzz.
194
+ new font. WeasyPrint should support the major font formats handled by HarfBuzz_.
195
+
196
+ WeasyPrint follows the Fontconfig_ configuration of the system. This default
197
+ configuration is often useful for many cases: font fallbacks for missing glyphs, aliases
198
+ for standard font families like "serif" or "monospace", colored variants for emojis,
199
+ etc. But some of these default rules can sometimes interfere with CSS rules, and it may
200
+ be interesting to disable them if you need to tweak details about font management.
201
+
202
+ When a Unicode code point is not supported by a font and its fallbacks, the font’s `.notdef glyph`_ is
203
+ displayed instead, and a warning is displayed in logs. Because of the way Pango handles
204
+ this case, the .notdef glyph may be rendered with an incorrect width (advance), but the layout of
205
+ the other glyphs is correct. Text search and selection work as if the glyph was
206
+ available.
207
+
208
+ .. _hb-subset: https://harfbuzz.github.io/harfbuzz-hb-subset.html
209
+ .. _fontTools: https://fonttools.readthedocs.io/en/latest/
210
+ .. _Pango: https://www.pango.org/
211
+ .. _Fontconfig: https://www.freedesktop.org/wiki/Software/fontconfig/
212
+ .. _HarfBuzz: https://harfbuzz.github.io/
213
+ .. _.notdef glyph: https://en.wikipedia.org/wiki/Notdef_glyph
193
214
 
194
215
 
195
216
  CSS
@@ -199,13 +220,7 @@ WeasyPrint supports many of the `CSS specifications`_ written by the W3C. You
199
220
  will find in this chapter a comprehensive list of the specifications or drafts
200
221
  with at least one feature implemented in WeasyPrint.
201
222
 
202
- The results of some of the test suites provided by the W3C are also available
203
- at `test.weasyprint.org`_. This website uses a tool called `WeasySuite`_ that
204
- can be useful if you want to implement new features in WeasyPrint.
205
-
206
223
  .. _CSS specifications: https://www.w3.org/Style/CSS/current-work
207
- .. _test.weasyprint.org: http://test.weasyprint.org/
208
- .. _WeasySuite: https://github.com/Kozea/WeasySuite
209
224
 
210
225
  CSS Level 2 Revision 1
211
226
  ++++++++++++++++++++++
@@ -216,7 +231,6 @@ Test`_.
216
231
 
217
232
  The CSS 2.1 features listed here are **not** supported:
218
233
 
219
- * The `::first-line`_ pseudo-element.
220
234
  * On tables: `visibility: collapse`_.
221
235
  * Minimum and maximum height_ on table-related boxes.
222
236
  * Minimum and maximum width_ and height_ on page-margin boxes.
@@ -228,7 +242,6 @@ The CSS 2.1 features listed here are **not** supported:
228
242
 
229
243
  .. _CSS Level 2 Revision 1: https://www.w3.org/TR/CSS21/
230
244
  .. _Acid2 Test: https://www.webstandards.org/files/acid2/test.html
231
- .. _::first-line: https://www.w3.org/TR/CSS21/selector.html#first-line-pseudo
232
245
  .. _empty-cells: https://www.w3.org/TR/CSS21/tables.html#empty-cells
233
246
  .. _visibility\: collapse: https://www.w3.org/TR/CSS21/tables.html#dynamic-effects
234
247
  .. _width: https://www.w3.org/TR/CSS21/visudet.html#min-max-widths
@@ -237,6 +250,7 @@ The CSS 2.1 features listed here are **not** supported:
237
250
  .. _Bi-directional text: https://www.w3.org/TR/CSS21/visuren.html#direction
238
251
  .. _System colors: https://www.w3.org/TR/CSS21/ui.html#system-colors
239
252
  .. _system fonts: https://www.w3.org/TR/CSS21/fonts.html#propdef-font
253
+ .. _CSS Color Module Level 3: https://www.w3.org/TR/css-color-3/
240
254
 
241
255
  To the best of our knowledge, everything else that applies to the
242
256
  print media **is** supported. Please report a bug if you find this list
@@ -492,20 +506,30 @@ The other features of this module are **not** implemented:
492
506
  .. _user agent stylesheet: https://github.com/Kozea/WeasyPrint/blob/main/weasyprint/css/html5_ua.css
493
507
  .. _Leaders: https://www.w3.org/TR/css-content-3/#leaders
494
508
 
495
- CSS Color Module Level 3
496
- ++++++++++++++++++++++++
509
+ CSS Color Module Level 4 / 5
510
+ ++++++++++++++++++++++++++++
497
511
 
498
- The `CSS Color Module Level 3`_ is a recommendation defining "CSS properties
499
- which allow authors to specify the foreground color and opacity of an
500
- element". Its main goal is to specify how colors are defined, including color
501
- keywords and the ``#rgb``, ``#rrggbb``, ``rgb()``, ``rgba()``, ``hsl()``,
502
- ``hsla()`` syntaxes. Opacity and alpha compositing are also defined in this
503
- document.
512
+ The `CSS Color Module Level 4`_ is a recommendation defining "CSS properties which allow
513
+ authors to specify the foreground color and opacity of the text content of an element".
514
+ Its main goal is to specify how colors are defined, including color keywords and many
515
+ color notations including ``#rgba``, ``rgb()``, ``hsl()``, ``hwb()``, ``lab()``, etc.
516
+ The standard ``color()`` function gives a common way to define colors giving their color
517
+ space. Opacity and alpha compositing are also defined in this document.
504
518
 
505
519
  This recommendation is fully implemented in WeasyPrint, except the deprecated
506
520
  System Colors.
507
521
 
508
- .. _CSS Color Module Level 3: https://www.w3.org/TR/css-color-3/
522
+ The `CSS Color Module Level 5`_ is a working draft adding "color modification functions,
523
+ custom color spaces (ICC profiles), ``contrast-color()``, ``light-dark()`` and
524
+ ``device-cmyk()``" to level 4.
525
+
526
+ WeasyPrint supports the ``light-dark()`` and ``device-cmyk()`` properties, and the
527
+ ``@color-profile`` at-rule.
528
+
529
+ WeasyPrint does **not** support the ``color-mix()`` and ``contrast-color()`` properties.
530
+
531
+ .. _CSS Color Module Level 4: https://www.w3.org/TR/css-color-4/
532
+ .. _CSS Color Module Level 5: https://www.w3.org/TR/css-color-5/
509
533
 
510
534
  CSS Transforms Module Level 1
511
535
  +++++++++++++++++++++++++++++
@@ -2,6 +2,284 @@ Changelog
2
2
  =========
3
3
 
4
4
 
5
+ Version 67.0
6
+ ------------
7
+
8
+ Released on 2025-12-02.
9
+
10
+ Dependencies:
11
+
12
+ * Python 3.10+ is now needed, Python 3.9 is not supported anymore
13
+ * tinycss2 1.5.0+ is now needed
14
+ * fontTools 4.59.2+ is now needed
15
+
16
+ Features:
17
+
18
+ * `#2560 <https://github.com/Kozea/WeasyPrint/pull/2560>`_,
19
+ `#640 <https://github.com/Kozea/WeasyPrint/issues/640>`_,
20
+ `#844 <https://github.com/Kozea/WeasyPrint/issues/844>`_,
21
+ `#1091 <https://github.com/Kozea/WeasyPrint/issues/1091>`_,
22
+ `#2517 <https://github.com/Kozea/WeasyPrint/issues/2517>`_:
23
+ Support CMYK colors, PDF/X, color profiles and light-dark() function
24
+ * `#2558 <https://github.com/Kozea/WeasyPrint/pull/2558>`_,
25
+ `#1175 <https://github.com/Kozea/WeasyPrint/issues/1175>`_:
26
+ Support ::first-line, with financial support from Karte Technology
27
+ * `#2552 <https://github.com/Kozea/WeasyPrint/pull/2552>`_:
28
+ Support CSS layers, with financial support from Code & Co.
29
+ * `#2564 <https://github.com/Kozea/WeasyPrint/pull/2564>`_,
30
+ `#2599 <https://github.com/Kozea/WeasyPrint/pull/2599>`_,
31
+ `#2397 <https://github.com/Kozea/WeasyPrint/issues/2397>`_:
32
+ Allow page breaks in grid rows, with financial support from Ocean Recap
33
+ * `#2568 <https://github.com/Kozea/WeasyPrint/pull/2568>`_,
34
+ `#357 <https://github.com/Kozea/WeasyPrint/issues/357>`_:
35
+ Support calc() and other mathematical functions
36
+ * `#2575 <https://github.com/Kozea/WeasyPrint/pull/2575>`_,
37
+ `#2574 <https://github.com/Kozea/WeasyPrint/issues/2574>`_:
38
+ Support PDF/A-1a, PDF/A-2a and PDF/A-3a
39
+ * `#2611 <https://github.com/Kozea/WeasyPrint/pull/2611>`_,
40
+ `#2573 <https://github.com/Kozea/WeasyPrint/issues/2573>`_:
41
+ Support PDF/A-4e and PDF/A-4f
42
+ * `#2523 <https://github.com/Kozea/WeasyPrint/pull/2523>`_:
43
+ Display tofu for missing glyphs
44
+ * `#2581 <https://github.com/Kozea/WeasyPrint/pull/2581>`_:
45
+ Add option to disable protocols in URL resolution
46
+ * `#2570 <https://github.com/Kozea/WeasyPrint/pull/2570>`_:
47
+ Support rch, cap, rcap, rex, ic and ric font-relative units
48
+ * `#2547 <https://github.com/Kozea/WeasyPrint/pull/2547>`_,
49
+ `#2140 <https://github.com/Kozea/WeasyPrint/issues/2140>`_:
50
+ Support "only" keyword in media queries
51
+
52
+ Bug fixes:
53
+
54
+ * `#2516 <https://github.com/Kozea/WeasyPrint/pull/2516>`_,
55
+ `#1510 <https://github.com/Kozea/WeasyPrint/issues/1510>`_:
56
+ Fix rendering of first line of text with nested right float
57
+ * `#2510 <https://github.com/Kozea/WeasyPrint/pull/2510>`_,
58
+ `#1073 <https://github.com/Kozea/WeasyPrint/issues/1073>`_,
59
+ `#2507 <https://github.com/Kozea/WeasyPrint/issues/2507>`_:
60
+ Avoid Pango crashes and font mismatches with @font-face rules referencing local fonts
61
+ * `#2532 <https://github.com/Kozea/WeasyPrint/pull/2532>`_,
62
+ `#2531 <https://github.com/Kozea/WeasyPrint/issues/2531>`_:
63
+ Use fonttools instancer instead of deprecated mutator API
64
+ * `#2541 <https://github.com/Kozea/WeasyPrint/pull/2541>`_:
65
+ Fix syntax of functions
66
+ * `#2543 <https://github.com/Kozea/WeasyPrint/pull/2543>`_:
67
+ Allow font-related units to access @font-face fonts
68
+ * `#2525 <https://github.com/Kozea/WeasyPrint/pull/2525>`_:
69
+ Respect top margins and avoid overlapping footnotes for columns, with financial support from Code & Co.
70
+ * `#2536 <https://github.com/Kozea/WeasyPrint/pull/2536>`_:
71
+ Remove Subtype key from font descriptor
72
+ * `#2539 <https://github.com/Kozea/WeasyPrint/pull/2539>`_:
73
+ Fix min width for SVGs with intrinsic ratio but no intrinsic size
74
+ * `#2537 <https://github.com/Kozea/WeasyPrint/pull/2537>`_,
75
+ `#2533 <https://github.com/Kozea/WeasyPrint/issues/2533>`_:
76
+ Fix order of operators when drawing SVGs
77
+ * `#2538 <https://github.com/Kozea/WeasyPrint/pull/2538>`_:
78
+ Don’t crash with nested unknown functions
79
+ * `#2542 <https://github.com/Kozea/WeasyPrint/pull/2542>`_:
80
+ Don’t crash when lh and rlh are used for line height or font size
81
+ * `#2540 <https://github.com/Kozea/WeasyPrint/pull/2540>`_,
82
+ `#2528 <https://github.com/Kozea/WeasyPrint/issues/2528>`_:
83
+ Use locale encoding instead of filesystem encoding for font paths
84
+ * `#2563 <https://github.com/Kozea/WeasyPrint/pull/2563>`_,
85
+ `#2479 <https://github.com/Kozea/WeasyPrint/issues/2479>`_:
86
+ Don’t avoid float collisions for atomic flex items
87
+ * `#2569 <https://github.com/Kozea/WeasyPrint/pull/2569>`_:
88
+ Don’t be case-sensitive for units
89
+ * `#2567 <https://github.com/Kozea/WeasyPrint/pull/2567>`_,
90
+ `#2566 <https://github.com/Kozea/WeasyPrint/issues/2566>`_:
91
+ Add x-default attribute for metadata description to be compliant with PDF/A
92
+ * `#2586 <https://github.com/Kozea/WeasyPrint/pull/2586>`_,
93
+ `#2571 <https://github.com/Kozea/WeasyPrint/issues/2571>`_:
94
+ Improve formatting contexts management
95
+ * `#2600 <https://github.com/Kozea/WeasyPrint/pull/2600>`_:
96
+ Fix SVG image aspect ratio when only width or height is specified
97
+ * `#2612 <https://github.com/Kozea/WeasyPrint/pull/2612>`_,
98
+ `#2595 <https://github.com/Kozea/WeasyPrint/pull/2595>`_:
99
+ Clean block layout and fix corner cases
100
+ * `#2522 <https://github.com/Kozea/WeasyPrint/issues/2522>`_:
101
+ Ignore preserveAspectRatio when SVG has no viewBox
102
+ * `#2544 <https://github.com/Kozea/WeasyPrint/issues/2544>`_:
103
+ Allow to use a variable twice in a function
104
+ * `#2555 <https://github.com/Kozea/WeasyPrint/issues/2555>`_:
105
+ Fix flex gap in right-to-left context
106
+ * `#2591 <https://github.com/Kozea/WeasyPrint/issues/2591>`_:
107
+ Respect non-auto widths and fix padding of grid items
108
+ * `#2601 <https://github.com/Kozea/WeasyPrint/issues/2601>`_:
109
+ Don’t crash when tagged tables are not displayed as tables
110
+ * `#2607 <https://github.com/Kozea/WeasyPrint/issues/2607>`_:
111
+ Fix rendering of multiline textareas with PDF forms
112
+ * `#2106 <https://github.com/Kozea/WeasyPrint/issues/2106>`_:
113
+ Force variable initialization to avoid crashes during column layout
114
+ * `#2618 <https://github.com/Kozea/WeasyPrint/pull/2618>`_,
115
+ `#2617 <https://github.com/Kozea/WeasyPrint/issues/2617>`_:
116
+ Fix rendering of relative grid and flex items
117
+
118
+ Documentation:
119
+
120
+ * `#2535 <https://github.com/Kozea/WeasyPrint/pull/2535>`_:
121
+ `#2534 <https://github.com/Kozea/WeasyPrint/issues/2534>`_:
122
+ Removed reference to defunct site
123
+
124
+ Contributors:
125
+
126
+ * Guillaume Ayoub
127
+ * Fazle Rabbi Ferdaus
128
+ * Lucie Anglade
129
+ * Luca Vercelli
130
+ * ChickenF622
131
+ * Ernie Chu
132
+ * Mark Pullin
133
+ * Malte Laukötter
134
+ * Markus Mohanty
135
+ * Yvonne Kothmeier
136
+ * Jarom Ort
137
+ * kuypan
138
+
139
+ Backers and sponsors:
140
+
141
+ * Spacinov
142
+ * Syslifters
143
+ * Kobalt
144
+ * Simon Sapin
145
+ * Grip Angebotssoftware
146
+ * Manuel Barkhau
147
+ * Simonsoft
148
+ * KontextWork
149
+ * Menutech
150
+ * TrainingSparkle
151
+ * Healthchecks.io
152
+ * Method B
153
+ * FieldHub
154
+ * Hammerbacher
155
+ * Yanal-Yves Fargialla
156
+ * Morntag
157
+ * Piloterr
158
+ * Xavid
159
+ * Charlie S.
160
+ * Prothesis Dental Solutions
161
+ * Kai DeLorenzo
162
+
163
+
164
+ Version 66.0
165
+ ------------
166
+
167
+ Released on 2025-07-24.
168
+
169
+ Features:
170
+
171
+ * `#2475 <https://github.com/Kozea/WeasyPrint/pull/2475>`_:
172
+ Add support for 'lh' and 'rlh' units
173
+ * `#2432 <https://github.com/Kozea/WeasyPrint/issues/2432>`_,
174
+ `#2437 <https://github.com/Kozea/WeasyPrint/pull/2437>`_:
175
+ Report footnotes when text overflows because of orphans, with financial support from Code & Co.
176
+ * `#2256 <https://github.com/Kozea/WeasyPrint/issues/2256>`_,
177
+ `#2466 <https://github.com/Kozea/WeasyPrint/pull/2466>`_:
178
+ Handle transform-origin in SVG
179
+ * `#2445 <https://github.com/Kozea/WeasyPrint/pull/2445>`_:
180
+ Add parameter to have additional HTTP headers for url_fetcher
181
+
182
+ Bug fixes:
183
+
184
+ * `#2471 <https://github.com/Kozea/WeasyPrint/pull/2471>`_,
185
+ `#2506 <https://github.com/Kozea/WeasyPrint/pull/2506>`_,
186
+ `#2500 <https://github.com/Kozea/WeasyPrint/issues/2500>`_,
187
+ `#2460 <https://github.com/Kozea/WeasyPrint/issues/2460>`_,
188
+ `#2363 <https://github.com/Kozea/WeasyPrint/issues/2363>`_,
189
+ `#2470 <https://github.com/Kozea/WeasyPrint/issues/2470>`_,
190
+ `#1872 <https://github.com/Kozea/WeasyPrint/issues/1872>`_,
191
+ `#2153 <https://github.com/Kozea/WeasyPrint/issues/2153>`_,
192
+ `#1838 <https://github.com/Kozea/WeasyPrint/issues/1838>`_,
193
+ `#1837 <https://github.com/Kozea/WeasyPrint/issues/1837>`_,
194
+ `#1784 <https://github.com/Kozea/WeasyPrint/issues/1784>`_,
195
+ `#1835 <https://github.com/Kozea/WeasyPrint/issues/1835>`_,
196
+ `#2444 <https://github.com/Kozea/WeasyPrint/issues/2444>`_,
197
+ `#2497 <https://github.com/Kozea/WeasyPrint/issues/2497>`_,
198
+ `#2505 <https://github.com/Kozea/WeasyPrint/issues/2505>`_,
199
+ `#2503 <https://github.com/Kozea/WeasyPrint/issues/2503>`_,
200
+ `#1836 <https://github.com/Kozea/WeasyPrint/issues/1836>`_,
201
+ `#2467 <https://github.com/Kozea/WeasyPrint/issues/2467>`_:
202
+ Improve PDF/UA support, with financial support from NLnet
203
+ * `#2425 <https://github.com/Kozea/WeasyPrint/pull/2425>`_,
204
+ `#1557 <https://github.com/Kozea/WeasyPrint/issues/1557>`_:
205
+ Improve position of outside markers
206
+ * `#2409 <https://github.com/Kozea/WeasyPrint/pull/2409>`_,
207
+ `#2265 <https://github.com/Kozea/WeasyPrint/issues/2265>`_:
208
+ Draw circles instead of rectangles when drawing dotted borders
209
+ * `#2416 <https://github.com/Kozea/WeasyPrint/pull/2416>`_,
210
+ `#2270 <https://github.com/Kozea/WeasyPrint/issues/2270>`_:
211
+ Correctly split words for automatic hyphenation
212
+ * `#2439 <https://github.com/Kozea/WeasyPrint/pull/2439>`_,
213
+ `#2426 <https://github.com/Kozea/WeasyPrint/issues/2426>`_:
214
+ Don’t rely on URL protocols outside URL fetcher function
215
+ * `#2433 <https://github.com/Kozea/WeasyPrint/pull/2433>`_:
216
+ Disable style for deprecated outline algorithm
217
+ * `#2447 <https://github.com/Kozea/WeasyPrint/pull/2447>`_,
218
+ `#2441 <https://github.com/Kozea/WeasyPrint/issues/2441>`_,
219
+ `#2448 <https://github.com/Kozea/WeasyPrint/issues/2448>`_:
220
+ Improve min- and max-content calculation, with financial support from Menutech
221
+ * `#2454 <https://github.com/Kozea/WeasyPrint/pull/2454>`_,
222
+ `#2442 <https://github.com/Kozea/WeasyPrint/issues/2442>`_,
223
+ `#2449 <https://github.com/Kozea/WeasyPrint/issues/2449>`_:
224
+ Minor fixes for flex layout
225
+ * `#2473 <https://github.com/Kozea/WeasyPrint/pull/2473>`_,
226
+ `#2459 <https://github.com/Kozea/WeasyPrint/issues/2459>`_:
227
+ Include out-of-flow boxes in page layout progress, with financial support from Pathfindr
228
+ * `#2458 <https://github.com/Kozea/WeasyPrint/pull/2458>`_:
229
+ Replace deprecated warn logger function
230
+ * `#2494 <https://github.com/Kozea/WeasyPrint/pull/2494>`_,
231
+ `#1856 <https://github.com/Kozea/WeasyPrint/issues/1856>`_:
232
+ Fix bug with bottom margins in columns
233
+ * `#2435 <https://github.com/Kozea/WeasyPrint/issues/2435>`_:
234
+ Make footnote calls inherit from footnotes
235
+ * `#2484 <https://github.com/Kozea/WeasyPrint/issues/2484>`_,
236
+ `#2456 <https://github.com/Kozea/WeasyPrint/issues/2456>`_:
237
+ Allow to avoid page breaks after table-row-group elements
238
+ * `#2450 <https://github.com/Kozea/WeasyPrint/issues/2450>`_:
239
+ Draw background and borders for relative grid containers
240
+ * `#2453 <https://github.com/Kozea/WeasyPrint/issues/2453>`_:
241
+ Don’t advance position_y for collapsed margins of discarded children
242
+ * `#2493 <https://github.com/Kozea/WeasyPrint/issues/2493>`_:
243
+ Fix endless loop with CSS variables referencing each other
244
+ * `#2502 <https://github.com/Kozea/WeasyPrint/issues/2502>`_:
245
+ Ignore bottom margin when calculating footnote overflow
246
+
247
+ Contributors:
248
+
249
+ * Guillaume Ayoub
250
+ * Lucie Anglade
251
+ * Alvaro Garcia Fernandez
252
+ * Emmanuel Ferdman
253
+ * Gabriel Corona
254
+ * Markus Mohanty
255
+ * Luca Vercelli
256
+ * Tre Huang
257
+
258
+ Backers and sponsors:
259
+
260
+ * Spacinov
261
+ * Kobalt
262
+ * Grip Angebotssoftware
263
+ * Syslifters
264
+ * Simon Sapin
265
+ * Manuel Barkhau
266
+ * Simonsoft
267
+ * Menutech
268
+ * KontextWork
269
+ * TrainingSparkle
270
+ * Healthchecks.io
271
+ * Hammerbacher
272
+ * DocRaptor
273
+ * Yanal-Yves Fargialla
274
+ * Method B
275
+ * FieldHub
276
+ * Morntag
277
+ * Xavid
278
+ * Kai DeLorenzo
279
+ * Charlie S.
280
+ * Alan Villalobos
281
+
282
+
5
283
  Version 65.1
6
284
  ------------
7
285
 
@@ -65,7 +343,7 @@ Dependencies:
65
343
  Features:
66
344
 
67
345
  * `#1665 <https://github.com/Kozea/WeasyPrint/issues/1665>`_:
68
- Support gap properties in Flex layout, with financial support from NLnet.
346
+ Support gap properties in Flex layout, with financial support from NLnet
69
347
  * `#378 <https://github.com/Kozea/WeasyPrint/issues/378>`_,
70
348
  `#2405 <https://github.com/Kozea/WeasyPrint/pull/2405>`_:
71
349
  Handle @font-face unicode-range
@@ -158,6 +158,32 @@ also used to define the order of the PDF content.
158
158
  Some information is required in your HTML file, including a ``<title>`` tag,
159
159
  and a ``lang`` attribute set on the ``<html>`` tag.
160
160
 
161
+ PDF/X (Graphics Exchange)
162
+ .........................
163
+
164
+ PDF/X documents facilitate graphics exchange and adds printing-related requirements such
165
+ as color profiles.
166
+
167
+ The easiest way to fulfill these requirements is to use device-dependent CMYK colors and
168
+ images everywhere in your document. For colors, you can use the ``device-cmyk()``
169
+ function:
170
+
171
+ .. code-block:: css
172
+
173
+ body { color: device-cmyk(0% 10% 0% 80%) }
174
+
175
+ You also have to define the output profile color to use.
176
+
177
+ .. code-block:: css
178
+
179
+ @color-profile device-cmyk {
180
+ components: cyan, magenta, yellow, black;
181
+ src: url(path/to/cmyk-profile.icc);
182
+ }
183
+
184
+ If possible, PDF/X-4 should be preferred: it allows transparency layers that are
185
+ forbidden by previous variants.
186
+
161
187
  Factur-X / ZUGFeRD (Electronic Invoices)
162
188
  ........................................
163
189
 
@@ -9,16 +9,16 @@ Installation
9
9
 
10
10
  WeasyPrint |version| depends on:
11
11
 
12
- * Python_ ≥ 3.9.0
12
+ * Python_ ≥ 3.10.0
13
13
  * Pango_ ≥ 1.44.0
14
- * pydyf_ ≥ 0.10.0
14
+ * pydyf_ ≥ 0.11.0
15
15
  * CFFI_ ≥ 0.6
16
16
  * tinyhtml5_ ≥ 2.0.0b1
17
- * tinycss2_ ≥ 1.3.0
17
+ * tinycss2_ ≥ 1.5.0
18
18
  * cssselect2_ ≥ 0.8.0
19
19
  * Pyphen_ ≥ 0.9.1
20
20
  * Pillow_ ≥ 9.1.0
21
- * fontTools_ ≥ 4.0.0
21
+ * fontTools_ ≥ 4.59.2
22
22
 
23
23
  .. _Python: https://www.python.org/
24
24
  .. _Pango: https://pango.gnome.org/
@@ -269,6 +269,14 @@ information.
269
269
  .. _an AWS Lambda layer: https://github.com/kotify/cloud-print-utils
270
270
  .. _#1003: https://github.com/Kozea/WeasyPrint/issues/1003
271
271
 
272
+ Docker
273
+ ++++++
274
+
275
+ Luca Vercelli maintains `Docker images`_.
276
+
277
+ .. _an AWS Lambda layer: https://github.com/kotify/cloud-print-utils
278
+ .. _Docker images: https://github.com/luca-vercelli/WeasyPrint-docker-images/
279
+
272
280
 
273
281
  Troubleshooting
274
282
  ~~~~~~~~~~~~~~~
@@ -8,18 +8,18 @@ description = 'The Awesome Document Factory'
8
8
  keywords = ['html', 'css', 'pdf', 'converter']
9
9
  authors = [{name = 'Simon Sapin', email = 'simon.sapin@exyr.org'}]
10
10
  maintainers = [{name = 'CourtBouillon', email = 'contact@courtbouillon.org'}]
11
- requires-python = '>=3.9'
11
+ requires-python = '>=3.10'
12
12
  readme = {file = 'README.rst', content-type = 'text/x-rst'}
13
13
  license = {file = 'LICENSE'}
14
14
  dependencies = [
15
15
  'pydyf >=0.11.0',
16
16
  'cffi >=0.6',
17
17
  'tinyhtml5 >=2.0.0b1',
18
- 'tinycss2 >=1.4.0',
18
+ 'tinycss2 >=1.5.0',
19
19
  'cssselect2 >=0.8.0',
20
20
  'Pyphen >=0.9.1',
21
21
  'Pillow >=9.1.0',
22
- 'fonttools[woff] >=4.0.0',
22
+ 'fonttools[woff] >=4.59.2',
23
23
  ]
24
24
  classifiers = [
25
25
  'Development Status :: 5 - Production/Stable',
@@ -29,7 +29,6 @@ classifiers = [
29
29
  'Programming Language :: Python',
30
30
  'Programming Language :: Python :: 3',
31
31
  'Programming Language :: Python :: 3 :: Only',
32
- 'Programming Language :: Python :: 3.9',
33
32
  'Programming Language :: Python :: 3.10',
34
33
  'Programming Language :: Python :: 3.11',
35
34
  'Programming Language :: Python :: 3.12',
@@ -69,5 +68,5 @@ include = ['tests/*', 'weasyprint/*']
69
68
  exclude_lines = ['pragma: no cover', 'def __repr__', 'raise NotImplementedError']
70
69
 
71
70
  [tool.ruff.lint]
72
- select = ['E', 'W', 'F', 'I', 'N', 'RUF']
73
- ignore = ['RUF001', 'RUF002', 'RUF003']
71
+ select = ['E', 'W', 'F', 'I', 'N', 'RUF', 'T20', 'PIE', 'PT', 'RSE', 'UP']
72
+ ignore = ['E226', 'RUF001', 'RUF002', 'RUF003', 'RUF039', 'RUF059', 'UP031']
@@ -31,8 +31,8 @@ def document_write_png(document, target=None, resolution=96, antialiasing=1,
31
31
  command = (
32
32
  'gs', '-q', '-sDEVICE=png16m', f'-dTextAlphaBits={antialiasing}',
33
33
  f'-dGraphicsAlphaBits={antialiasing}', '-dBATCH', '-dNOPAUSE',
34
- '-dPDFSTOPONERROR', f'-r{resolution / zoom}', '-sOutputFile=-',
35
- pdf.name)
34
+ '-dPDFSTOPONERROR', f'-r{resolution / zoom}', '-dUsePDFX3Profile',
35
+ '-sOutputFile=-', pdf.name)
36
36
  pngs = run(command, stdout=PIPE).stdout
37
37
  os.remove(pdf.name)
38
38