Documentation ¶
Overview ¶
Package tfm implements a decoder for TFM (TeX Font Metrics) files.
Index ¶
- type Font
- func (fnt *Font) Box(r rune) (w, h, d fixed.Int12_20, ok bool)
- func (fnt *Font) Checksum() uint32
- func (fnt *Font) CodingScheme() string
- func (fnt *Font) DesignSize() fixed.Int12_20
- func (fnt *Font) GlyphAdvance(r rune) (xfix.Int26_6, bool)
- func (fnt *Font) GlyphBounds(r rune) (bounds xfix.Rectangle26_6, advance xfix.Int26_6, ok bool)
- func (fnt *Font) Kern(r0, r1 rune) xfix.Int26_6
- func (fnt *Font) MarshalText() ([]byte, error)
- func (fnt *Font) Metrics() font.Metrics
- func (fnt *Font) Name() string
- func (fnt *Font) NumGlyphs() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font is a TeX Font metrics.
func (*Font) Box ¶ added in v0.5.0
Box returns the width, height and depth of r's glyph.
It returns !ok if the face does not contain a glyph for r.
func (*Font) CodingScheme ¶
func (*Font) DesignSize ¶
func (*Font) GlyphAdvance ¶
GlyphAdvance returns the advance width of r's glyph.
It returns !ok if the face does not contain a glyph for r.
func (*Font) GlyphBounds ¶ added in v0.5.0
GlyphBounds returns the bounding box of r's glyph, drawn at a dot equal to the origin, and that glyph's advance width.
It returns !ok if the face does not contain a glyph for r.
The glyph's ascent and descent equal -bounds.Min.Y and +bounds.Max.Y. A visual depiction of what these metrics are is at https://developer.apple.com/library/mac/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Art/glyph_metrics_2x.png
func (*Font) Kern ¶ added in v0.5.0
Kern returns the horizontal adjustment for the kerning pair (r0, r1). A positive kern means to move the glyphs further apart.