Package Info

ghc-SVGFonts


Fonts from the SVG-Font format


Development/Languages/Other

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-font 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:

  • 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: <http://hackage.haskell.org/package/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 only makes sense in a diagrams backend that does rasterization in Haskell, such as diagrams-rasterific.

Example:

> # LANGUAGE NoMonomorphismRestriction # > > import Diagrams.Prelude > import Diagrams.Backend.Rasterific.CmdLine > import Graphics.SVGFonts > > main = defaultMain (text' "Hello World") > > text' t = stroke (textSVG t 1) # fc purple # fillRule EvenOdd > text'' t = stroke (textSVG' (TextOpts lin INSIDE_H KERN False 1 1) t) # fillRule EvenOdd > text''' t = (textSVG_ (TextOpts lin INSIDE_H KERN True 1 1) t) # fillRule EvenOdd .


License: BSD-3-Clause
URL: https://hackage.haskell.org/package/SVGFonts

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.6.0.1-bp150.1.3 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • x86-64
  • ghc-SVGFonts
  • ghc-SVGFonts-devel