Creating A Font

From Svg wiki

My experience of creating an SVG typeface by hand...

Long, long ago in a galaxy far, far away I used Donald E. Knuth's METAFONT program to create typefaces as free software. The advantage of METAFONT was that someone like me can fool about with it without paying for expensive font-editing software. Too bad this does not apply to the standard font formats like Type1 and TrueType.

For my Alleged Tarot project I was able to knock together an admittedly very simple and very partial font in what amounts to a few evenings' work. Obviously something developed like this is going to be a quirky titling face, unsuited to continuous text, so I still use Helvetica comma Arial comma Sans hyphen Serif for the detailed text.

Writing a font by hand is not all that hard so long as you are not after subtle effects. I deliberately designed the typeface to use shapes easy to describe in SVG path commands. I chose an 18-unit grid instead of the 1000-unit or 2048-unit grids that are more conventionally used; this made the mental arithmetic easier.

For some letters, such as w and v, working out the coordinates of the points where the diagonals meet was more challenging. In the end I created throwaway Python programs that took various parameters (stroke thickness, width of this and that) and generated the SVG code automatically-something made easier by the use of an XML format rather than some fancy binary format. I could paste the glyph definitions in to an SVG file which exercised the font and get pretty much immediate feedback.

Adobe SVG Viewer does not allow fonts to be stored separately and refered to with font-face elements; as a result, there is a copy of the font in each SVG picture that uses it. This is not a major problem: the typeface is simple and only contains barely enough glyphs to print the names of all the tarot cards, so the space taken up in each file is small (after compression). Also the *-card3.svgz files on the web site are generated automatically from the base SVG file, so this does not impose extra work on me as I edit the graphics. One day I must write a font-subsetting program.

-Damian Cugley