MCPcopy Create free account
hub / github.com/tdewolff/canvas / getBuiltinEncoding

Method getBuiltinEncoding

cmd/pdftext/encoding.go:530–542  ·  view source on GitHub ↗
(fontType pdfName, fontDescriptor pdfDict)

Source from the content-addressed store, hash-verified

528}
529
530func (r *pdfReader) getBuiltinEncoding(fontType pdfName, fontDescriptor pdfDict) (encoding, error) {
531 sfnt, err := r.getFontProgram(fontDescriptor)
532 if err != nil {
533 return builtinEncoding{}, err
534 } else if sfnt == nil {
535 return standardEncoding{}, nil // standard font
536 }
537 bytes := 1
538 if fontType == pdfName("CIDFontType0") || fontType == pdfName("CIDFontType2") {
539 bytes = 2
540 }
541 return builtinEncoding{bytes, sfnt}, nil
542}
543
544type charsetEntry struct {
545 name string

Callers 1

GetFontMethod · 0.95

Calls 2

getFontProgramMethod · 0.95
pdfNameTypeAlias · 0.70

Tested by

no test coverage detected