wumpus-basic-0.15.0: Basic objects and system code built on Wumpus-Core.

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

Wumpus.Basic.Kernel.Base.GlyphMetrics

Description

Data types representing glyph metrics loaded from font files.

Synopsis

Documentation

type CodePoint = IntSource

A Unicode code-point.

type CharWidthTable u = CodePoint -> Vec2 uSource

A lookup from code point to width vector.

Note - in PostScript terminology a width vector is not obliged to be left-to-right (writing direction 0). It could be top-to-bottom (writing direction 1).

data MetricsOps Source

Operations on the metrics set of a font.

The is the internal representation used by Wumpus-Basic after parsing the font file.

Constructors

MetricsOps 

Fields

get_bounding_box :: forall u. FromPtSize u => PtSize -> BoundingBox u
 
get_cw_table :: forall u. FromPtSize u => PtSize -> CharWidthTable u
 
get_cap_height :: forall u. FromPtSize u => PtSize -> u
 

data FontMetricsOps Source

MetricsOps tfor a particular named font.

data GlyphMetrics Source

A map between a font name and MetricsOps.

Instances

monospace_metrics :: MetricsOpsSource

This ignores the Char code lookup and just returns the default advance vector.