Select font for SVG to PDF

Post questions on how to use or achieve an effect in Inkscape.
FunkyRes
Posts: 1
Joined: Thu Jun 03, 2010 11:31 am

Select font for SVG to PDF

Postby FunkyRes » Thu Jun 03, 2010 11:58 am

I'm generating SVG server side that has some text in it, intended for web browser rendering.
I don't care what font the browser uses to display the text, so my code that generates the SVG doesn't specify.

However, I now need to include one of the generated images in a tex document for use with pdflatex, and it looks like the easiest way to do that is svg->pdf and then include the pdf. Inkscape does it well. I first tried ImageMagick convert, worked but looked like it killed the vector scalability as including the output resulted in crapola.

I don't know squat about inkscape, but it was easy enough to open the SVG in inkscape and save to PDF and the results are simply awesome, I can zoom in on the image in my PDF reader and it scales to display properly, the vector graphics are intact. However, the inkscape produced PDF is bringing Adobe Caslon font into the final pdf.

I am using the Lucida Bright fonts for the tex document and would prefer to use the Lucida Bright fonts for the text in the image as it results in smaller pdf with less embedded fonts. I'm not even sure I have license to embed caslon anyway. I'm guessing it is free as I don't remember buying it and I do not install stolen fonts but I don't know. It also makes the document more consistent to use the same font family throughout.

I can't however for the life of me figure out how to tell inkscape to change the default font it uses when generating a pdf from svg.

Where is that setting?
Ubuntu karmic (9.10) on x86_64 - Inkscape 0.47 (stock ubuntu)

I'm sure the setting is somewhere simple, I just can't find it.
Thanks for suggestions.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Select font for SVG to PDF

Postby ~suv » Sun Jun 13, 2010 5:22 pm

FunkyRes wrote:However, the inkscape produced PDF is bringing Adobe Caslon font into the final pdf.
Did you at some point change the default font within Inkscape's GUI? (In the 'Text and Font' dialog, you have the possibility to explicitly set a new default font).
Inkscape 0.47 uses 'Vera Bitstream Sans' as default, and - if that font is not installed - it falls back to the generic 'Sans' font - leaving the decision which font to substitute/use to 'fontconfig' - i.e. the system font configuration. (Inkscape 0.48 will default to the generic 'Sans' and no longer look for 'Vera Bitstream Sans')

I have not tested if the same mechanism takes effect when using Inkscape on the command line for SVG->PDF conversion, but have no reason to think otherwise. So the first step I'd try in your situation is changing the default font within Inkscape to 'Lucida Bright' first and then test if the new default font is also used for text objects which do not have any font specification of their own, even when calling Inkscape without GUI to directly convert SVG to PDF.

If that fails, I'd try to figure out if somewhere on the system (outside of Inkscape) 'Adobe Caslon' is defined as default font to use and picked up by Inkscape through one of the shared libraries it uses for font handling on-canvas and for cairo-based PDF export (X11(?), fontconfig, freetype, pango, cairo, etc.).


Return to “Help with using Inkscape”