5.3 Fonts

  1. paths-from-glyph
  2. paths-from-string
  3. make-string-path

The library use zpb-ttf to extract path from TTF fonts.

While paths-from-string handle kerning between each pair of character, it is up to the user to scale the font, compute alignment (center,..), compute bounding box, break text into several lines if necessary, and so on, according to information obtained from zpb-ttf directly. However, more convenient support may be added in the future to cl-vectors.

Note that hinting is not supported at all. It may be a problem for rendering fonts at very small sizes. But otherwise, paths extracted from zpb-ttf are sufficient for most uses.

Function PATHS-FROM-GLYPH

Syntax:

Arguments and Values:

Description:

Examples:

(zpb-ttf:with-font-loader (loader "font.ttf")
  (show-annotated-path (paths-from-glyph (zpb-ttf:find-glyph #\π loader)
                                         :offset (make-point 200 550)
                                         :scale-x 0.3
                                         :scale-y -0.3)))

[image]

Function PATHS-FROM-STRING

Syntax:

Arguments and Values:

Description:

Examples:

(zpb-ttf:with-font-loader (loader "font.ttf")
  (paths-from-string loader "Hello World!"
                     :offset (make-point 200 550)
                     :scale-x 0.3
                     :scale-y -0.3)))

Function MAKE-STRING-PATH

Syntax:

Arguments and Values:

Description:

Generated by CL-Crock on 2010-09-25T15:20:59Z