What font does Inkscape use for "sans"?

Asked by mcstrother on 2011-05-03

Hi,

My understanding is that if you select "Sans" as your font in Inkscape, it essentially tags the text with something that says "you can render this in any font you'd like, as long as it doesn't have serifs". I've been using this option for a while, but I've decided that I like the font that Inkscape chooses to use to render Sans a lot better than the fonts used by other programs. So my questoin is: what font is that?

More detail:
This has been a problem for me because I create images and then upload them to the wikimedia commons (e.g. http://en.wikipedia.org/wiki/File:MecA_Resistance.svg ). I'd like to force Wikipedia to render the text as I see it in Inkscape.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
su_v
Solved:
2011-05-03
Last query:
2011-05-03
Last reply:
2011-05-03
Best su_v (suv-lp) said : #1

> What font does Inkscape use for "sans"?

As far as I understand, this depends on the platform Inkscape (or any SVG renderer) is running on (i.e. the font backend used by the renderer, and its system-wide & user-specific font configuration).

AFAIK, on Windows, Inkscape uses 'Arial' as generic 'Sans' font, on my OS X system it uses 'Bitstream Vera Sans', on Linux distributions it might use 'DejaVu Sans' or another sans-serif font, depending on fontconfig, its system/local/user configuration and the available (installed) fonts.

Note that web browsers may choose a different font for the generic 'Sans' (though none of the available web browsers on OS X for example handle 'Sans' (using the fallback 'Serif' instead) - they seem to only handle 'Sans-Serif' as generic font name).
Other SVG renderers such as Batik and rsvg accept 'Sans' - like Inkscape - as generic font name, and (at least on OS X) render text with different fonts depending on the fontsystem they use (Batik with support for the native ATS services chooses the system font 'Lucida Grande', whereas rsvg uses the X11/fontconfig backend and renders 'Sans' as Inkscape with 'Bitstream Vera Sans' - the same font family as returned by fontconfig with the command 'fc-match Sans').

> I'd like to force Wikipedia to render the text as I see it in Inkscape.

Do you mean how your web broswer renders the SVG file, or how the servers at Wikimedia convert the SVG to a bitmap (PNG)? The first one relies on your local font configuration (as noted above, web browsers might ignore 'Sans' and fall back to 'Serif'), the second one on the renderer, system fontconfig and available fonts on the web server where the conversion is done (afaiu wikimedia use a script based on ImageMagick and librsvg).

mcstrother (mcstrother) said : #2

Thank you! That answers my question exactly. I'm currently using Windows, and Inkscape is indeed using 'Arial' as the generic 'Sans' font.

> Do you mean how your web broswer renders the SVG file, or how the servers at Wikimedia convert the SVG to a bitmap (PNG)?

I meant the Wikimedia servers. It looks like they're using 'DejaVu Sans', which is significantly wider than Arial, which was causing my problem. Unfortunately they don't support Arial, but using the free alternative "Liberation Sans" works very nicely.

Thanks again!

mcstrother (mcstrother) said : #3

Thanks ~suv, that solved my question.