cff

package
v0.0.0-...-61352bb Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameIndex mainIndex = iota
	DictIndex
	StringIndex
	GlobalSubrIndex
	CharSet
	Encoding
	CharStringsIndex
	PrivateDict
	LocalSubrsIndex
)

Index tables

Variables

This section is empty.

Functions

This section is empty.

Types

type CFF

type CFF struct {
	Major     uint8
	Minor     uint8
	HdrSize   uint8
	Fontindex int

	Font []*Font
	// contains filtered or unexported fields
}

CFF represents a CFF font file

func ParseCFFData

func ParseCFFData(r io.ReadSeeker) (*CFF, error)

ParseCFFData interprets the CFF data and returns an error or nil.

func (*CFF) FontName

func (c *CFF) FontName() string

FontName returns the PostScript font name of the font to be written

func (*CFF) GetRawIndexData

func (c *CFF) GetRawIndexData(r io.ReadSeeker, index mainIndex) ([]byte, error)

GetRawIndexData returns a byte slice of the index

func (*CFF) Subset

func (c *CFF) Subset(codepoints []int)

Subset changes the font so that only the given code points remain in the font. Subset must only be called once.

func (*CFF) WriteCFFData

func (c *CFF) WriteCFFData(w io.Writer) error

WriteCFFData writes the CFF data to w.

type Font

type Font struct {
	CharStrings [][]byte
	// contains filtered or unexported fields
}

Font is a CFF font instance. There can be more than one CFF font in a font file.

func (*Font) GetRawIndexData

func (f *Font) GetRawIndexData(r io.ReadSeeker, index mainIndex) ([]byte, error)

GetRawIndexData returns a byte slice of the index

func (*Font) IsCIDFont

func (f *Font) IsCIDFont() bool

IsCIDFont returns true if the character encoding is based on CID instead of SID

func (*Font) Subset

func (f *Font) Subset(globalSubr [][]byte, codepoints []int)

Subset changes the font so that only the given code points remain in the font. Subset must only be called once.

type SID

type SID int

SID represents a CFF string

Jump to

Keyboard shortcuts

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