Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Data types representing glyph metrics loaded from font files.
- type FontName = String
- type CodePoint = Int
- type CharWidthTable u = CodePoint -> Vec2 u
- data MetricsOps = MetricsOps {
- 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 = FontMetricsOps FontName MetricsOps
- data GlyphMetrics
- emptyGlyphMetrics :: GlyphMetrics
- lookupFont :: FontName -> GlyphMetrics -> Maybe MetricsOps
- insertFont :: FontMetricsOps -> GlyphMetrics -> GlyphMetrics
- monospace_metrics :: MetricsOps
Documentation
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.
MetricsOps | |
|
data FontMetricsOps Source
MetricsOps
tfor a particular named font.
lookupFont :: FontName -> GlyphMetrics -> Maybe MetricsOpsSource
monospace_metrics :: MetricsOpsSource
This ignores the Char code lookup and just returns the default advance vector.