Skip to content

Commit

Permalink
Merge pull request #1756 from anikinmd/svg-rem-fix
Browse files Browse the repository at this point in the history
Fix rem font size for SVG images
  • Loading branch information
liZe committed Oct 27, 2022
2 parents 632be52 + 0de8df6 commit 3c6ac5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weasyprint/svg/utils.py
Expand Up @@ -38,6 +38,9 @@ def size(string, font_size=None, percentage_reference=None):
if string.endswith('%'):
assert percentage_reference is not None
return float(string[:-1]) * percentage_reference / 100
elif string.endswith('rem'):
assert font_size is not None
return font_size * float(string[:-3])
elif string.endswith('em'):
assert font_size is not None
return font_size * float(string[:-2])
Expand Down

0 comments on commit 3c6ac5e

Please sign in to comment.