textencoding

package
v3.0.0-...-55e877b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MissingCodeRune   = '\ufffd'
	MissingCodeString = string(MissingCodeRune)
)

Variables

This section is empty.

Functions

func ExpandLigatures

func ExpandLigatures(runes []rune) string

func FromFontDifferences

func FromFontDifferences(diffList *_f.PdfObjectArray) (map[CharCode]GlyphName, error)

func GlyphToRune

func GlyphToRune(glyph GlyphName) (rune, bool)

func RegisterSimpleEncoding

func RegisterSimpleEncoding(name string, fnc func() SimpleEncoder)

func RuneToString

func RuneToString(r rune) string

Types

type CMapEncoder

type CMapEncoder struct {
	// contains filtered or unexported fields
}

func NewCMapEncoder

func NewCMapEncoder(baseName string, codeToCID, cidToUnicode *_ebd.CMap) CMapEncoder

func (CMapEncoder) CharcodeToRune

func (_caed CMapEncoder) CharcodeToRune(code CharCode) (rune, bool)

func (CMapEncoder) Decode

func (_afd CMapEncoder) Decode(raw []byte) string

func (CMapEncoder) Encode

func (_deb CMapEncoder) Encode(str string) []byte

func (CMapEncoder) RuneToCharcode

func (_bcg CMapEncoder) RuneToCharcode(r rune) (CharCode, bool)

func (CMapEncoder) String

func (_ag CMapEncoder) String() string

func (CMapEncoder) ToPdfObject

func (_fff CMapEncoder) ToPdfObject() _f.PdfObject

type CharCode

type CharCode uint16

type GID

type GID uint16

type GlyphName

type GlyphName string

func RuneToGlyph

func RuneToGlyph(r rune) (GlyphName, bool)

type IdentityEncoder

type IdentityEncoder struct {
	// contains filtered or unexported fields
}

func NewIdentityTextEncoder

func NewIdentityTextEncoder(baseName string) *IdentityEncoder

func (*IdentityEncoder) CharcodeToRune

func (_gbe *IdentityEncoder) CharcodeToRune(code CharCode) (rune, bool)

func (*IdentityEncoder) Decode

func (_dfgg *IdentityEncoder) Decode(raw []byte) string

func (*IdentityEncoder) Encode

func (_gab *IdentityEncoder) Encode(str string) []byte

func (*IdentityEncoder) GlyphToRune

func (_egc *IdentityEncoder) GlyphToRune(glyph GlyphName) (rune, bool)

func (*IdentityEncoder) RegisteredRunes

func (_eed *IdentityEncoder) RegisteredRunes() []rune

func (*IdentityEncoder) RuneToCharcode

func (_cbcc *IdentityEncoder) RuneToCharcode(r rune) (CharCode, bool)

func (*IdentityEncoder) RuneToGlyph

func (_cdg *IdentityEncoder) RuneToGlyph(r rune) (GlyphName, bool)

func (*IdentityEncoder) String

func (_geg *IdentityEncoder) String() string

func (*IdentityEncoder) ToPdfObject

func (_dae *IdentityEncoder) ToPdfObject() _f.PdfObject

type SimpleEncoder

type SimpleEncoder interface {
	TextEncoder
	BaseName() string
	Charcodes() []CharCode
}

func ApplyDifferences

func ApplyDifferences(base SimpleEncoder, differences map[CharCode]GlyphName) SimpleEncoder

func NewCustomSimpleTextEncoder

func NewCustomSimpleTextEncoder(encoding, differences map[CharCode]GlyphName) (SimpleEncoder, error)

func NewMacExpertEncoder

func NewMacExpertEncoder() SimpleEncoder

func NewMacRomanEncoder

func NewMacRomanEncoder() SimpleEncoder

func NewPdfDocEncoder

func NewPdfDocEncoder() SimpleEncoder

func NewSimpleTextEncoder

func NewSimpleTextEncoder(baseName string, differences map[CharCode]GlyphName) (SimpleEncoder, error)

func NewStandardEncoder

func NewStandardEncoder() SimpleEncoder

func NewSymbolEncoder

func NewSymbolEncoder() SimpleEncoder

func NewWinAnsiEncoder

func NewWinAnsiEncoder() SimpleEncoder

func NewZapfDingbatsEncoder

func NewZapfDingbatsEncoder() SimpleEncoder

type TextEncoder

type TextEncoder interface {
	String() string
	Encode(_gbf string) []byte
	Decode(_dgd []byte) string
	RuneToCharcode(_fca rune) (CharCode, bool)
	CharcodeToRune(_dcg CharCode) (rune, bool)
	ToPdfObject() _f.PdfObject
}

type TrueTypeFontEncoder

type TrueTypeFontEncoder struct {
	// contains filtered or unexported fields
}

func NewTrueTypeFontEncoder

func NewTrueTypeFontEncoder(runeToGIDMap map[rune]GID) *TrueTypeFontEncoder

func (*TrueTypeFontEncoder) CharcodeToRune

func (_gbd *TrueTypeFontEncoder) CharcodeToRune(code CharCode) (rune, bool)

func (*TrueTypeFontEncoder) Decode

func (_fggc *TrueTypeFontEncoder) Decode(raw []byte) string

func (*TrueTypeFontEncoder) Encode

func (_gef *TrueTypeFontEncoder) Encode(str string) []byte

func (*TrueTypeFontEncoder) GlyphToCharcode

func (_ebc *TrueTypeFontEncoder) GlyphToCharcode(glyph GlyphName) (CharCode, bool)

func (*TrueTypeFontEncoder) RegisteredRunes

func (_cafb *TrueTypeFontEncoder) RegisteredRunes() []rune

func (*TrueTypeFontEncoder) RuneToCharcode

func (_afea *TrueTypeFontEncoder) RuneToCharcode(r rune) (CharCode, bool)

func (*TrueTypeFontEncoder) String

func (_ggac *TrueTypeFontEncoder) String() string

func (*TrueTypeFontEncoder) SubsetRegistered

func (_bee *TrueTypeFontEncoder) SubsetRegistered()

func (*TrueTypeFontEncoder) ToPdfObject

func (_cbcd *TrueTypeFontEncoder) ToPdfObject() _f.PdfObject

type UTF16Encoder

type UTF16Encoder struct {
	// contains filtered or unexported fields
}

func NewUTF16TextEncoder

func NewUTF16TextEncoder(baseName string) UTF16Encoder

func (UTF16Encoder) CharcodeToRune

func (_agd UTF16Encoder) CharcodeToRune(code CharCode) (rune, bool)

func (UTF16Encoder) Decode

func (_fea UTF16Encoder) Decode(raw []byte) string

func (UTF16Encoder) Encode

func (_fbfd UTF16Encoder) Encode(str string) []byte

func (UTF16Encoder) RuneToCharcode

func (_ceab UTF16Encoder) RuneToCharcode(r rune) (CharCode, bool)

func (UTF16Encoder) String

func (_bcae UTF16Encoder) String() string

func (UTF16Encoder) ToPdfObject

func (_fcd UTF16Encoder) ToPdfObject() _f.PdfObject

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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