wumpus-basic-0.13.0: Common drawing utilities built on wumpus-core.

Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>




AFM file parser.

Note - AFM Version 2.0 used by GhostScript and Version 3.0+ have numerous differences.


Afm Unit

data AfmUnit Source

Wrapped Double representing 1/1000 of the scale factor (Point size) of a font. AFM files encode all measurements as these units.

afmValue :: FromPtSize u => AfmUnit -> PtSize -> uSource

Compute the size of a measurement in Afm units scaled by the point size of the font.

Glyph metrics

type PSCharCode = IntSource

Afm files index glyphs by PostScript character code. This is not the same as Unicode, ASCII...

It is expected to be determined by EncodingScheme in the Global Font Information Section.

data AfmFile Source

Wumpus needs a very small subset of AFM files, common to both version 2.0 and version 4.1.

Note - Bounding Box is mandatory for AFM versions 3.0 and 4.1

Cap Height is optional in AFM versions 3.0 and 4.1. As Wumpus uses cap height in calculations, glyph metrics must be build with an arbitrary value if it is not present.

Encoding Scheme is optional in AFM files.


Font loading

data FontLoader cu Source


forall interim . FontLoader