SVGFonts: Fonts from the SVG-Font format

[ bsd3, graphics, library ] [ Propose Tags ]

Native font support for the diagrams framework ( Note that this package can be used with any diagrams backend, not just the SVG backend. The SVG-tont format is easy to parse and was therefore chosen for a font library completely written in Haskell.

You can convert your own font to SVG with, or use the included LinLibertine and Bitstream fonts.


  • Complete implementation of the features that Fontforge produces (though not the complete SVG format)

  • Kerning (i.e. the two characters in "VA" are closer than the characters in "VV")

  • Unicode

  • Ligatures

  • An example that shows how to do text boxes with syntax highlighting using highlighting-kate:

XML speed issues can be solved by trimming the svg file to only those characters that are used (or maybe binary xml one day).

Version 1.0 of this library supports texturing, though this would only sense in a diagrams backend that does rasterization in Haskell.


 # LANGUAGE NoMonomorphismRestriction #

import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Graphics.SVGFonts.ReadFont (textSVG)

main = defaultMain (text' "Hello World")

text'   t = stroke (textSVG t 1) # fc purple # fillRule EvenOdd
text''  t = stroke (textSVG' $ TextOpts t lin INSIDE_H KERN False 1 1 ) # fillRule EvenOdd
text''' t =        (textSVG_ $ TextOpts t lin INSIDE_H KERN True  1 1 ) # fillRule EvenOdd


[Last Documentation]

  • Graphics
    • Graphics.SVGFonts
      • Graphics.SVGFonts.CharReference
      • Graphics.SVGFonts.ReadFont
      • Graphics.SVGFonts.ReadPath


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 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,,,,,,,,,, 1.7,, 1.8,
Dependencies attoparsec, base (>=4 && <5), containers (>=0.4 && <0.6), data-default-class (<0.1), diagrams-lib (>=0.7 && <0.8), directory (>=1.1), parsec, split, text, tuple, vector, vector-space, xml [details]
License BSD-3-Clause
Author Tillmann Vogt
Category Graphics
Source repo head: git clone
Uploaded by BrentYorgey at 2013-08-13T00:31:33Z
Distributions LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 11 direct, 12 indirect [details]
Downloads 35086 total (97 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Successful builds reported [all 9 reports]