SVGFonts: Fonts from the SVG-Font format

[ bsd3, graphics, library ] [ Propose Tags ]

SVG-Font is a very easy to parse format and was therefore chosen for a font library completely written in Haskell

To use this library with your own font, the font has to be converted with http://fontforge.sourceforge.net/ Features

  • A very easy and powerful functional interface, see the Font.hs example

  • The generated outlines can be transformed in various ways, i.e. elimination of holes for easy extrusion (with the triangulation library)

  • complete implementation of the SVG-Font format, that allows Kerning (i.e. the two characters in VA have a shorter distance than in VV)

  • Everything is stored in a simple SceneGraph data type: http://hackage.haskell.org/package/collada-types

Some speed issues are left to be solved (xml) and rasterization is not finnished

Speed issues can be solved by trimming the svg file to only those characters that are used


[Skip to Readme]

Modules

[Last Documentation]

  • Graphics
    • SVGFonts
      • Graphics.SVGFonts.RasterFont
      • Graphics.SVGFonts.ReadFont

Downloads

Maintainer's Corner

Package maintainers

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
Dependencies array, base (>=4 && <5), bytestring (>=0.9.1 && <0.9.2), collada-output (>=0.5), collada-types (>=0.2), containers (>=0.4 && <0.5), directory (>=1.1 && <1.2), GLUT (>=2.1.2.1), haskell98, OpenGL (>=2.2.3.0), parsec (>=3.1 && <3.2), split (>=0.1 && <0.2), SVGPath (>=1.0 && <1.1), tga, triangulation (>=0.2), tuple, xml (>=1.3 && <1.4) [details]
License BSD-3-Clause
Author Tillmann Vogt
Maintainer Tillmann.Vogt@rwth-aachen.de
Category Graphics
Uploaded by TillmannVogt at 2011-06-07T15:44:15Z
Distributions LTSHaskell:1.8.0.1, NixOS:1.8.0.1, Stackage:1.8.0.1
Reverse Dependencies 11 direct, 12 indirect [details]
Executables Fonts
Downloads 35495 total (103 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-27 [all 7 reports]

Readme for SVGFonts-0.4

[back to package description]
SVGFonts

This library parses the SVG-Fonts format which is in XML, so it is easy to manipulate by hand (See http://www.w3.org/TR/SVG/fonts.html).

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

Usage:
  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.

Example:
  src/Test/Font.hs generates a Collada file that can be read with tools like blender.
  The data that is passed to genCollada is represented with a data type that I use for all my libraries to allow easy combination.

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

  displayString :: String -> (Int,Int) -> Props -> Transf -> Mode -> Spacing -> O -> V -> V -> P -> TexMap -> [Geometry]

  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