The SVGFonts package

[Tags:bsd3, library]

Parse SVG-Font files and generate outlines or textures or texture files from text strings. This library uses algorithms similar to Freetype and therefore needs no binding. Unfortunately some speed issues (xml, rasterization) and bugs (triangulation,rasterization) make an actual usage problematic, but they will be solved.

[Skip to Readme]


Versions 0.1, 0.2, 0.3, 0.4, 1.0, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.3,,, 1.4,,,,
Dependencies array, base (==4.*), bytestring (==0.9.1.*), containers (==0.3.*), directory (==1.0.*), GLUT, haskell98, OpenGL, parsec (==2.1.*), split (==0.1.*), SVGPath (==1.0.*), tga, tuple, xml (==1.3.*) [details]
License BSD3
Author Tillmann Vogt
Stability Unknown
Category Graphics
Uploaded Mon Nov 15 18:09:39 UTC 2010 by TillmannVogt
Distributions LTSHaskell:, NixOS:
Downloads 6284 total (62 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2015-12-08 [all 5 reports]


  • Graphics
    • SVGFonts
      • Graphics.SVGFonts.KETTriangulation
      • Graphics.SVGFonts.ReadFont


Maintainer's Corner

For package maintainers and hackage trustees

Readme for SVGFonts

Readme for SVGFonts-0.3


This library parses the SVG-Fonts format which is in XML, so it is easy to manipulate by hand (See

  - Complete implementation of the SVG-Font format
  - Outline generation with elimination of holes for easy extrusion
  - Kerning (i.e. the two characters in "VA" have a shorter distance than in "VV")
  - Rasterization with with antialiasing (subsampling with 256 grey values) (soon)
  - Font-Cache

  You can convert your favourite font (i.e.  .ttf) into a .svg file with fontforge (the menu item under
  "Save All"). If a font converted on your own doesn't work, try the repair options, and if this still
  doens't work edit the file by hand or even cooler: help me with a patch to make this library more robust.
  Remember that a lot of fonts are not allowed to be distributed freely.

  src/Test/Font.hs is an example how to use this library.
  You can navigate around the 3d string with w,a,s,d, + arrows

  The main function to generate a visual representation of a string is:

  displayString :: String -> (Int,Int) -> Mode -> Spacing -> O -> V -> V -> P -> [AObj]

  The list [AObj] can contain various data:
  - Textures that can be used directly by OpenGL (TextureObject)
  - Names of texture files in the fontcache (collada-output needs this)
  - Extruded or non extruded outlines

  The data to generate can be specified by the last argument, the property-function:
    type P = [Char] -> [(Char,[CharProp])]
  that assigns properties to every character of the string (i.e. color of a char in syntaxhighlighting, Font)

  The [AObj] list has to be converted to whatever types you use