type1c

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT, MIT Imports: 10 Imported by: 1

Documentation

Overview

Package type1c provides a parser for the CFF font format defined at https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf

Index

Constants

This section is empty.

Variables

View Source
var Loader fonts.FontLoader = loader{}

Functions

This section is empty.

Types

type Font

type Font struct {
	Encoding *simpleencodings.Encoding

	fonts.PSInfo
	// contains filtered or unexported fields
}

Font represents a parsed Font font.

func Parse

func Parse(file fonts.Resource) (*Font, error)

Parse parse 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. See Loader to read standalone .cff files

func (*Font) GetExtents

func (f *Font) GetExtents(glyph fonts.GID) (fonts.GlyphExtents, bool)

GetExtents returns the glyph extents, in font units, computed by parsing the charstring for this glyph. It returns `false` if the glyph is invalid or if an error occurs.

func (*Font) GlyphName

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

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

func (*Font) LoadMetrics

func (f *Font) LoadMetrics() fonts.FaceMetrics

func (*Font) LoadSummary

func (f *Font) LoadSummary() (fonts.FontSummary, error)

func (*Font) NumGlyphs

func (f *Font) NumGlyphs() uint16

NumGlyphs returns the number of glyphs in this font. It is also the maximum glyph index + 1.

func (*Font) PoscriptName

func (f *Font) PoscriptName() string

func (*Font) PostscriptInfo

func (f *Font) PostscriptInfo() (fonts.PSInfo, bool)

Jump to

Keyboard shortcuts

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