Open rocketinventor opened 1 year ago
Thank you for raising your first issue! Your help to improve svglib is much appreciated!
Also, if this is a limitation with svglib
, what type of work would be needed in order to make it work (ie. properly parse and embed the font-face) into the rlg
?
I'm not sure fonts embedded in CSS are really supported in svglib. The README says: "CSS is supported, but the range of supported attributes is still limited." @claudep is the expert here.
Typically you need to register fonts with reportlab, if you want to use them, see their docs and/or the test suite.
I can confirm that embedded font definitions is not supported by svglib.
svglib is extracting the font family names in svg files, then try to register them with Reportlab (some of that code is in https://github.com/deeplook/svglib/blob/master/svglib/fonts.py). So the path to the font file should be available on the current system. I don't see a ~simple way to workaround this for embedded fonts.
One font is used for the title, and a different, specialized font is used for "engraving" the notation.
If lilypond is an option for you, you can generate SVG output for it and throw it at svglib. It works with some minor glitch that could be worked around or fixed. I've even worked on it, but it will take me some while to find it again. Here is a (boring) example SVG and snapshot of the PDF:
Hi, I am using
svglib
in order to embed a PDF (usingrebortlab
).The code looks like this:
I have a svg with an embedded font:
When it converts to a drawing object, I get messages like so:
(as described in #284)
I know that it is possible to suppress these warnings, but that is not so helpful since the resulting PDF does not look right at all. In this case, a specialized font is needed, and it does not work otherwise.
This is what it is supposed to look like: One font is used for the title, and a different, specialized font is used for "engraving" the notation.
Is there any way to embed the font data into the
rlg
object/PDF? If there is a way to render the text to a path, that would also be helpful as an alternative route to explore.Please advise,
Thanks!