Functional PostScript Tutorial
Glyphpath is a kind of path. It can be transformed and turned into pictures just like all other paths. Glyphpaths are pre-drawn paths that tell us how characters such as "A", "B", "C" etc in a font are be drawn.
Fonts are a set of glyph paths of a specified size. Courier, Times New Roman, and Helvetica are examples of some common fonts. Each font has four elements: a collection of glyphs, a character map, an integer map, and a transformation matrix. Glyphs are data structures that associate symbolic names (called glyphnames) to a path (called glyphpath). Character and integer maps are data structures that associate characters and integers (such as #\A and 2) to glyphnames. The transformation matrix describes a global transformation on the glyphpaths in this font (you may want to adjust the 'slantedness' of Italics, for example).
To create glyphpahts, we must create a font first:
(define helv (font "Helvetica" 36))Once we have the font, we can create some glyphpaths:
(simple-string->glyphpath helv "Hello, Goldfish!")You can stroke, fill, transform, and compose this glyphpath just as you would with any other paths. Check out the circle-text program in fps-examples.scm which puts text around a circle (it involves some fairly hairly looking transformations, but it is simply figuring out where to put the glyphpaths).
Related procedures in this section:
font, char->glyphpath, int->glyphpath, glyphname->glyphpath
simple-string->glyph, string->glyph,
FPS Tutorial Content: Intro and The Idea | Getting Started | Paths and Pictures | Show and Channels | Transformation | Composition | Glyphpaths | Style | Color | Colormap | Clipping | Glyphnames | Other Topics