Font creation with Inkscape: Exporting groups to independent SVGs?
Hello,
I've been using Inkscape to design a font. I've used it in a few designs through the old manual-copy-and-arrange mode, but I'd like to convert it to a TTF so that it can be used normally in text.
I am aware that Inkscape can't do this, but I see that FontForge can import SVGs. I've tried it and the SVG import seems to work well.
My question is: does anyone know of an easy way to export all the glyphs from my SVG file into separate SVGs? I suppose it shouldn't be too hard to do with a Python script, but I don't think I have the skill to do it myself.
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
Thanks in advance, Denís.
-- ########################### # Denís Fernández Cabrera # # denis@...2126... # # gatonegro.ceibes.org # ###########################
Denis wrote:
I've been using Inkscape to design a font. I've used it in a few designs through the old manual-copy-and-arrange mode, but I'd like to convert it to a TTF so that it can be used normally in text.
I am aware that Inkscape can't do this, but I see that FontForge can import SVGs. I've tried it and the SVG import seems to work well.
My question is: does anyone know of an easy way to export all the glyphs from my SVG file into separate SVGs? I suppose it shouldn't be too hard to do with a Python script, but I don't think I have the skill to do it myself.
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
I'm a little late for work now, but I would love to help. It is pretty simple to write a python script that will place all the objects fitting a certain xpath expression into separate svgs. And perhaps we can make use of Ted's latest changes (they allow us to call verbs from the command line) to resize the document to fit each glyph.
Just a couple of clues for you to start thinking about.
Aaron Spike
On Wed, 28 Mar 2007, Aaron Spike wrote:
Denis wrote:
I've been using Inkscape to design a font. I've used it in a few designs through the old manual-copy-and-arrange mode, but I'd like to convert it to a TTF so that it can be used normally in text.
I am aware that Inkscape can't do this, but I see that FontForge can import SVGs. I've tried it and the SVG import seems to work well.
My question is: does anyone know of an easy way to export all the glyphs from my SVG file into separate SVGs? I suppose it shouldn't be too hard to do with a Python script, but I don't think I have the skill to do it myself.
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
I'm a little late for work now, but I would love to help. It is pretty simple to write a python script that will place all the objects fitting a certain xpath expression into separate svgs. And perhaps we can make use of Ted's latest changes (they allow us to call verbs from the command line) to resize the document to fit each glyph.
If were to adjust your working habits and you put each character/glyph on a seperate layer or group then a generic script which exported each layer or group to a seperate file could be useful to many people.
Just a thought
On Wed, Mar 28, 2007 at 11:06:34AM +0200, Denis wrote:
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
I'm not much of a font designer, but a few months back I found myself wanting to create a TTF by tracing some text on a few digital photos.
I had one SVG file. I imported a JPEG into it, traced a letter, hid the image, and then saved the SVG. I then switched to FontForge, created a new glyph, imported the SVG, and adjusted scale and position. (For the difficult letters I'd put a short line from the baseline to the x height to help with scaling, and delete it in FontForge.) After adjusting and saving the glyph, I switched back to Inkscape, deleted the letter shape, and moved onto the next letter. When I ran out of letters, I'd delete the image from the SVG and import the next one.
The only problem I had with this method was getting the kerning information to make the font look like the original, but this was probably exacerbated by the fact that the original text's kerning was awful. The end result was pretty good considering the skill level of the operator :->
Hello Daniel, Alan, Aaron, Marten et all.
I've been experimenting with Fontforge too. Turns out that it supports something called "SVG templates" for importing, which means that if you have a collection of SVGs that contain the glyphs and they are named something in the form of uni0041.svg (where the 0041 is the Unicode of the character in question), you can import them in FontForge and they will automatically replace the appropiate glyphs.
I've experimented with it this afternoon, and managed to produce the following (tarball containing SVG sources + TTF) [1]:
http://denis.ceibes.org/var/Propagaliza.tar.gz
What I did to create the font was the following:
1. Design the glyphs in Inkscape, in a single document. Grid was helpful. 2. Fuse each glyph into an individual object (Control++). 3. Save each glyph into a single file with the appropiate unicode name, making sure the glyph was of the correct dimensions. 4. Mass-import them all into FontForge witht the "Import > SVG Template" option". 5. Generate the TTF! (After adding a bit of metadata.)
I cheated in two aspects: a) I created a monospaced font, which made work much easier. It suits my design, but it won't suit all fonts. Other fonts will need manual adjustement, probably. b) Deciding which was the "correct dimensions" for both the Inkscape SVG document and the glyph within it was a matter of trial-and-error. I found out that if I exported my glyphs at the size of an A3 paper they would work just fine when imported in FontForge.
However, the process --- once figured out --- was remarkably simple. The most tedious part was having to save every single glyph with a separate file and name... If we could automate that process it would be very easy to create SVG Templates from Inkscape to import in FontForge.
So this is an idea I had about how the script could work. Please tell me if it is obviously dumb:
1. The user creates a document which consists on all the glyphs he has created grouped together with the appropiate letter (in a text object). So that the glyph for "A" would be grouped with a text object containing a single "A" letter, etc.
2. We read the document, find the groups, remove the text object and save the remaining glyph (possibly ungrouped now) as a separate SVG file named with the appropiate Unicode.
Perhaps the dimensions of the document could be taken from the source document containing all the glyphs, and the exported glyph would be placed on the bottom of the page... It may need a bit of manual tweaking afterwards.
We also need to figure out what is an "appropiate size" for glyphs to be imported in FontForge. I don't know really how this program works, so I am clueless here, and my font was a matter of trial-and-error. I suspect that other fonts will need different sizes. Or perhaps not.
Hum... I don't know if I am making any sense. The idea is simple, but I am a bit tired. Tell me what you think and we can talk more about this tomorrow.
Happy fonting! Denís.
---
[1] --- The font is called "Propagaliza Masiva", and it is an attempt of a font that is at the same time based off historic Galizan typography and the modern lettering of the constructivist and futurist posters of the first third of the XX century. The non-styled glyphs are taken from the DejaVu mono (which to my understanding is on the public domain for modification), and the font itself can be used under the Creative Common Attribution-ShareAlike license... Well, enough ranting.
Daniel Hulme wrote:
On Wed, Mar 28, 2007 at 11:06:34AM +0200, Denis wrote:
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
I'm not much of a font designer, but a few months back I found myself wanting to create a TTF by tracing some text on a few digital photos.
I had one SVG file. I imported a JPEG into it, traced a letter, hid the image, and then saved the SVG. I then switched to FontForge, created a new glyph, imported the SVG, and adjusted scale and position. (For the difficult letters I'd put a short line from the baseline to the x height to help with scaling, and delete it in FontForge.) After adjusting and saving the glyph, I switched back to Inkscape, deleted the letter shape, and moved onto the next letter. When I ran out of letters, I'd delete the image from the SVG and import the next one.
The only problem I had with this method was getting the kerning information to make the font look like the original, but this was probably exacerbated by the fact that the original text's kerning was awful. The end result was pretty good considering the skill level of the operator :->
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D...
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
It's great to hear that Inkscape can be used for font design. Could you guys collect some of this info into a page in the Inkscape Wiki? I bet others could find it useful in the future.
Bryce
On Wed, Mar 28, 2007 at 11:29:37PM +0200, Denis Fernandez Cabrera wrote:
Hello Daniel, Alan, Aaron, Marten et all.
I've been experimenting with Fontforge too. Turns out that it supports something called "SVG templates" for importing, which means that if you have a collection of SVGs that contain the glyphs and they are named something in the form of uni0041.svg (where the 0041 is the Unicode of the character in question), you can import them in FontForge and they will automatically replace the appropiate glyphs.
I've experimented with it this afternoon, and managed to produce the following (tarball containing SVG sources + TTF) [1]:
http://denis.ceibes.org/var/Propagaliza.tar.gz
What I did to create the font was the following:
- Design the glyphs in Inkscape, in a single document. Grid was helpful.
- Fuse each glyph into an individual object (Control++).
- Save each glyph into a single file with the appropiate unicode name,
making sure the glyph was of the correct dimensions. 4. Mass-import them all into FontForge witht the "Import > SVG Template" option". 5. Generate the TTF! (After adding a bit of metadata.)
I cheated in two aspects: a) I created a monospaced font, which made work much easier. It suits my design, but it won't suit all fonts. Other fonts will need manual adjustement, probably. b) Deciding which was the "correct dimensions" for both the Inkscape SVG document and the glyph within it was a matter of trial-and-error. I found out that if I exported my glyphs at the size of an A3 paper they would work just fine when imported in FontForge.
However, the process --- once figured out --- was remarkably simple. The most tedious part was having to save every single glyph with a separate file and name... If we could automate that process it would be very easy to create SVG Templates from Inkscape to import in FontForge.
So this is an idea I had about how the script could work. Please tell me if it is obviously dumb:
- The user creates a document which consists on all the glyphs he has
created grouped together with the appropiate letter (in a text object). So that the glyph for "A" would be grouped with a text object containing a single "A" letter, etc.
- We read the document, find the groups, remove the text object and
save the remaining glyph (possibly ungrouped now) as a separate SVG file named with the appropiate Unicode.
Perhaps the dimensions of the document could be taken from the source document containing all the glyphs, and the exported glyph would be placed on the bottom of the page... It may need a bit of manual tweaking afterwards.
We also need to figure out what is an "appropiate size" for glyphs to be imported in FontForge. I don't know really how this program works, so I am clueless here, and my font was a matter of trial-and-error. I suspect that other fonts will need different sizes. Or perhaps not.
Hum... I don't know if I am making any sense. The idea is simple, but I am a bit tired. Tell me what you think and we can talk more about this tomorrow.
Happy fonting! Denís.
[1] --- The font is called "Propagaliza Masiva", and it is an attempt of a font that is at the same time based off historic Galizan typography and the modern lettering of the constructivist and futurist posters of the first third of the XX century. The non-styled glyphs are taken from the DejaVu mono (which to my understanding is on the public domain for modification), and the font itself can be used under the Creative Common Attribution-ShareAlike license... Well, enough ranting.
Daniel Hulme wrote:
On Wed, Mar 28, 2007 at 11:06:34AM +0200, Denis wrote:
As a marginal note, is anyone doing fontwork with Inkscape? Has anyone tips or experiences to share?
I'm not much of a font designer, but a few months back I found myself wanting to create a TTF by tracing some text on a few digital photos.
I had one SVG file. I imported a JPEG into it, traced a letter, hid the image, and then saved the SVG. I then switched to FontForge, created a new glyph, imported the SVG, and adjusted scale and position. (For the difficult letters I'd put a short line from the baseline to the x height to help with scaling, and delete it in FontForge.) After adjusting and saving the glyph, I switched back to Inkscape, deleted the letter shape, and moved onto the next letter. When I ran out of letters, I'd delete the image from the SVG and import the next one.
The only problem I had with this method was getting the kerning information to make the font look like the original, but this was probably exacerbated by the fact that the original text's kerning was awful. The end result was pretty good considering the skill level of the operator :->
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D...
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
-- ########################### # Denís Fernández Cabrera # # denis@...2126... # # gatonegro.ceibes.org # ###########################
participants (6)
-
Aaron Spike
-
Alan Horkan
-
Bryce Harrington
-
Daniel Hulme
-
Denis
-
Denis Fernandez Cabrera