You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File \"/usr/local/lib/weasyprint/.venv/lib/python3.8/site-packages/weasyprint/svg/__init__.py\", line 633, in fill_stroke\n stroke_opacity = float(node.get('stroke-opacity', 1))\nValueError: could not convert string to float: '40%'\n",
The text was updated successfully, but these errors were encountered:
liZe
changed the title
Stroke-opacity does not support percentage
Opacity does not support percentage
Oct 13, 2023
All opacity and *-opacity properties should allow percentages, in SVG and CSS, as defined in CSS Color Level 4.
Correctly handling errors in SVG is not done yet, so I’m not sure that we’ll implement a nice fallback just here. But handling percentages will definitely fix your problem.
Failure occurs in v59 of weasyprint. There is no support for percentage values, instead the print fails. I believe we should support it per https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity or if that's too hard at least have a fallback incase its not a float.
Source code
It appears like the problem might be with trying to coerce the value to a float
WeasyPrint/weasyprint/svg/__init__.py
Line 634 in ff3b417
Failure log
The text was updated successfully, but these errors were encountered: