font

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCorruptFontDict = errors.New("pdfcpu: corrupt fontDict")
)

Functions

func CIDFontDescriptor

func CIDFontDescriptor(xRefTable *model.XRefTable, ttf font.TTFLight, fontName, baseFontName, fontLang string, subFont, cjk bool) (*types.IndirectRef, error)

CIDFontDescriptor returns a font descriptor describing the CIDFont’s default metrics other than its glyph widths.

func CIDFontDict

func CIDFontDict(xRefTable *model.XRefTable, ttf font.TTFLight, fontName, baseFontName, lang string, subFont bool) (*types.IndirectRef, error)

CIDFontDict returns the descendant font dict for Type0 fonts.

func CIDFontFile

func CIDFontFile(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, subFont bool) (*types.IndirectRef, error)

CIDFontFile returns a TrueType font file or subfont file for fontName.

func CIDFontSpecialEncDict

func CIDFontSpecialEncDict(xRefTable *model.XRefTable, ttf font.TTFLight, baseFontName, lang string, parms cjk) (*types.IndirectRef, error)

CIDFontSpecialEncDict returns the descendant font dict with special encoding for Type0 fonts.

func CIDSet

func CIDSet(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, indRef *types.IndirectRef) (*types.IndirectRef, error)

CIDSet computes a CIDSet for used glyphs and updates or returns a new object.

func CIDWidths

func CIDWidths(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, subFont bool, indRef *types.IndirectRef) (*types.IndirectRef, error)

CIDWidths returns the value for W in a CIDFontDict.

func CJK

func CJK(script, lang string) bool

CJK returns true if script and lang imply a CJK font.

func CJKEncoding

func CJKEncoding(s string) bool

CJKEncodings returns true for supported encodings.

func EnsureFontDict

func EnsureFontDict(xRefTable *model.XRefTable, fontName, lang, script string, subDict, field bool, indRef *types.IndirectRef) (*types.IndirectRef, error)

EnsureFontDict ensures a font dict for fontName, lang, script.

func FontDescriptor

func FontDescriptor(xRefTable *model.XRefTable, ttf font.TTFLight, fontName, fontLang string) (*types.IndirectRef, error)

FontDescriptor returns a TrueType font descriptor describing font’s default metrics other than its glyph widths.

func FontResources

func FontResources(xRefTable *model.XRefTable, fm model.FontMap) (types.Dict, error)

FontResources returns a font resource dict for a font map.

func IndRefsForUserfontUpdate

func IndRefsForUserfontUpdate(xRefTable *model.XRefTable, d types.Dict, lang string, font *model.FontResource) error

IndRefsForUserfontUpdate detects used indirect references for a possible user font update.

func Lang

func Lang(xRefTable *model.XRefTable, d types.Dict) (*string, error)

Lang detects the optional language indicator in a font dict.

func Name

func Name(xRefTable *model.XRefTable, fontDict types.Dict, objNumber int) (prefix, fontName string, err error)

Name evaluates the font name for a given font dict.

func RTL

func RTL(lang string) bool

RTL returns true if lang implies a right-to-left script.

func UpdateUserfont

func UpdateUserfont(xRefTable *model.XRefTable, fontName string, f model.FontResource) error

UpdateUserfont updates the fontdict for fontName via supplied font resource.

func Widths

func Widths(xRefTable *model.XRefTable, ttf font.TTFLight, first, last int) (*types.IndirectRef, error)

Widths returns the value for Widths in a TrueType FontDict.

Types

This section is empty.

Jump to

Keyboard shortcuts

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