fullbleed 2.5.4__tar.gz → 2.5.5__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 (237) hide show
  1. {fullbleed-2.5.4 → fullbleed-2.5.5}/Cargo.lock +1 -1
  2. {fullbleed-2.5.4 → fullbleed-2.5.5}/Cargo.toml +1 -1
  3. {fullbleed-2.5.4 → fullbleed-2.5.5}/PKG-INFO +6 -3
  4. {fullbleed-2.5.4 → fullbleed-2.5.5}/README.md +5 -2
  5. {fullbleed-2.5.4 → fullbleed-2.5.5}/fullbleed-agent-contract.json +1 -1
  6. {fullbleed-2.5.4 → fullbleed-2.5.5}/llms.txt +1 -1
  7. {fullbleed-2.5.4 → fullbleed-2.5.5}/pyproject.toml +1 -1
  8. fullbleed-2.5.5/src/pdf_raster/forms.rs +228 -0
  9. fullbleed-2.5.5/src/pdf_raster/shading/radial_bands.rs +186 -0
  10. fullbleed-2.5.5/src/pdf_raster/shading/tests.rs +318 -0
  11. fullbleed-2.5.5/src/pdf_raster/shading.rs +578 -0
  12. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_raster.rs +97 -17
  13. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/raster.rs +57 -16
  14. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/raster_native.rs +96 -1
  15. {fullbleed-2.5.4 → fullbleed-2.5.5}/COPYRIGHT +0 -0
  16. {fullbleed-2.5.4 → fullbleed-2.5.5}/FONT_LICENSE_AUDIT.json +0 -0
  17. {fullbleed-2.5.4 → fullbleed-2.5.5}/FONT_LICENSE_AUDIT.md +0 -0
  18. {fullbleed-2.5.4 → fullbleed-2.5.5}/LICENSE +0 -0
  19. {fullbleed-2.5.4 → fullbleed-2.5.5}/LICENSING.md +0 -0
  20. {fullbleed-2.5.4 → fullbleed-2.5.5}/THIRD_PARTY_LICENSES.md +0 -0
  21. {fullbleed-2.5.4 → fullbleed-2.5.5}/build.rs +0 -0
  22. {fullbleed-2.5.4 → fullbleed-2.5.5}/build_backend/fullbleed_build_backend.py +0 -0
  23. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/Cargo.lock +0 -0
  24. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/Cargo.toml +0 -0
  25. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/LICENSE +0 -0
  26. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/README.md +0 -0
  27. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/specs/fullbleed.audit_registry.v1.yaml +0 -0
  28. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/specs/section508_html_registry.v1.yaml +0 -0
  29. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/specs/wcag20aa_registry.v1.yaml +0 -0
  30. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/src/json.rs +0 -0
  31. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/src/lib.rs +0 -0
  32. {fullbleed-2.5.4 → fullbleed-2.5.5}/crates/fullbleed_audit_contract/src/sha256.rs +0 -0
  33. {fullbleed-2.5.4 → fullbleed-2.5.5}/docs/specs/fullbleed.a11y.verify.v1.schema.json +0 -0
  34. {fullbleed-2.5.4 → fullbleed-2.5.5}/docs/specs/fullbleed.audit_registry.v1.yaml +0 -0
  35. {fullbleed-2.5.4 → fullbleed-2.5.5}/docs/specs/fullbleed.pmr.v1.schema.json +0 -0
  36. {fullbleed-2.5.4 → fullbleed-2.5.5}/docs/specs/section508_html_registry.v1.yaml +0 -0
  37. {fullbleed-2.5.4 → fullbleed-2.5.5}/docs/specs/wcag20aa_registry.v1.yaml +0 -0
  38. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/__init__.py +0 -0
  39. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/__main__.py +0 -0
  40. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/_abi.py +0 -0
  41. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/accessibility/__init__.py +0 -0
  42. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/accessibility/engine.py +0 -0
  43. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/accessibility/runtime.py +0 -0
  44. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/accessibility/types.py +0 -0
  45. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/audit_prototype.py +0 -0
  46. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/audit_section508.py +0 -0
  47. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/audit_wcag.py +0 -0
  48. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/__init__.py +0 -0
  49. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/accessibility.py +0 -0
  50. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/__init__.py +0 -0
  51. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/_core.py +0 -0
  52. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/agency_letter.py +0 -0
  53. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/court_motion_form.py +0 -0
  54. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/declaration_form.py +0 -0
  55. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/instruction_sheet.py +0 -0
  56. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/investment_portfolio_report.py +0 -0
  57. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/marriage_record.py +0 -0
  58. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/profiles.py +0 -0
  59. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/recorded_plat.py +0 -0
  60. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/redaction_request_form.py +0 -0
  61. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/cav/warranty_deed.py +0 -0
  62. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/core.py +0 -0
  63. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/primitives.py +0 -0
  64. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed/ui/style.py +0 -0
  65. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/__init__.py +0 -0
  66. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/bootstrap.min.css +0 -0
  67. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/fonts/Inter-Variable.ttf +0 -0
  68. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/fonts/NotoSans-Regular.ttf +0 -0
  69. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/fonts/NotoSansMath-Regular.ttf +0 -0
  70. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/fonts/NotoSansSymbols-Regular.ttf +0 -0
  71. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/fonts/NotoSansSymbols2-Regular.ttf +0 -0
  72. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_assets/icons/bootstrap-icons.svg +0 -0
  73. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/__init__.py +0 -0
  74. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/__main__.py +0 -0
  75. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/agent.py +0 -0
  76. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/agent_acceptance.py +0 -0
  77. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/agent_contract.py +0 -0
  78. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/assets.py +0 -0
  79. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/cache.py +0 -0
  80. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/cli.py +0 -0
  81. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/finalize.py +0 -0
  82. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/mcp.py +0 -0
  83. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold.py +0 -0
  84. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/__init__.py +0 -0
  85. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/.gitignore +0 -0
  86. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/AGENTS.md +0 -0
  87. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/COMPLIANCE.md +0 -0
  88. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/SCAFFOLDING.md +0 -0
  89. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/__init__.py +0 -0
  90. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/body.py +0 -0
  91. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/fb_ui.py +0 -0
  92. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/footer.py +0 -0
  93. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/header.py +0 -0
  94. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/primitives.py +0 -0
  95. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/styles/body.css +0 -0
  96. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/styles/footer.css +0 -0
  97. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/styles/header.css +0 -0
  98. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/components/styles/primitives.css +0 -0
  99. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/report.py +0 -0
  100. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/styles/report.css +0 -0
  101. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/init/styles/tokens.css +0 -0
  102. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/README.md +0 -0
  103. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/output/.gitignore +0 -0
  104. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/output/.gitkeep +0 -0
  105. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/report.py +0 -0
  106. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/styles/report.css +0 -0
  107. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/accessible/vendor/fonts/Inter-Variable.ttf +0 -0
  108. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/invoice/output/.gitignore +0 -0
  109. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/invoice/output/.gitkeep +0 -0
  110. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/invoice/report.py +0 -0
  111. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/invoice/templates/invoice.css +0 -0
  112. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/invoice/templates/invoice.html +0 -0
  113. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/COMPLIANCE.md +0 -0
  114. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/README.md +0 -0
  115. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/SCAFFOLDING.md +0 -0
  116. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/assets/brand-mark.svg +0 -0
  117. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/assets/reference-pattern.svg +0 -0
  118. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/__init__.py +0 -0
  119. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/appendix.py +0 -0
  120. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/architecture.py +0 -0
  121. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/cover.py +0 -0
  122. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/data_pages.py +0 -0
  123. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/fb_ui.py +0 -0
  124. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/primitives.py +0 -0
  125. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/appendix.css +0 -0
  126. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/architecture.css +0 -0
  127. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/cover.css +0 -0
  128. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/data.css +0 -0
  129. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/primitives.css +0 -0
  130. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/styles/visuals.css +0 -0
  131. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/components/visuals.py +0 -0
  132. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/data/reference.json +0 -0
  133. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/output/.gitignore +0 -0
  134. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/report.py +0 -0
  135. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/styles/report.css +0 -0
  136. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/reference/styles/tokens.css +0 -0
  137. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/statement/output/.gitignore +0 -0
  138. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/statement/output/.gitkeep +0 -0
  139. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/statement/report.py +0 -0
  140. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/statement/templates/statement.css +0 -0
  141. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/scaffold_templates/new/statement/templates/statement.html +0 -0
  142. {fullbleed-2.5.4 → fullbleed-2.5.5}/python/fullbleed_cli/watch.py +0 -0
  143. {fullbleed-2.5.4 → fullbleed-2.5.5}/skills/fullbleed/SKILL.md +0 -0
  144. {fullbleed-2.5.4 → fullbleed-2.5.5}/skills/fullbleed/agents/openai.yaml +0 -0
  145. {fullbleed-2.5.4 → fullbleed-2.5.5}/skills/fullbleed/references/compliance.md +0 -0
  146. {fullbleed-2.5.4 → fullbleed-2.5.5}/skills/fullbleed/references/selection.md +0 -0
  147. {fullbleed-2.5.4 → fullbleed-2.5.5}/skills/fullbleed/references/workflows.md +0 -0
  148. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/assets.rs +0 -0
  149. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/authoring.rs +0 -0
  150. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/base14_metrics.rs +0 -0
  151. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/base14_metrics_data.rs +0 -0
  152. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/base64.rs +0 -0
  153. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/canvas.rs +0 -0
  154. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/chart.rs +0 -0
  155. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/chart_document.rs +0 -0
  156. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/css_native.rs +0 -0
  157. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/css_queries.rs +0 -0
  158. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/debug.rs +0 -0
  159. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/doc_context.rs +0 -0
  160. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/doc_template.rs +0 -0
  161. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/document_metadata.rs +0 -0
  162. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/error.rs +0 -0
  163. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/finalize.rs +0 -0
  164. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/flate_native.rs +0 -0
  165. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/flowable.rs +0 -0
  166. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/font.rs +0 -0
  167. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/font_subset.rs +0 -0
  168. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/frame.rs +0 -0
  169. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/glyph_report.rs +0 -0
  170. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html.rs +0 -0
  171. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_dom.rs +0 -0
  172. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities.rs +0 -0
  173. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_0.rs +0 -0
  174. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_1.rs +0 -0
  175. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_2.rs +0 -0
  176. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_3.rs +0 -0
  177. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_4.rs +0 -0
  178. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/html_entities_5.rs +0 -0
  179. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/icc.rs +0 -0
  180. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/image_native.rs +0 -0
  181. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/jit.rs +0 -0
  182. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/jpeg_native.rs +0 -0
  183. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/lib.rs +0 -0
  184. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/math.rs +0 -0
  185. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/metrics.rs +0 -0
  186. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/native_shape.rs +0 -0
  187. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/page_data.rs +0 -0
  188. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/page_template.rs +0 -0
  189. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/parallel.rs +0 -0
  190. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf.rs +0 -0
  191. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_encodings.rs +0 -0
  192. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_identity.rs +0 -0
  193. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_native.rs +0 -0
  194. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_print_contract.rs +0 -0
  195. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_profile.rs +0 -0
  196. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_table.rs +0 -0
  197. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_vt.rs +0 -0
  198. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdf_vt_inspect.rs +0 -0
  199. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/pdfinspect.rs +0 -0
  200. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/perf.rs +0 -0
  201. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/plan.rs +0 -0
  202. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/python/abi_exports.rs +0 -0
  203. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/python/pdf_vt.rs +0 -0
  204. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/python.rs +0 -0
  205. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/python_abi.rs +0 -0
  206. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/sfnt.rs +0 -0
  207. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/sfnt_cff.rs +0 -0
  208. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/sfnt_outline.rs +0 -0
  209. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/spill.rs +0 -0
  210. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/style.rs +0 -0
  211. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/svg.rs +0 -0
  212. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/table_header_tests.rs +0 -0
  213. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/table_semantics.rs +0 -0
  214. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/text_shape.rs +0 -0
  215. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/types.rs +0 -0
  216. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/unicode_data.rs +0 -0
  217. {fullbleed-2.5.4 → fullbleed-2.5.5}/src/xml.rs +0 -0
  218. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Courier-Bold.afm +0 -0
  219. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Courier-BoldOblique.afm +0 -0
  220. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Courier-Oblique.afm +0 -0
  221. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Courier.afm +0 -0
  222. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Helvetica-Bold.afm +0 -0
  223. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Helvetica-BoldOblique.afm +0 -0
  224. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Helvetica-Oblique.afm +0 -0
  225. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Helvetica.afm +0 -0
  226. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/MustRead.html +0 -0
  227. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Symbol.afm +0 -0
  228. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Times-Bold.afm +0 -0
  229. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Times-BoldItalic.afm +0 -0
  230. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Times-Italic.afm +0 -0
  231. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/Times-Roman.afm +0 -0
  232. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/ZapfDingbats.afm +0 -0
  233. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/agl-LICENSE.md +0 -0
  234. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/agl-glyphlist.txt +0 -0
  235. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/agl-zapfdingbats.txt +0 -0
  236. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/data/base14/sources.json +0 -0
  237. {fullbleed-2.5.4 → fullbleed-2.5.5}/tools/generate_base14_metrics.py +0 -0
@@ -4,7 +4,7 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "fullbleed"
7
- version = "2.5.4"
7
+ version = "2.5.5"
8
8
  dependencies = [
9
9
  "fullbleed_audit_contract",
10
10
  "subsetter",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fullbleed"
3
- version = "2.5.4"
3
+ version = "2.5.5"
4
4
  edition = "2024"
5
5
  rust-version = "1.85"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fullbleed
3
- Version: 2.5.4
3
+ Version: 2.5.5
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: License :: OSI Approved :: MIT License
6
6
  Classifier: Operating System :: MacOS
@@ -81,7 +81,9 @@ Path("invoice.pdf").write_bytes(pdf)
81
81
 
82
82
  Open `invoice.pdf`. The [quickstart](https://docs.fullbleed.dev/getting-started/quickstart/) adds fonts, previews, and a complete project. The runnable source is in [`examples/quickstart/hello.py`](examples/quickstart/hello.py).
83
83
 
84
- **Using Rust?** Start with the [native Rust quickstart](https://docs.fullbleed.dev/getting-started/rust/). The [`fullbleed` crate](https://crates.io/crates/fullbleed) exposes `FullBleed::builder()` and `render_to_buffer(...)`, with no Python requirement. The guide includes runnable invoice and report examples with explicit fonts and PNG previews, plus the [Rust API reference](https://docs.rs/fullbleed/2.5.0/fullbleed/).
84
+ **Using Rust?** Start with the [native Rust quickstart](https://docs.fullbleed.dev/getting-started/rust/). The [`fullbleed` crate](https://crates.io/crates/fullbleed) exposes `FullBleed::builder()` and `render_to_buffer(...)`, with no Python requirement. The guide includes runnable invoice and report examples with explicit fonts and PNG previews, plus the [Rust API reference](https://docs.rs/fullbleed/2.5.5/fullbleed/).
85
+
86
+ **Using Node.js?** The [Node.js quickstart](https://docs.fullbleed.dev/getting-started/node/) includes a downloadable designed invoice project. The separate [Node package](https://github.com/fullbleed-engine/fullbleed-node) bundles the engine as WebAssembly and includes fonts, ESM/CommonJS support, TypeScript declarations, and PNG previews. It requires Node 22+ and covers ordinary PDF generation.
85
87
 
86
88
  ## Choose your starting point
87
89
 
@@ -89,6 +91,7 @@ Open `invoice.pdf`. The [quickstart](https://docs.fullbleed.dev/getting-started/
89
91
  | --- | --- |
90
92
  | Distinctive invoices, reports, notices, and statements | [Designed showcase with fonts and source](examples/design_showcase) |
91
93
  | A native Rust application | [Rust quickstart and runnable examples](https://docs.fullbleed.dev/getting-started/rust/) |
94
+ | A Node.js or TypeScript application | [Node quickstart and designed invoice project](https://docs.fullbleed.dev/getting-started/node/) |
92
95
  | An invoice from JSON | [Complete, checked example](examples/agent_workflows) |
93
96
  | Automatic rebuilds while editing HTML/CSS (2.5.0+) | [Watch-mode invoice example](examples/render_watch) |
94
97
  | Catch PDF changes in pull requests | [Standalone project with a reviewed baseline and CI workflow](examples/pdf_regression) |
@@ -268,7 +271,7 @@ python -m pip install fullbleed
268
271
  From a local wheel:
269
272
 
270
273
  ```bash
271
- python -m pip install C:\path\to\fullbleed-2.5.4-cp310-abi3-win_amd64.whl
274
+ python -m pip install C:\path\to\fullbleed-2.5.5-cp310-abi3-win_amd64.whl
272
275
  ```
273
276
 
274
277
  From a source checkout with Rust installed, no Python build package is needed:
@@ -38,7 +38,9 @@ Path("invoice.pdf").write_bytes(pdf)
38
38
 
39
39
  Open `invoice.pdf`. The [quickstart](https://docs.fullbleed.dev/getting-started/quickstart/) adds fonts, previews, and a complete project. The runnable source is in [`examples/quickstart/hello.py`](examples/quickstart/hello.py).
40
40
 
41
- **Using Rust?** Start with the [native Rust quickstart](https://docs.fullbleed.dev/getting-started/rust/). The [`fullbleed` crate](https://crates.io/crates/fullbleed) exposes `FullBleed::builder()` and `render_to_buffer(...)`, with no Python requirement. The guide includes runnable invoice and report examples with explicit fonts and PNG previews, plus the [Rust API reference](https://docs.rs/fullbleed/2.5.0/fullbleed/).
41
+ **Using Rust?** Start with the [native Rust quickstart](https://docs.fullbleed.dev/getting-started/rust/). The [`fullbleed` crate](https://crates.io/crates/fullbleed) exposes `FullBleed::builder()` and `render_to_buffer(...)`, with no Python requirement. The guide includes runnable invoice and report examples with explicit fonts and PNG previews, plus the [Rust API reference](https://docs.rs/fullbleed/2.5.5/fullbleed/).
42
+
43
+ **Using Node.js?** The [Node.js quickstart](https://docs.fullbleed.dev/getting-started/node/) includes a downloadable designed invoice project. The separate [Node package](https://github.com/fullbleed-engine/fullbleed-node) bundles the engine as WebAssembly and includes fonts, ESM/CommonJS support, TypeScript declarations, and PNG previews. It requires Node 22+ and covers ordinary PDF generation.
42
44
 
43
45
  ## Choose your starting point
44
46
 
@@ -46,6 +48,7 @@ Open `invoice.pdf`. The [quickstart](https://docs.fullbleed.dev/getting-started/
46
48
  | --- | --- |
47
49
  | Distinctive invoices, reports, notices, and statements | [Designed showcase with fonts and source](examples/design_showcase) |
48
50
  | A native Rust application | [Rust quickstart and runnable examples](https://docs.fullbleed.dev/getting-started/rust/) |
51
+ | A Node.js or TypeScript application | [Node quickstart and designed invoice project](https://docs.fullbleed.dev/getting-started/node/) |
49
52
  | An invoice from JSON | [Complete, checked example](examples/agent_workflows) |
50
53
  | Automatic rebuilds while editing HTML/CSS (2.5.0+) | [Watch-mode invoice example](examples/render_watch) |
51
54
  | Catch PDF changes in pull requests | [Standalone project with a reviewed baseline and CI workflow](examples/pdf_regression) |
@@ -225,7 +228,7 @@ python -m pip install fullbleed
225
228
  From a local wheel:
226
229
 
227
230
  ```bash
228
- python -m pip install C:\path\to\fullbleed-2.5.4-cp310-abi3-win_amd64.whl
231
+ python -m pip install C:\path\to\fullbleed-2.5.5-cp310-abi3-win_amd64.whl
229
232
  ```
230
233
 
231
234
  From a source checkout with Rust installed, no Python build package is needed:
@@ -4207,7 +4207,7 @@
4207
4207
  "license": "MIT",
4208
4208
  "name": "Fullbleed PDF Engine",
4209
4209
  "python_package": "fullbleed",
4210
- "version": "2.5.4"
4210
+ "version": "2.5.5"
4211
4211
  },
4212
4212
  "profiles": {
4213
4213
  "pdf": {
@@ -1,6 +1,6 @@
1
1
  # Fullbleed PDF Engine
2
2
 
3
- > Fullbleed 2.5.4 is a deterministic, self-contained document-generation runtime for Python and Rust. It turns structured data plus static HTML/CSS into validated PDF documents without a browser.
3
+ > Fullbleed 2.5.5 is a deterministic, self-contained document-generation runtime for Python and Rust. It turns structured data plus static HTML/CSS into validated PDF documents without a browser.
4
4
 
5
5
  The installed runtime is authoritative. Do not infer its API from this file or from remembered release knowledge. Start with:
6
6
 
@@ -5,7 +5,7 @@ backend-path = ["build_backend"]
5
5
 
6
6
  [project]
7
7
  name = "fullbleed"
8
- version = "2.5.4"
8
+ version = "2.5.5"
9
9
  description = "Deterministic Python PDF engine for reports, invoices, accessible documents, print-ready output, and compiled VDP"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
@@ -0,0 +1,228 @@
1
+ //! PDF forms and gradient soft masks lowered to existing native form commands.
2
+ use super::*;
3
+ use crate::canvas::CompiledMaskLayer;
4
+ use crate::flowable::{MaskComposite, MaskMode};
5
+
6
+ type Result<T> = std::result::Result<T, FullBleedError>;
7
+
8
+ fn invalid(message: &str) -> FullBleedError {
9
+ FullBleedError::InvalidConfiguration(format!("pdf raster mask error: {message}"))
10
+ }
11
+
12
+ fn define_form(
13
+ form_commands: Vec<Command>,
14
+ height: f32,
15
+ cache: &mut PdfRasterCache,
16
+ commands: &mut Vec<Command>,
17
+ ) -> String {
18
+ let resource_id = format!("pdf-preview-form-{}", cache.next_form);
19
+ cache.next_form += 1;
20
+ commands.push(Command::DefineForm {
21
+ resource_id: resource_id.clone(),
22
+ width: Pt::from_f32(cache.page_width),
23
+ height: Pt::from_f32(height),
24
+ commands: form_commands,
25
+ });
26
+ resource_id
27
+ }
28
+
29
+ pub(super) fn emit_form(
30
+ form_commands: Vec<Command>,
31
+ height: f32,
32
+ cache: &mut PdfRasterCache,
33
+ commands: &mut Vec<Command>,
34
+ ) {
35
+ let resource_id = define_form(form_commands, height, cache, commands);
36
+ commands.push(Command::DrawForm {
37
+ x: Pt::ZERO,
38
+ y: Pt::ZERO,
39
+ width: Pt::from_f32(cache.page_width),
40
+ height: Pt::from_f32(height),
41
+ resource_id,
42
+ });
43
+ }
44
+
45
+ pub(super) fn clip_bbox(
46
+ doc: &LoDocument,
47
+ dict: &LoDictionary,
48
+ ctm: Matrix,
49
+ height: f32,
50
+ commands: &mut Vec<Command>,
51
+ ) -> Result<()> {
52
+ if let Ok(object) = dict.get(b"BBox") {
53
+ let bbox = shading::numbers(doc, object)?;
54
+ if bbox.len() != 4 || bbox[0] > bbox[2] || bbox[1] > bbox[3] {
55
+ return Err(invalid("invalid form BBox"));
56
+ }
57
+ for (index, (x, y)) in [
58
+ (bbox[0], bbox[1]),
59
+ (bbox[2], bbox[1]),
60
+ (bbox[2], bbox[3]),
61
+ (bbox[0], bbox[3]),
62
+ ]
63
+ .into_iter()
64
+ .enumerate()
65
+ {
66
+ let (x, y) = ctm.transform_point(x as f32, y as f32);
67
+ let (x, y) = (Pt::from_f32(x), Pt::from_f32(height - y));
68
+ commands.push(if index == 0 {
69
+ Command::MoveTo { x, y }
70
+ } else {
71
+ Command::LineTo { x, y }
72
+ });
73
+ }
74
+ commands.push(Command::ClosePath);
75
+ commands.push(Command::ClipPath { evenodd: false });
76
+ }
77
+ Ok(())
78
+ }
79
+
80
+ #[allow(clippy::too_many_arguments)]
81
+ pub(super) fn paint_shading(
82
+ doc: &LoDocument,
83
+ object: &LoObject,
84
+ resources: &PdfResources,
85
+ state: &ParseState,
86
+ height: f32,
87
+ commands: &mut Vec<Command>,
88
+ visited_forms: &mut HashSet<ObjectId>,
89
+ cache: &mut PdfRasterCache,
90
+ embedded_fonts: &mut HashMap<String, Arc<Vec<u8>>>,
91
+ ) -> Result<()> {
92
+ let mut source = Vec::new();
93
+ shading::paint(
94
+ doc,
95
+ object,
96
+ resources,
97
+ state,
98
+ cache.page_width,
99
+ height,
100
+ &mut source,
101
+ )?;
102
+ let Some((mask, ctm)) = &state.soft_mask else {
103
+ // The `sh` operator leaves the current path and painting color intact.
104
+ emit_form(source, height, cache, commands);
105
+ return Ok(());
106
+ };
107
+ let dict = resolve_dict(doc, mask)?;
108
+ let mode = match resolve_object(doc, dict.get(b"S").map_err(pdf_err)?)?
109
+ .as_name()
110
+ .map_err(pdf_err)?
111
+ {
112
+ b"Alpha" => MaskMode::Alpha,
113
+ b"Luminosity" => MaskMode::Luminance,
114
+ _ => return Err(invalid("unsupported soft-mask subtype")),
115
+ };
116
+ if let Ok(transfer) = dict.get(b"TR") {
117
+ if resolve_object(doc, transfer)?.as_name().ok() != Some(b"Identity") {
118
+ return Err(invalid(
119
+ "nonidentity soft-mask transfer functions are not supported",
120
+ ));
121
+ }
122
+ }
123
+ let group_id = dict
124
+ .get(b"G")
125
+ .map_err(pdf_err)?
126
+ .as_reference()
127
+ .map_err(pdf_err)?;
128
+ let stream = doc
129
+ .get_object(group_id)
130
+ .map_err(pdf_err)?
131
+ .as_stream()
132
+ .map_err(pdf_err)?;
133
+ let group = resolve_dict(doc, stream.dict.get(b"Group").map_err(pdf_err)?)?;
134
+ if resolve_object(doc, group.get(b"S").map_err(pdf_err)?)?
135
+ .as_name()
136
+ .ok()
137
+ != Some(b"Transparency")
138
+ {
139
+ return Err(invalid("soft mask must reference a transparency group"));
140
+ }
141
+ let mut mask_commands = vec![
142
+ Command::SetOpacity {
143
+ fill: 1.0,
144
+ stroke: 1.0,
145
+ },
146
+ Command::SetFillColor(Color::BLACK),
147
+ Command::SetStrokeColor(Color::BLACK),
148
+ ];
149
+ if mode == MaskMode::Luminance {
150
+ let space = group
151
+ .get(b"CS")
152
+ .ok()
153
+ .and_then(|value| parse_raster_color_space(doc, value));
154
+ let Some(RasterColorSpace::Direct(direct)) = space.as_ref() else {
155
+ return Err(invalid("unsupported luminosity-mask blending color space"));
156
+ };
157
+ let components = if let Ok(backdrop) = dict.get(b"BC") {
158
+ shading::numbers(doc, backdrop)?
159
+ .into_iter()
160
+ .map(|v| v as f32)
161
+ .collect::<Vec<_>>()
162
+ } else {
163
+ match direct {
164
+ RasterDirectColor::Cmyk => vec![0.0, 0.0, 0.0, 1.0],
165
+ _ => vec![0.0; direct.channels()],
166
+ }
167
+ };
168
+ if components.len() != direct.channels() {
169
+ return Err(invalid(
170
+ "backdrop components do not match the mask color space",
171
+ ));
172
+ }
173
+ let color = color_from_components_in_space(&components, space.as_ref())
174
+ .ok_or_else(|| invalid("unsupported mask backdrop"))?;
175
+ mask_commands.push(Command::SetFillColor(color));
176
+ mask_commands.extend([
177
+ Command::MoveTo {
178
+ x: Pt::ZERO,
179
+ y: Pt::ZERO,
180
+ },
181
+ Command::LineTo {
182
+ x: Pt::from_f32(cache.page_width),
183
+ y: Pt::ZERO,
184
+ },
185
+ Command::LineTo {
186
+ x: Pt::from_f32(cache.page_width),
187
+ y: Pt::from_f32(height),
188
+ },
189
+ Command::LineTo {
190
+ x: Pt::ZERO,
191
+ y: Pt::from_f32(height),
192
+ },
193
+ Command::ClosePath,
194
+ Command::Fill,
195
+ ]);
196
+ mask_commands.push(Command::SetFillColor(Color::BLACK));
197
+ }
198
+ let mask_state = ParseState {
199
+ ctm: *ctm,
200
+ ..ParseState::default()
201
+ };
202
+ parse_xobject(
203
+ doc,
204
+ group_id,
205
+ resources,
206
+ height,
207
+ &mask_state,
208
+ &mut mask_commands,
209
+ visited_forms,
210
+ cache,
211
+ embedded_fonts,
212
+ )?;
213
+ let mask_id = define_form(mask_commands, height, cache, commands);
214
+ let source_id = define_form(source, height, cache, commands);
215
+ commands.push(Command::DrawMaskedForm {
216
+ x: Pt::ZERO,
217
+ y: Pt::ZERO,
218
+ width: Pt::from_f32(cache.page_width),
219
+ height: Pt::from_f32(height),
220
+ resource_id: source_id,
221
+ layers: vec![CompiledMaskLayer {
222
+ resource_id: mask_id,
223
+ mode,
224
+ composite: MaskComposite::Add,
225
+ }],
226
+ });
227
+ Ok(())
228
+ }
@@ -0,0 +1,186 @@
1
+ //! Recognize the bounded radial-band calculator emitted by Fullbleed's writer.
2
+ //! This is intentionally not a general PostScript calculator interpreter.
3
+ use super::*;
4
+
5
+ struct Tokens<'a> {
6
+ values: Vec<&'a str>,
7
+ index: usize,
8
+ }
9
+
10
+ impl<'a> Tokens<'a> {
11
+ fn take(&mut self) -> Result<&'a str> {
12
+ let token = self
13
+ .values
14
+ .get(self.index)
15
+ .copied()
16
+ .ok_or_else(|| invalid("incomplete radial-band function"))?;
17
+ self.index += 1;
18
+ Ok(token)
19
+ }
20
+ fn expect(&mut self, expected: &str) -> Result<()> {
21
+ if self.take()? != expected {
22
+ return Err(invalid("unsupported radial-band calculator program"));
23
+ }
24
+ Ok(())
25
+ }
26
+ fn number(&mut self) -> Result<f32> {
27
+ let number = self
28
+ .take()?
29
+ .parse::<f32>()
30
+ .map_err(|_| invalid("invalid radial-band number"))?;
31
+ if !number.is_finite() {
32
+ return Err(invalid("nonfinite radial-band number"));
33
+ }
34
+ Ok(number)
35
+ }
36
+ fn color(&mut self, space: RasterDirectColor) -> Result<Color> {
37
+ self.expect("pop")?;
38
+ let components = (0..space.channels())
39
+ .map(|_| self.number())
40
+ .collect::<Result<Vec<_>>>()?;
41
+ color_from_components_in_space(&components, Some(&RasterColorSpace::Direct(space)))
42
+ .ok_or_else(|| invalid("unsupported radial-band color"))
43
+ }
44
+ }
45
+
46
+ pub(super) fn paint(
47
+ doc: &LoDocument,
48
+ dict: &LoDictionary,
49
+ space: RasterDirectColor,
50
+ state: &ParseState,
51
+ height: f32,
52
+ commands: &mut Vec<Command>,
53
+ ) -> Result<()> {
54
+ let function = resolve_object(doc, dict.get(b"Function").map_err(pdf_err)?)?
55
+ .as_stream()
56
+ .map_err(|_| invalid("unsupported function-based shading"))?;
57
+ if resolve_object(doc, function.dict.get(b"FunctionType").map_err(pdf_err)?)?
58
+ .as_i64()
59
+ .ok()
60
+ != Some(4)
61
+ {
62
+ return Err(invalid("unsupported function-based shading"));
63
+ }
64
+ let domain =
65
+ optional_numbers(doc, dict, b"Domain")?.unwrap_or_else(|| vec![0.0, 1.0, 0.0, 1.0]);
66
+ if domain.len() != 4
67
+ || domain[0] >= domain[1]
68
+ || domain[2] >= domain[3]
69
+ || numbers(doc, function.dict.get(b"Domain").map_err(pdf_err)?)? != domain
70
+ {
71
+ return Err(invalid("unsupported radial-band domain"));
72
+ }
73
+ let range = numbers(doc, function.dict.get(b"Range").map_err(pdf_err)?)?;
74
+ if range
75
+ != (0..space.channels())
76
+ .flat_map(|_| [0.0, 1.0])
77
+ .collect::<Vec<_>>()
78
+ {
79
+ return Err(invalid("unsupported radial-band range"));
80
+ }
81
+ let bytes = function.get_plain_content().map_err(pdf_err)?;
82
+ if bytes.len() > 1_048_576 {
83
+ return Err(invalid("radial-band program exceeds the gradient limit"));
84
+ }
85
+ let program =
86
+ std::str::from_utf8(&bytes).map_err(|_| invalid("invalid radial-band program encoding"))?;
87
+ let spaced = program.replace('{', " { ").replace('}', " } ");
88
+ let mut tokens = Tokens {
89
+ values: spaced.split_whitespace().collect(),
90
+ index: 0,
91
+ };
92
+ for word in ["{", "dup", "mul", "exch", "dup", "mul", "add", "sqrt"] {
93
+ tokens.expect(word)?;
94
+ }
95
+ let mut stops = Vec::new();
96
+ let mut start = 0.0;
97
+ let mut levels = 0;
98
+ while tokens.values.get(tokens.index) == Some(&"dup") {
99
+ tokens.expect("dup")?;
100
+ let end = tokens.number()?;
101
+ if end < start || end > 1.0 || levels >= MAX_FUNCTIONS {
102
+ return Err(invalid("invalid radial-band boundary"));
103
+ }
104
+ for word in ["le", "{"] {
105
+ tokens.expect(word)?;
106
+ }
107
+ let color = tokens.color(space)?;
108
+ stops.extend([
109
+ ShadingStop {
110
+ offset: start,
111
+ color,
112
+ alpha: 1.0,
113
+ },
114
+ ShadingStop {
115
+ offset: end,
116
+ color,
117
+ alpha: 1.0,
118
+ },
119
+ ]);
120
+ for word in ["}", "{"] {
121
+ tokens.expect(word)?;
122
+ }
123
+ start = end;
124
+ levels += 1;
125
+ }
126
+ let color = tokens.color(space)?;
127
+ stops.extend([
128
+ ShadingStop {
129
+ offset: start,
130
+ color,
131
+ alpha: 1.0,
132
+ },
133
+ ShadingStop {
134
+ offset: 1.0,
135
+ color,
136
+ alpha: 1.0,
137
+ },
138
+ ]);
139
+ for _ in 0..levels {
140
+ tokens.expect("}")?;
141
+ tokens.expect("ifelse")?;
142
+ }
143
+ tokens.expect("}")?;
144
+ if tokens.index != tokens.values.len() {
145
+ return Err(invalid("unexpected radial-band program suffix"));
146
+ }
147
+ let matrix = optional_numbers(doc, dict, b"Matrix")?
148
+ .unwrap_or_else(|| vec![1.0, 0.0, 0.0, 1.0, 0.0, 0.0]);
149
+ let [a, b, c, d, e, f]: [f64; 6] = matrix
150
+ .try_into()
151
+ .map_err(|_| invalid("invalid radial-band matrix"))?;
152
+ let ctm = state.ctm.concat(Matrix::from_operands(
153
+ a as f32, b as f32, c as f32, d as f32, e as f32, f as f32,
154
+ ));
155
+ if inverse(ctm).is_none() {
156
+ return Ok(());
157
+ }
158
+ commands.push(Command::SaveState);
159
+ forms::clip_bbox(doc, dict, state.ctm, height, commands)?;
160
+ commands.push(Command::ConcatMatrix {
161
+ a: ctm.a,
162
+ b: -ctm.b,
163
+ c: -ctm.c,
164
+ d: ctm.d,
165
+ e: Pt::from_f32(ctm.e),
166
+ f: Pt::from_f32(-ctm.f),
167
+ });
168
+ commands.push(Command::ClipRect {
169
+ x: Pt::from_f32(domain[0] as f32),
170
+ y: Pt::from_f32(height - domain[3] as f32),
171
+ width: Pt::from_f32((domain[1] - domain[0]) as f32),
172
+ height: Pt::from_f32((domain[3] - domain[2]) as f32),
173
+ });
174
+ commands.push(Command::ShadingFill(Shading::Radial {
175
+ x0: 0.0,
176
+ y0: height,
177
+ r0: 0.0,
178
+ x1: 0.0,
179
+ y1: height,
180
+ r1: 1.0,
181
+ stops,
182
+ hard_stops: true,
183
+ }));
184
+ commands.push(Command::RestoreState);
185
+ Ok(())
186
+ }