Closed rgreinho closed 5 months ago
I mean the font you are seeing is in fact the same as in the reference picture (Dharma Gothic E), the only problem seems to be that for some reason it chooses the italic version of the font instead of the regular one. I can reproduce this on my system if I add the italic font to my system fonts as well, but if I only add the regular one I get the same result as in the reference picture. Not sure what is happening here, will try to investigate.
True, in this case it is the same font in italic, but in the flyer it is a completely different one:
It renders like this:
While it should be like that:
I have the same issue on Ubuntu 22.04.3 LTS. The font is installed correctly:
But the generated pdf renders the text that is supposed to be Dharma Gothic E with a different font. Also, the pdf's properties only show the following fonts being used:
But I guess I should see one more font listed (the one used to render "Canberra", the numbers, etc.).
In case that helps to remove potential setup problems, the python tool cairosvg, converts the svg file to PDF with the right fonts.
We probably should add some kind of command that shows all of the fonts that svg2pdf
can find.
We probably should add some kind of command that shows all of the fonts that
svg2pdf
can find.
I took a quick stab at it. PR #45 takes care of it.
@LaurenzV Now that #45 got merged, how can we proceed to work on this issue? What type of info or help would you need from me?
You could probably try to render your SVG using resvg (which is the underlying library we use for conversion, including for the text). If doesn't work correctly there either, it's probably an upstream issue. If it works there but not with svg2pdf
, then I'll try to investigate what we're doing wrong.
@LaurenzV I did find out that the problem was happening with ReSVG too, so I reported the issue upstream as well: https://github.com/RazrFalcon/resvg/issues/702
This has already been fixed upstream IIRC. And I also created a new issue for font fallback (#65), so I'm closing this.
I have an SVG flyer which uses the "Dharma Gothic E" font. This font is installed correctly on my system (see screenshot):
However when I attempt a conversion with
svg2pdf
it falls back to another font.Reproducible example
I just created a simple SVG using Inkscape. It renders correctly in the browser:
but not the PDF:
Here is the code of the SVG:
I also tried doing it as code, basically copy/pasting the code from the CLI, and then the text does not appear in the converted PDF.
But if I iterate through the fonts, I do see all my Dharma variants, like for instance:
I did try with another font (Montserrat which is very common), and everything worked fine.
Is there something else I need to do to make it work? Do some fonts require some specific parameters or a special treatment?