The SVGFonts package

[ Tags: bsd3, graphics, library ] [ Propose Tags ]

Native font support for the diagrams framework (http://projects.haskell.org/diagrams/). 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 http://fontforge.sourceforge.net/, or use the included LinLibertine and Bitstream fonts.

Features:

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.

Example:

 # 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

Properties

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.3.0.1, 1.3.0.2, 1.4, 1.4.0.1, 1.4.0.2, 1.4.0.3, 1.5.0.0, 1.5.0.1, 1.6.0.0, 1.6.0.1, 1.6.0.2, 1.6.0.3
Dependencies attoparsec, base (==4.*), containers (>=0.4 && <0.6), data-default-class (<0.1), diagrams-lib (==0.7.*), directory (>=1.1), parsec, split, text, tuple, vector, vector-space, xml [details]
License BSD3
Author Tillmann Vogt
Maintainer diagrams-discuss@googlegroups.com
Category Graphics
Source repository head: git clone https://github.com/diagrams/SVGFonts.git
Uploaded Tue Aug 13 00:31:33 UTC 2013 by BrentYorgey
Distributions LTSHaskell:1.6.0.3, NixOS:1.6.0.3, Stackage:1.6.0.3, Tumbleweed:1.6.0.1
Downloads 10870 total (212 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Successful builds reported [all 9 reports]
Hackage Matrix CI

Modules

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

Downloads

Maintainer's Corner

For package maintainers and hackage trustees