Documentation ¶
Index ¶
- Variables
- func CIDFontDescriptor(xRefTable *model.XRefTable, ttf font.TTFLight, ...) (*types.IndirectRef, error)
- func CIDFontDict(xRefTable *model.XRefTable, ttf font.TTFLight, ...) (*types.IndirectRef, error)
- func CIDFontFile(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, subFont bool) (*types.IndirectRef, error)
- func CIDSet(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, ...) (*types.IndirectRef, error)
- func CIDWidths(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, subFont bool, ...) (*types.IndirectRef, error)
- func CJK(script, lang string) bool
- func CJKEncoding(s string) bool
- func EnsureFontDict(xRefTable *model.XRefTable, fontName, lang, script string, field bool, ...) (*types.IndirectRef, error)
- func FontDescriptor(xRefTable *model.XRefTable, ttf font.TTFLight, fontName, fontLang string) (*types.IndirectRef, error)
- func FontResources(xRefTable *model.XRefTable, fm model.FontMap) (types.Dict, error)
- func IndRefsForUserfontUpdate(xRefTable *model.XRefTable, d types.Dict, lang string, ...) error
- func Lang(xRefTable *model.XRefTable, d types.Dict) (string, error)
- func Name(xRefTable *model.XRefTable, fontDict types.Dict, objNumber int) (prefix, fontName string, err error)
- func PDFDocEncoding(xRefTable *model.XRefTable) (*types.IndirectRef, error)
- func RTL(lang string) bool
- func SupportedScript(s string) bool
- func UpdateUserfont(xRefTable *model.XRefTable, fontName string, f model.FontResource) error
- func Widths(xRefTable *model.XRefTable, ttf font.TTFLight, first, last int) (*types.IndirectRef, error)
Constants ¶
This section is empty.
Variables ¶
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 CJKEncoding ¶
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 ¶
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 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 SupportedScript ¶
func UpdateUserfont ¶
UpdateUserfont updates the fontdict for fontName via supplied font resource.
Types ¶
This section is empty.