So you’ve just downloaded an awesome poster from Spread Ubuntu and now you’re trying to edit the svg so you can provide a localised version or mash it up for your own needs.
But there’s a problem… svg files don’t store the fonts used so you’re stuck looking at an ugly ill-fitting set of font defaults in inkscape and the dozy submitter didn’t specify what fonts he used. Good news! there is a command that can get for you a list of fonts used in any svg file:
`perl -lne “foreach(/font-family:(.+);/){print $1}” < foss+creative-commons3.svg | sort | uniq` Using foss+creative-commons3.svg you can see an output like this:
10.15 Saturday Night BRK
Automatica BRK
Bitstream Vera Sans
DejaVu Sans
Fatboy Slim BLTC 2 BRK
impact
Loma
Ubuntu
Not all of these fonts have been used, since it’s easy to save a file in inkscape without using the Vacuum Defs process to clear away cruft. But you do get a nice list of all the fonts you should have to see the poster the way it was intended.
Thoughts?
Fonts can be embedded in SVG:
http://www.w3.org/TR/SVG/fonts.html#SVGFontsOverview
Hope none of the fonts specified in that SVG are non-free.
@foo: Fonts can’t be embedded using Inkscape yet, so linking to the technical specification is pointless. Something I already knew but didn’t mention because it’s not practical to mention ifs and buts and candy and nuts.
FFI: Yo mama was non-free.
You know what might also be cool? If you could add some kind of text field in the SVG listing the packages (if any) that the fonts came from. Then in Inkscape, have some packagekit integration in most software that says something like “To display this page properly, you need the following fonts installed, would you like to install them now?”. Or even if that was a toolbar option that would be nice.
But yes, that’s very nice indeed.
Hi!
First of all, thank you very much for the ‘magical’ perl one line code. I’ve tried it but it won’t work un my linux/bash box until I’ve changed it in:
perl -lne “foreach(/font-family:(.+);/){print $1}” < mapa-prezentare.svg |sort|uniq
Probably newest Inkscape files (0.48) have a slight different sintax.
Bye.
Thanks for the update, I will test and correct my blog post.