image: Index | Files

package opentype

import ""

Package opentype implements the font.Face interface based on SFNT font file formats.


Package Files

face.go opentype.go

func NewFace Uses

func NewFace(f *sfnt.Font, opts *FaceOptions) (font.Face, error)

NewFace returns a new font.Face for the given sfnt.Font. if opts is nil, sensible defaults will be used.

type Face Uses

type Face struct {
    // contains filtered or unexported fields

Face implements the font.Face interface for sfnt.Font values.

func (*Face) Close Uses

func (f *Face) Close() error

Close satisfies the font.Face interface.

func (*Face) Glyph Uses

func (f *Face) Glyph(dot fixed.Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ok bool)

Glyph satisfies the font.Face interface.

func (*Face) GlyphAdvance Uses

func (f *Face) GlyphAdvance(r rune) (advance fixed.Int26_6, ok bool)

GlyphAdvance satisfies the font.Face interface.

func (*Face) GlyphBounds Uses

func (f *Face) GlyphBounds(r rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)

GlyphBounds satisfies the font.Face interface.

func (*Face) Kern Uses

func (f *Face) Kern(r0, r1 rune) fixed.Int26_6

Kern satisfies the font.Face interface.

func (*Face) Metrics Uses

func (f *Face) Metrics() font.Metrics

Metrics satisfies the font.Face interface.

type FaceOptions Uses

type FaceOptions struct {
    Size    float64      // Size is the font size in points
    DPI     float64      // DPI is the dots per inch resolution
    Hinting font.Hinting // Hinting selects how to quantize a vector font's glyph nodes

FaceOptions describes the possible options given to NewFace when creating a new font.Face from a sfnt.Font.

Package opentype imports 4 packages (graph) and is imported by 6 packages. Updated 2020-09-22. Refresh now. Tools for package owners.