weasyprint 66.0__tar.gz → 68.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 (202) hide show
  1. {weasyprint-66.0 → weasyprint-68.0}/PKG-INFO +6 -6
  2. {weasyprint-66.0 → weasyprint-68.0}/README.rst +1 -1
  3. {weasyprint-66.0 → weasyprint-68.0}/docs/api_reference.rst +52 -22
  4. {weasyprint-66.0 → weasyprint-68.0}/docs/changelog.rst +280 -0
  5. {weasyprint-66.0 → weasyprint-68.0}/docs/common_use_cases.rst +89 -66
  6. {weasyprint-66.0 → weasyprint-68.0}/docs/conf.py +4 -2
  7. {weasyprint-66.0 → weasyprint-68.0}/docs/first_steps.rst +58 -35
  8. {weasyprint-66.0 → weasyprint-68.0}/pyproject.toml +6 -7
  9. {weasyprint-66.0 → weasyprint-68.0}/tests/conftest.py +2 -2
  10. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_common.py +39 -16
  11. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_counters.py +4 -4
  12. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_descriptors.py +9 -9
  13. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_errors.py +4 -4
  14. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_expanders.py +88 -87
  15. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_fonts.py +5 -5
  16. weasyprint-68.0/tests/css/test_layers.py +85 -0
  17. weasyprint-68.0/tests/css/test_math.py +264 -0
  18. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_nesting.py +2 -2
  19. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_pages.py +2 -2
  20. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_target.py +22 -2
  21. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_ua.py +1 -1
  22. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_validation.py +201 -150
  23. {weasyprint-66.0 → weasyprint-68.0}/tests/css/test_variables.py +59 -8
  24. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/__init__.py +6 -3
  25. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_gradients.py +216 -2
  26. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_images.py +77 -0
  27. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_text.py +179 -0
  28. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_absolute.py +7 -7
  29. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_background.py +15 -15
  30. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_before_after.py +3 -3
  31. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_box.py +17 -21
  32. weasyprint-68.0/tests/draw/test_cmyk_color_profiles.py +78 -0
  33. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_column.py +2 -2
  34. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_current_color.py +2 -2
  35. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_float.py +101 -3
  36. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_footnote.py +3 -3
  37. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_footnote_column.py +3 -3
  38. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_gradient.py +183 -8
  39. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_image.py +9 -10
  40. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_list.py +2 -2
  41. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_overflow.py +2 -2
  42. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_page.py +2 -2
  43. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_table.py +0 -1
  44. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_text.py +4 -2
  45. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_block.py +76 -13
  46. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_column.py +25 -5
  47. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_flex.py +73 -20
  48. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_float.py +16 -0
  49. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_footnotes.py +89 -2
  50. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_grid.py +869 -0
  51. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_image.py +58 -10
  52. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_inline.py +2 -2
  53. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_list.py +3 -3
  54. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_page.py +87 -26
  55. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_position.py +95 -0
  56. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_preferred.py +1 -1
  57. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_table.py +27 -10
  58. weasyprint-68.0/tests/resources/cmyk.icc +0 -0
  59. weasyprint-68.0/tests/resources/cmyk_with_icc.jpg +0 -0
  60. weasyprint-68.0/tests/resources/cmyk_without_icc.jpg +0 -0
  61. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/weasyprint.otf +0 -0
  62. {weasyprint-66.0 → weasyprint-68.0}/tests/test_acid2.py +2 -2
  63. {weasyprint-66.0 → weasyprint-68.0}/tests/test_api.py +324 -100
  64. {weasyprint-66.0 → weasyprint-68.0}/tests/test_boxes.py +9 -9
  65. {weasyprint-66.0 → weasyprint-68.0}/tests/test_fonts.py +3 -3
  66. {weasyprint-66.0 → weasyprint-68.0}/tests/test_pdf.py +13 -4
  67. {weasyprint-66.0 → weasyprint-68.0}/tests/test_presentational_hints.py +2 -1
  68. {weasyprint-66.0 → weasyprint-68.0}/tests/test_stacking.py +4 -4
  69. {weasyprint-66.0 → weasyprint-68.0}/tests/test_text.py +229 -40
  70. {weasyprint-66.0 → weasyprint-68.0}/tests/test_url.py +2 -2
  71. {weasyprint-66.0 → weasyprint-68.0}/tests/testing_utils.py +3 -3
  72. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/__init__.py +47 -108
  73. weasyprint-68.0/weasyprint/__main__.py +239 -0
  74. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/anchors.py +4 -4
  75. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/__init__.py +719 -68
  76. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/computed_values.py +64 -175
  77. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/counters.py +1 -1
  78. weasyprint-68.0/weasyprint/css/functions.py +211 -0
  79. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/html5_ua.css +2 -1
  80. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/html5_ua_form.css +1 -1
  81. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/media_queries.py +3 -1
  82. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/properties.py +6 -2
  83. weasyprint-66.0/weasyprint/css/utils.py → weasyprint-68.0/weasyprint/css/tokens.py +310 -398
  84. weasyprint-68.0/weasyprint/css/units.py +91 -0
  85. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/validation/__init__.py +1 -1
  86. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/validation/descriptors.py +47 -19
  87. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/validation/expanders.py +7 -8
  88. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/validation/properties.py +343 -359
  89. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/document.py +22 -73
  90. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/draw/__init__.py +6 -7
  91. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/draw/border.py +3 -5
  92. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/draw/color.py +1 -1
  93. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/draw/text.py +62 -40
  94. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/formatting_structure/boxes.py +24 -3
  95. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/formatting_structure/build.py +113 -41
  96. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/images.py +94 -78
  97. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/__init__.py +29 -25
  98. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/absolute.py +3 -5
  99. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/background.py +7 -7
  100. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/block.py +140 -128
  101. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/column.py +18 -24
  102. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/flex.py +13 -5
  103. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/float.py +4 -6
  104. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/grid.py +304 -99
  105. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/inline.py +114 -60
  106. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/page.py +27 -16
  107. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/percent.py +14 -10
  108. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/preferred.py +79 -31
  109. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/replaced.py +9 -6
  110. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/table.py +8 -5
  111. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/__init__.py +58 -14
  112. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/anchors.py +11 -18
  113. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/fonts.py +135 -69
  114. weasyprint-68.0/weasyprint/pdf/metadata.py +187 -0
  115. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/pdfa.py +20 -6
  116. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/pdfua.py +1 -3
  117. weasyprint-68.0/weasyprint/pdf/pdfx.py +81 -0
  118. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/stream.py +18 -3
  119. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/tags.py +6 -4
  120. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/__init__.py +85 -48
  121. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/css.py +21 -4
  122. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/defs.py +5 -3
  123. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/images.py +11 -3
  124. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/text.py +11 -2
  125. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/utils.py +6 -3
  126. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/text/constants.py +1 -1
  127. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/text/ffi.py +4 -3
  128. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/text/fonts.py +14 -7
  129. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/text/line_break.py +101 -17
  130. weasyprint-68.0/weasyprint/urls.py +480 -0
  131. weasyprint-66.0/weasyprint/__main__.py +0 -203
  132. weasyprint-66.0/weasyprint/pdf/metadata.py +0 -100
  133. weasyprint-66.0/weasyprint/urls.py +0 -287
  134. {weasyprint-66.0 → weasyprint-68.0}/LICENSE +0 -0
  135. {weasyprint-66.0 → weasyprint-68.0}/docs/contribute.rst +0 -0
  136. {weasyprint-66.0 → weasyprint-68.0}/docs/going_further.rst +0 -0
  137. {weasyprint-66.0 → weasyprint-68.0}/docs/index.rst +0 -0
  138. {weasyprint-66.0 → weasyprint-68.0}/docs/manpage.rst +0 -0
  139. {weasyprint-66.0 → weasyprint-68.0}/docs/support.rst +0 -0
  140. {weasyprint-66.0 → weasyprint-68.0}/tests/__init__.py +0 -0
  141. {weasyprint-66.0 → weasyprint-68.0}/tests/css/__init__.py +0 -0
  142. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/__init__.py +0 -0
  143. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_bounding_box.py +0 -0
  144. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_clip.py +0 -0
  145. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_defs.py +0 -0
  146. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_markers.py +0 -0
  147. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_opacity.py +0 -0
  148. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_paths.py +0 -0
  149. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_patterns.py +0 -0
  150. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_shapes.py +0 -0
  151. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_transform.py +0 -0
  152. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_units.py +0 -0
  153. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/svg/test_visibility.py +0 -0
  154. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_leader.py +0 -0
  155. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_opacity.py +0 -0
  156. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_transform.py +0 -0
  157. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_visibility.py +0 -0
  158. {weasyprint-66.0 → weasyprint-68.0}/tests/draw/test_whitespace.py +0 -0
  159. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/__init__.py +0 -0
  160. {weasyprint-66.0 → weasyprint-68.0}/tests/layout/test_inline_block.py +0 -0
  161. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/acid2-reference.html +0 -0
  162. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/acid2-test.html +0 -0
  163. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/blue.jpg +0 -0
  164. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/border.svg +0 -0
  165. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/border2.svg +0 -0
  166. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/doc1.html +0 -0
  167. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/doc1_UTF-16BE.html +0 -0
  168. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/icon.png +0 -0
  169. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/latin1-test.css +0 -0
  170. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/logo_small.png +0 -0
  171. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/mask.svg +0 -0
  172. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/mini_ua.css +0 -0
  173. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/not-optimized-exif.jpg +0 -0
  174. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/not-optimized.jpg +0 -0
  175. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/pattern-transparent.svg +0 -0
  176. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/pattern.gif +0 -0
  177. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/pattern.palette.png +0 -0
  178. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/pattern.png +0 -0
  179. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/pattern.svg +0 -0
  180. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/really-a-png.svg +0 -0
  181. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/really-a-svg.png +0 -0
  182. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/sheet2.css +0 -0
  183. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/sub_directory/sheet1.css +0 -0
  184. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/tests_ua.css +0 -0
  185. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/user.css +0 -0
  186. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/utf8-test.css +0 -0
  187. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/weasyprint.otb +0 -0
  188. {weasyprint-66.0 → weasyprint-68.0}/tests/resources/weasyprint.woff +0 -0
  189. {weasyprint-66.0 → weasyprint-68.0}/tests/test_unicode.py +0 -0
  190. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/html5_ph.css +0 -0
  191. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/css/targets.py +0 -0
  192. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/html.py +0 -0
  193. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/leader.py +0 -0
  194. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/layout/min_max.py +0 -0
  195. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/logger.py +0 -0
  196. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/matrix.py +0 -0
  197. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/debug.py +0 -0
  198. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/pdf/sRGB2014.icc +0 -0
  199. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/stacking.py +0 -0
  200. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/bounding_box.py +0 -0
  201. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/path.py +0 -0
  202. {weasyprint-66.0 → weasyprint-68.0}/weasyprint/svg/shapes.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weasyprint
3
- Version: 66.0
3
+ Version: 68.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,15 +28,16 @@ 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"
40
39
  Requires-Dist: ruff ; extra == "test"
40
+ Requires-Dist: Pillow >=12.1.0 ; extra == "test"
41
41
  Project-URL: Changelog, https://github.com/Kozea/WeasyPrint/releases
42
42
  Project-URL: Code, https://github.com/Kozea/WeasyPrint
43
43
  Project-URL: Documentation, https://doc.courtbouillon.org/weasyprint/
@@ -62,7 +62,7 @@ WebKit or Gecko. The CSS layout engine is written in Python, designed for
62
62
  pagination, and meant to be easy to hack on.
63
63
 
64
64
  * Free software: BSD license
65
- * For Python 3.9+, tested on CPython and PyPy
65
+ * For Python 3.10+, tested on CPython and PyPy
66
66
  * Documentation: https://doc.courtbouillon.org/weasyprint
67
67
  * Examples: https://weasyprint.org/#samples
68
68
  * 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
@@ -56,7 +56,6 @@ Python API
56
56
  :members:
57
57
  .. autoclass:: CSS(input, **kwargs)
58
58
  .. autoclass:: Attachment(input, **kwargs)
59
- .. autofunction:: default_url_fetcher
60
59
  .. autodata:: DEFAULT_OPTIONS
61
60
 
62
61
  .. module:: weasyprint.document
@@ -68,6 +67,13 @@ Python API
68
67
  :members:
69
68
  :exclude-members: paint
70
69
 
70
+ .. module:: weasyprint.urls
71
+ .. autoclass:: URLFetcher
72
+ :members:
73
+ :member-order: bysource
74
+ .. autoclass:: URLFetcherResponse
75
+ .. autoclass:: FatalURLFetchingError
76
+
71
77
  .. module:: weasyprint.text.fonts
72
78
  .. autoclass:: FontConfiguration()
73
79
 
@@ -182,14 +188,35 @@ specifications.
182
188
  Fonts
183
189
  ~~~~~
184
190
 
185
- WeasyPrint can use any font that Pango can find installed on the system. Fonts
186
- are automatically embedded in PDF files.
191
+ WeasyPrint can use any font that Pango_ can find installed on the system. Fonts are
192
+ automatically embedded in PDF files and are subset by default to only include the glyphs
193
+ used in the PDF. Subsetting is done with hb-subset_ when available on the system,
194
+ or by the slower fontTools_ library as a fallback.
187
195
 
188
- Pango always uses fontconfig to access fonts, even on Windows and macOS. You
196
+ Pango_ always uses Fontconfig_ to access fonts, even on Windows and macOS. You
189
197
  can list the available fonts thanks to the ``fc-list`` command, and know which
190
198
  font is matched by a given pattern thanks to ``fc-match``. Copying a font file
191
199
  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.
200
+ new font. WeasyPrint should support the major font formats handled by HarfBuzz_.
201
+
202
+ WeasyPrint follows the Fontconfig_ configuration of the system. This default
203
+ configuration is often useful for many cases: font fallbacks for missing glyphs, aliases
204
+ for standard font families like "serif" or "monospace", colored variants for emojis,
205
+ etc. But some of these default rules can sometimes interfere with CSS rules, and it may
206
+ be interesting to disable them if you need to tweak details about font management.
207
+
208
+ When a Unicode code point is not supported by a font and its fallbacks, the font’s `.notdef glyph`_ is
209
+ displayed instead, and a warning is displayed in logs. Because of the way Pango handles
210
+ this case, the .notdef glyph may be rendered with an incorrect width (advance), but the layout of
211
+ the other glyphs is correct. Text search and selection work as if the glyph was
212
+ available.
213
+
214
+ .. _hb-subset: https://harfbuzz.github.io/harfbuzz-hb-subset.html
215
+ .. _fontTools: https://fonttools.readthedocs.io/en/latest/
216
+ .. _Pango: https://www.pango.org/
217
+ .. _Fontconfig: https://www.freedesktop.org/wiki/Software/fontconfig/
218
+ .. _HarfBuzz: https://harfbuzz.github.io/
219
+ .. _.notdef glyph: https://en.wikipedia.org/wiki/Notdef_glyph
193
220
 
194
221
 
195
222
  CSS
@@ -199,13 +226,7 @@ WeasyPrint supports many of the `CSS specifications`_ written by the W3C. You
199
226
  will find in this chapter a comprehensive list of the specifications or drafts
200
227
  with at least one feature implemented in WeasyPrint.
201
228
 
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
229
  .. _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
230
 
210
231
  CSS Level 2 Revision 1
211
232
  ++++++++++++++++++++++
@@ -216,7 +237,6 @@ Test`_.
216
237
 
217
238
  The CSS 2.1 features listed here are **not** supported:
218
239
 
219
- * The `::first-line`_ pseudo-element.
220
240
  * On tables: `visibility: collapse`_.
221
241
  * Minimum and maximum height_ on table-related boxes.
222
242
  * Minimum and maximum width_ and height_ on page-margin boxes.
@@ -228,7 +248,6 @@ The CSS 2.1 features listed here are **not** supported:
228
248
 
229
249
  .. _CSS Level 2 Revision 1: https://www.w3.org/TR/CSS21/
230
250
  .. _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
251
  .. _empty-cells: https://www.w3.org/TR/CSS21/tables.html#empty-cells
233
252
  .. _visibility\: collapse: https://www.w3.org/TR/CSS21/tables.html#dynamic-effects
234
253
  .. _width: https://www.w3.org/TR/CSS21/visudet.html#min-max-widths
@@ -237,6 +256,7 @@ The CSS 2.1 features listed here are **not** supported:
237
256
  .. _Bi-directional text: https://www.w3.org/TR/CSS21/visuren.html#direction
238
257
  .. _System colors: https://www.w3.org/TR/CSS21/ui.html#system-colors
239
258
  .. _system fonts: https://www.w3.org/TR/CSS21/fonts.html#propdef-font
259
+ .. _CSS Color Module Level 3: https://www.w3.org/TR/css-color-3/
240
260
 
241
261
  To the best of our knowledge, everything else that applies to the
242
262
  print media **is** supported. Please report a bug if you find this list
@@ -492,20 +512,30 @@ The other features of this module are **not** implemented:
492
512
  .. _user agent stylesheet: https://github.com/Kozea/WeasyPrint/blob/main/weasyprint/css/html5_ua.css
493
513
  .. _Leaders: https://www.w3.org/TR/css-content-3/#leaders
494
514
 
495
- CSS Color Module Level 3
496
- ++++++++++++++++++++++++
515
+ CSS Color Module Level 4 / 5
516
+ ++++++++++++++++++++++++++++
497
517
 
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.
518
+ The `CSS Color Module Level 4`_ is a recommendation defining "CSS properties which allow
519
+ authors to specify the foreground color and opacity of the text content of an element".
520
+ Its main goal is to specify how colors are defined, including color keywords and many
521
+ color notations including ``#rgba``, ``rgb()``, ``hsl()``, ``hwb()``, ``lab()``, etc.
522
+ The standard ``color()`` function gives a common way to define colors giving their color
523
+ space. Opacity and alpha compositing are also defined in this document.
504
524
 
505
525
  This recommendation is fully implemented in WeasyPrint, except the deprecated
506
526
  System Colors.
507
527
 
508
- .. _CSS Color Module Level 3: https://www.w3.org/TR/css-color-3/
528
+ The `CSS Color Module Level 5`_ is a working draft adding "color modification functions,
529
+ custom color spaces (ICC profiles), ``contrast-color()``, ``light-dark()`` and
530
+ ``device-cmyk()``" to level 4.
531
+
532
+ WeasyPrint supports the ``light-dark()`` and ``device-cmyk()`` properties, and the
533
+ ``@color-profile`` at-rule.
534
+
535
+ WeasyPrint does **not** support the ``color-mix()`` and ``contrast-color()`` properties.
536
+
537
+ .. _CSS Color Module Level 4: https://www.w3.org/TR/css-color-4/
538
+ .. _CSS Color Module Level 5: https://www.w3.org/TR/css-color-5/
509
539
 
510
540
  CSS Transforms Module Level 1
511
541
  +++++++++++++++++++++++++++++
@@ -2,6 +2,286 @@ Changelog
2
2
  =========
3
3
 
4
4
 
5
+ Version 68.0
6
+ ------------
7
+
8
+ Released on 2026-01-19.
9
+
10
+ **This is a security update (CVE-2025-68616).**
11
+
12
+ We strongly recommend to upgrade WeasyPrint to the latest version if you use the
13
+ ``default_url_fetcher`` function in your custom URL fetcher, or if you use the
14
+ ``allowed_protocols`` parameter of the ``default_url_fetcher`` function.
15
+
16
+ Security:
17
+
18
+ * Always use URL fetcher for HTTP redirects
19
+
20
+ Python API:
21
+
22
+ * ``default_url_fetcher()`` is deprecated, use the new ``URLFetcher`` class instead, see
23
+ :ref:`URL Fetchers` for more information about URL fetchers
24
+ * ``DocumentMetadata.generate_rdf_metadata`` is now a method that can be overridden
25
+ instead of a parameter, see :ref:`Factur-X / ZUGFeRD (Electronic Invoices)` for
26
+ examples to create e-invoices
27
+
28
+ Features:
29
+
30
+ * `#2609 <https://github.com/Kozea/WeasyPrint/pull/2609>`_,
31
+ `#2603 <https://github.com/Kozea/WeasyPrint/issues/2603>`_,
32
+ `#351 <https://github.com/Kozea/WeasyPrint/issues/351>`_:
33
+ Refactor URL fetcher API
34
+ * `#2632 <https://github.com/Kozea/WeasyPrint/pull/2632>`_:
35
+ Support legacy 0 value for angles
36
+ * `#2627 <https://github.com/Kozea/WeasyPrint/pull/2627>`_:
37
+ Add font-face support to SVG
38
+ * `#2646 <https://github.com/Kozea/WeasyPrint/pull/2646>`_,
39
+ `#2255 <https://github.com/Kozea/WeasyPrint/issues/2255>`_:
40
+ Add font shorthand support for SVG text elements
41
+ * `#2590 <https://github.com/Kozea/WeasyPrint/pull/2590>`_,
42
+ `#1749 <https://github.com/Kozea/WeasyPrint/issues/1749>`_:
43
+ Honor language-specific rules for text-transform
44
+ * `#2645 <https://github.com/Kozea/WeasyPrint/pull/2645>`_,
45
+ `#2613 <https://github.com/Kozea/WeasyPrint/issues/2613>`_:
46
+ Improve SVG and SVG emojis rendering
47
+ * `#2658 <https://github.com/Kozea/WeasyPrint/pull/2658>`_,
48
+ `#2583 <https://github.com/Kozea/WeasyPrint/issues/2583>`_:
49
+ Add CLI for Factur-X / ZUGFeRD e-invoices
50
+
51
+ Bug fixes:
52
+
53
+ * `#2649 <https://github.com/Kozea/WeasyPrint/issues/2649>`_:
54
+ Refactor URL fetcher API
55
+ * `#2643 <https://github.com/Kozea/WeasyPrint/pull/2643>`_,
56
+ `#2628 <https://github.com/Kozea/WeasyPrint/issues/2628>`_:
57
+ Handle box-sizing: border-box in grid layout
58
+ * `#2641 <https://github.com/Kozea/WeasyPrint/pull/2641>`_,
59
+ `#1875 <https://github.com/Kozea/WeasyPrint/issues/1875>`_:
60
+ Process whitespace after checking all pending targets
61
+ * `#2488 <https://github.com/Kozea/WeasyPrint/pull/2488>`_,
62
+ `#2485 <https://github.com/Kozea/WeasyPrint/issues/2485>`_:
63
+ Preserve page groups during layout repagination
64
+ * `#2642 <https://github.com/Kozea/WeasyPrint/pull/2642>`_,
65
+ `#2631 <https://github.com/Kozea/WeasyPrint/issues/2631>`_:
66
+ Don’t use isolated transparency groups
67
+ * `#2637 <https://github.com/Kozea/WeasyPrint/issues/2637>`_:
68
+ Fix repeating radial gradients rendering
69
+ * `#2622 <https://github.com/Kozea/WeasyPrint/issues/2622>`_:
70
+ Fix validation of colors
71
+ * `#2626 <https://github.com/Kozea/WeasyPrint/issues/2626>`_:
72
+ Share grid items rendering advancement between a box and its copies
73
+ * `#2621 <https://github.com/Kozea/WeasyPrint/issues/2621>`_:
74
+ Correctly handle fallback values of attr()
75
+ * `#2619 <https://github.com/Kozea/WeasyPrint/issues/2619>`_:
76
+ Fix SVG fonts
77
+ * `#2629 <https://github.com/Kozea/WeasyPrint/issues/2629>`_:
78
+ Always define extra skip height that may be used after
79
+ * `#2648 <https://github.com/Kozea/WeasyPrint/issues/2648>`_:
80
+ Fix numbers validation in font-feature-settings
81
+ * `#2648 <https://github.com/Kozea/WeasyPrint/issues/2660>`_:
82
+ Fix keyword values for text-decoration-thickness
83
+ * `#2661 <https://github.com/Kozea/WeasyPrint/issues/2661>`_:
84
+ Respect inline images when defining minimum table width
85
+
86
+ Documentation:
87
+
88
+ * `#2638 <https://github.com/Kozea/WeasyPrint/pull/2638>`_:
89
+ Update Python command for Windows installation steps
90
+
91
+ Contributors:
92
+
93
+ * Guillaume Ayoub
94
+ * Jurriaan Pruis
95
+ * Mohamed Hamed
96
+ * Alexandra Usatenko
97
+ * Andrea Corna
98
+ * Aoishik Khan
99
+ * Joe
100
+
101
+ Backers and sponsors:
102
+
103
+ * Spacinov
104
+ * Syslifters
105
+ * Kobalt
106
+ * Simon Sapin
107
+ * Grip Angebotssoftware
108
+ * Manuel Barkhau
109
+ * Simonsoft
110
+ * KontextWork
111
+ * Menutech
112
+ * TrainingSparkle
113
+ * Healthchecks.io
114
+ * Method B
115
+ * FieldHub
116
+ * Hammerbacher
117
+ * Yanal-Yves Fargialla
118
+ * Morntag
119
+ * Piloterr
120
+ * Xavid
121
+ * Charlie S.
122
+ * Prothesis Dental Solutions
123
+ * Kai DeLorenzo
124
+
125
+
126
+ Version 67.0
127
+ ------------
128
+
129
+ Released on 2025-12-02.
130
+
131
+ Dependencies:
132
+
133
+ * Python 3.10+ is now needed, Python 3.9 is not supported anymore
134
+ * tinycss2 1.5.0+ is now needed
135
+ * fontTools 4.59.2+ is now needed
136
+
137
+ Features:
138
+
139
+ * `#2560 <https://github.com/Kozea/WeasyPrint/pull/2560>`_,
140
+ `#640 <https://github.com/Kozea/WeasyPrint/issues/640>`_,
141
+ `#844 <https://github.com/Kozea/WeasyPrint/issues/844>`_,
142
+ `#1091 <https://github.com/Kozea/WeasyPrint/issues/1091>`_,
143
+ `#2517 <https://github.com/Kozea/WeasyPrint/issues/2517>`_:
144
+ Support CMYK colors, PDF/X, color profiles and light-dark() function
145
+ * `#2558 <https://github.com/Kozea/WeasyPrint/pull/2558>`_,
146
+ `#1175 <https://github.com/Kozea/WeasyPrint/issues/1175>`_:
147
+ Support ::first-line, with financial support from Karte Technology
148
+ * `#2552 <https://github.com/Kozea/WeasyPrint/pull/2552>`_:
149
+ Support CSS layers, with financial support from Code & Co.
150
+ * `#2564 <https://github.com/Kozea/WeasyPrint/pull/2564>`_,
151
+ `#2599 <https://github.com/Kozea/WeasyPrint/pull/2599>`_,
152
+ `#2397 <https://github.com/Kozea/WeasyPrint/issues/2397>`_:
153
+ Allow page breaks in grid rows, with financial support from Ocean Recap
154
+ * `#2568 <https://github.com/Kozea/WeasyPrint/pull/2568>`_,
155
+ `#357 <https://github.com/Kozea/WeasyPrint/issues/357>`_:
156
+ Support calc() and other mathematical functions
157
+ * `#2575 <https://github.com/Kozea/WeasyPrint/pull/2575>`_,
158
+ `#2574 <https://github.com/Kozea/WeasyPrint/issues/2574>`_:
159
+ Support PDF/A-1a, PDF/A-2a and PDF/A-3a
160
+ * `#2611 <https://github.com/Kozea/WeasyPrint/pull/2611>`_,
161
+ `#2573 <https://github.com/Kozea/WeasyPrint/issues/2573>`_:
162
+ Support PDF/A-4e and PDF/A-4f
163
+ * `#2523 <https://github.com/Kozea/WeasyPrint/pull/2523>`_:
164
+ Display tofu for missing glyphs
165
+ * `#2581 <https://github.com/Kozea/WeasyPrint/pull/2581>`_:
166
+ Add option to disable protocols in URL resolution
167
+ * `#2570 <https://github.com/Kozea/WeasyPrint/pull/2570>`_:
168
+ Support rch, cap, rcap, rex, ic and ric font-relative units
169
+ * `#2547 <https://github.com/Kozea/WeasyPrint/pull/2547>`_,
170
+ `#2140 <https://github.com/Kozea/WeasyPrint/issues/2140>`_:
171
+ Support "only" keyword in media queries
172
+
173
+ Bug fixes:
174
+
175
+ * `#2516 <https://github.com/Kozea/WeasyPrint/pull/2516>`_,
176
+ `#1510 <https://github.com/Kozea/WeasyPrint/issues/1510>`_:
177
+ Fix rendering of first line of text with nested right float
178
+ * `#2510 <https://github.com/Kozea/WeasyPrint/pull/2510>`_,
179
+ `#1073 <https://github.com/Kozea/WeasyPrint/issues/1073>`_,
180
+ `#2507 <https://github.com/Kozea/WeasyPrint/issues/2507>`_:
181
+ Avoid Pango crashes and font mismatches with @font-face rules referencing local fonts
182
+ * `#2532 <https://github.com/Kozea/WeasyPrint/pull/2532>`_,
183
+ `#2531 <https://github.com/Kozea/WeasyPrint/issues/2531>`_:
184
+ Use fonttools instancer instead of deprecated mutator API
185
+ * `#2541 <https://github.com/Kozea/WeasyPrint/pull/2541>`_:
186
+ Fix syntax of functions
187
+ * `#2543 <https://github.com/Kozea/WeasyPrint/pull/2543>`_:
188
+ Allow font-related units to access @font-face fonts
189
+ * `#2525 <https://github.com/Kozea/WeasyPrint/pull/2525>`_:
190
+ Respect top margins and avoid overlapping footnotes for columns, with financial support from Code & Co.
191
+ * `#2536 <https://github.com/Kozea/WeasyPrint/pull/2536>`_:
192
+ Remove Subtype key from font descriptor
193
+ * `#2539 <https://github.com/Kozea/WeasyPrint/pull/2539>`_:
194
+ Fix min width for SVGs with intrinsic ratio but no intrinsic size
195
+ * `#2537 <https://github.com/Kozea/WeasyPrint/pull/2537>`_,
196
+ `#2533 <https://github.com/Kozea/WeasyPrint/issues/2533>`_:
197
+ Fix order of operators when drawing SVGs
198
+ * `#2538 <https://github.com/Kozea/WeasyPrint/pull/2538>`_:
199
+ Don’t crash with nested unknown functions
200
+ * `#2542 <https://github.com/Kozea/WeasyPrint/pull/2542>`_:
201
+ Don’t crash when lh and rlh are used for line height or font size
202
+ * `#2540 <https://github.com/Kozea/WeasyPrint/pull/2540>`_,
203
+ `#2528 <https://github.com/Kozea/WeasyPrint/issues/2528>`_:
204
+ Use locale encoding instead of filesystem encoding for font paths
205
+ * `#2563 <https://github.com/Kozea/WeasyPrint/pull/2563>`_,
206
+ `#2479 <https://github.com/Kozea/WeasyPrint/issues/2479>`_:
207
+ Don’t avoid float collisions for atomic flex items
208
+ * `#2569 <https://github.com/Kozea/WeasyPrint/pull/2569>`_:
209
+ Don’t be case-sensitive for units
210
+ * `#2567 <https://github.com/Kozea/WeasyPrint/pull/2567>`_,
211
+ `#2566 <https://github.com/Kozea/WeasyPrint/issues/2566>`_:
212
+ Add x-default attribute for metadata description to be compliant with PDF/A
213
+ * `#2586 <https://github.com/Kozea/WeasyPrint/pull/2586>`_,
214
+ `#2571 <https://github.com/Kozea/WeasyPrint/issues/2571>`_:
215
+ Improve formatting contexts management
216
+ * `#2600 <https://github.com/Kozea/WeasyPrint/pull/2600>`_:
217
+ Fix SVG image aspect ratio when only width or height is specified
218
+ * `#2612 <https://github.com/Kozea/WeasyPrint/pull/2612>`_,
219
+ `#2595 <https://github.com/Kozea/WeasyPrint/pull/2595>`_:
220
+ Clean block layout and fix corner cases
221
+ * `#2522 <https://github.com/Kozea/WeasyPrint/issues/2522>`_:
222
+ Ignore preserveAspectRatio when SVG has no viewBox
223
+ * `#2544 <https://github.com/Kozea/WeasyPrint/issues/2544>`_:
224
+ Allow to use a variable twice in a function
225
+ * `#2555 <https://github.com/Kozea/WeasyPrint/issues/2555>`_:
226
+ Fix flex gap in right-to-left context
227
+ * `#2591 <https://github.com/Kozea/WeasyPrint/issues/2591>`_:
228
+ Respect non-auto widths and fix padding of grid items
229
+ * `#2601 <https://github.com/Kozea/WeasyPrint/issues/2601>`_:
230
+ Don’t crash when tagged tables are not displayed as tables
231
+ * `#2607 <https://github.com/Kozea/WeasyPrint/issues/2607>`_:
232
+ Fix rendering of multiline textareas with PDF forms
233
+ * `#2106 <https://github.com/Kozea/WeasyPrint/issues/2106>`_:
234
+ Force variable initialization to avoid crashes during column layout
235
+ * `#2618 <https://github.com/Kozea/WeasyPrint/pull/2618>`_,
236
+ `#2617 <https://github.com/Kozea/WeasyPrint/issues/2617>`_:
237
+ Fix rendering of relative grid and flex items
238
+
239
+ Documentation:
240
+
241
+ * `#2535 <https://github.com/Kozea/WeasyPrint/pull/2535>`_:
242
+ `#2534 <https://github.com/Kozea/WeasyPrint/issues/2534>`_:
243
+ Removed reference to defunct site
244
+
245
+ Contributors:
246
+
247
+ * Guillaume Ayoub
248
+ * Fazle Rabbi Ferdaus
249
+ * Lucie Anglade
250
+ * Luca Vercelli
251
+ * ChickenF622
252
+ * Ernie Chu
253
+ * Mark Pullin
254
+ * Malte Laukötter
255
+ * Markus Mohanty
256
+ * Yvonne Kothmeier
257
+ * Jarom Ort
258
+ * kuypan
259
+
260
+ Backers and sponsors:
261
+
262
+ * Spacinov
263
+ * Syslifters
264
+ * Kobalt
265
+ * Simon Sapin
266
+ * Grip Angebotssoftware
267
+ * Manuel Barkhau
268
+ * Simonsoft
269
+ * KontextWork
270
+ * Menutech
271
+ * TrainingSparkle
272
+ * Healthchecks.io
273
+ * Method B
274
+ * FieldHub
275
+ * Hammerbacher
276
+ * Yanal-Yves Fargialla
277
+ * Morntag
278
+ * Piloterr
279
+ * Xavid
280
+ * Charlie S.
281
+ * Prothesis Dental Solutions
282
+ * Kai DeLorenzo
283
+
284
+
5
285
  Version 66.0
6
286
  ------------
7
287