font

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, embed 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, parms *cjk) (*types.IndirectRef, error)

CIDFontDict returns the descendant font dict with special encoding 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 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, 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 PDFDocEncoding

func PDFDocEncoding(xRefTable *model.XRefTable) (*types.IndirectRef, error)

func RTL

func RTL(lang string) bool

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

func SupportedScript

func SupportedScript(s string) bool

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