opentype

package
v2.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFace

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.

Types

type Face

type Face struct {
	// contains filtered or unexported fields
}

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

func (*Face) Close

func (f *Face) Close() error

Close satisfies the font.Face interface.

func (*Face) Glyph

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

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

GlyphAdvance satisfies the font.Face interface.

func (*Face) GlyphBounds

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

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

Kern satisfies the font.Face interface.

func (*Face) Metrics

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

Metrics satisfies the font.Face interface.

type FaceOptions

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL