cff

package
v0.0.0-...-7a887e3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Font

type Font struct {

	// Charstrings contains the actual glyph definition.
	// It has a length of numGlyphs and is indexed by glyph ID.
	// See `LoadGlyph` for a way to intepret the glyph data.
	Charstrings [][]byte
	// contains filtered or unexported fields
}

Font represents a parsed CFF font.

func Parse

func Parse(file []byte) (*Font, error)

Parse parses a .cff font file. Although CFF enables multiple font or CIDFont programs to be bundled together in a single file, embedded CFF font file in PDF or in TrueType/OpenType fonts shall consist of exactly one font or CIDFont. Thus, this function returns an error if the file contains more than one font.

func (*Font) GlyphName

func (f *Font) GlyphName(glyph api.GID) string

GlyphName returns the name of the glyph or an empty string if not found.

func (*Font) LoadGlyph

func (f *Font) LoadGlyph(glyph tables.GlyphID) ([]api.Segment, ps.PathBounds, error)

LoadGlyph parses the glyph charstring to compute segments and path bounds. It returns an error if the glyph is invalid or if decoding the charstring fails.

Directories

Path Synopsis
Package psinterpreter implement a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings.
Package psinterpreter implement a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings.

Jump to

Keyboard shortcuts

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