type1c

package
v0.0.0-...-b7ff752 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT, MIT Imports: 12 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 (*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) 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 Parse

func Parse(r io.ReadSeeker) (*Font, error)

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

func (*Font) Cmap

func (f *Font) Cmap() (fonts.Cmap, fonts.CmapEncoding)

func (*Font) GetRawIndexData

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

GetRawIndexData returns a byte slice of the index

func (*Font) GlyphName

func (fnt *Font) GlyphName(g fonts.GID) string

func (*Font) IsCIDFont

func (f *Font) IsCIDFont() bool

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

func (*Font) LoadGlyph

func (f *Font) LoadGlyph(glyph fonts.GID) ([]fonts.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.

func (*Font) NumGlyphs

func (fnt *Font) NumGlyphs() int

func (*Font) Subset

func (f *Font) Subset(codepoints []fonts.GID)

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

func (*Font) WriteSubset

func (f *Font) WriteSubset(w io.Writer) error

WriteSubset writes this font to the CFFFile

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