The plotfont package

[Tags:gpl, library, test]

Crude fonts for XY plotting

[Skip to Readme]


Dependencies base (==4.*), containers [details]
License GPL
Author M J Oldfield
Category Graphics
Source repository head: git clone
Uploaded Thu Sep 17 14:11:00 UTC 2015 by mjoldfield
Distributions NixOS:
Downloads 189 total (4 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2015-09-17 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for plotfont

Readme for plotfont-


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'.