Closed stefanw closed 2 years ago
Thank you for raising your first issue! Your help to improve svglib is much appreciated!
Sounds reasonable to me. Are you able to run/test it ok with a value of 12?
Yes, with a value of 12, it works. I opened PR #317 that fixes this by introducing a DEFAULT_FONT_SIZE
variable and using it throughout the code where there was a magic 12
before. A test for em
-dimensions is in there as well.
Using
em
units inwidth
andheight
of thesvg
tag like this:leads to a
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
.Full traceback
This seems to be caused by
Svg2RlgShapeConverter.convert_length_attrs
defaulting toem_base=None
and the calling function not settingem_base
. Would falling back to a general value e.g.12
like it is done inSvg2RlgAttributeConverter.convertLength
make sense here?The idea here is that the
width
andheight
are set relative to the embedding document'sfont-size
(which is – of course – not available here).