Plotter-like fonts i.e. a series of straight lines which make letter shapes.

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

GPL licensed by M J Oldfield


Crude fonts suitable for plotting.

There are many good looking fonts which optimize for appearance. I wanted some cruder fonts which had a simpler representation: a relatively small number of straight lines which could easily be plotted by a machine, or perhaps a person.


Here is an example using diagrams to generate a SVG file:

import qualified Graphics.PlotFont as PF

import Diagrams.Prelude
import Diagrams.Backend.SVG

strokes :: [[(Double,Double)]]    
strokes = PF.render' PF.canvastextFont "Hello World!"

toDiag :: [[(Double,Double)]] -> Diagram SVG
toDiag = extrudeLeft 20 . mconcat . map (fromVertices . map p2)

main :: IO ()         
main = renderSVG "hello.svg" (mkSizeSpec2D (Just 800) (Just 200)) $
          toDiag strokes # lw 3


The code written by me is licensed under the GPL, version 2 or later.

The data for the fonts come from Jim Studt's canvastext.js which he placed in the public domain. He cites the original source as the Hershey fonts:

The Hershey fonts appear to have this license:

  1. The following acknowledgements must be distributed with the font data:

    • The Hershey Fonts were originally created by Dr. A. V. Hershey while working at the U. S. National Bureau of Standards.

    • The format of the Font data in this distribution was originally created by James Hurt Cognition, Inc. 900 Technology Park Drive Billerica, MA 01821 (mit-eddie!ci-dandelion!hurt)

  2. The font data in this distribution may be converted into any other format EXCEPT the format distributed by the U.S. NTIS (which organization holds the rights to the distribution and use of the font data in that particular format). Not that anybody would really want to use their format... each point is described in eight bytes as "xxx yyy:", where xxx and yyy are the coordinate values as ASCII numbers.

It is not clear to me if Mr Studt used 'this distribution'.

Depends on 2 packages:
Used by 1 package:
comments powered byDisqus