SVGFonts: Fonts from the SVG-Font format
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.github.io/, 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 #
main = do linLibertine <- loadDataFont "fonts/LinLibertine.svg"
t <- text'''' linLibertine "Hello"
mainWith (t :: Diagram B)
text' font t = stroke (textSVG t 1) # fc purple # fillRule EvenOdd
text'' font t = stroke (textSVG' (TextOpts font INSIDE_H KERN False 1 1) t) # fillRule EvenOdd
text''' font t = (textSVG_ (TextOpts font INSIDE_H KERN True 1 1) t) # fillRule EvenOdd
-- using a local font
text'''' font t = do
font <- loadFont "/path/to/font.svg"
return $ stroke (textSVG' (TextOpts font INSIDE_H KERN False 1 1) t)
[Skip to Readme]
Modules
[Index]
Downloads
- SVGFonts-1.7.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- 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.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, 1.7, 1.7.0.1, 1.8, 1.8.0.1, 1.8.1 |
|---|---|
| Change log | CHANGES.md |
| Dependencies | attoparsec, base (>=4 && <5), blaze-markup (>=0.5), blaze-svg (>=0.3.3), bytestring (>=0.10 && <1.0), cereal, cereal-vector, containers (>=0.4 && <0.7), data-default-class (<0.2), diagrams-core (>=1.3 && <1.5), diagrams-lib (>=1.3 && <1.5), directory (>=1.1), parsec, split, text, vector, xml [details] |
| Tested with | ghc ==7.8.4, ghc ==7.10.2, ghc ==8.0.1, ghc ==8.2.1 |
| License | BSD-3-Clause |
| Author | Tillmann Vogt |
| Maintainer | diagrams-discuss@googlegroups.com |
| Uploaded | by BrentYorgey at 2018-05-09T14:39:33Z |
| Revised | Revision 1 made by BrentYorgey at 2018-12-20T16:40:27Z |
| Category | Graphics |
| Source repo | head: git clone https://github.com/diagrams/SVGFonts.git |
| Reverse Dependencies | 11 direct, 13 indirect [details] |
| Downloads | 37593 total (44 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2018-05-09 [all 1 reports] |