mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00

* Add packed predefined cmaps * Add cmap cid range parsing * Load base cmap for predefined cmaps * Refactor pdfFont to Unicode methods * Preserve CharcodeBytesToUnicode behavior * Add support for CID-keyed Type 0 fonts * Add method documentation for the cmap package * Refactor and document charcode to Unicode conversion code * Add more cmap parsing test cases * Add more method documentation in the cmap package. * Remove unused code from the bcmaps package * Improve cmap test case * Assume identity when encoder is missing on regenerating field appearance * Add missing encoder log message * Add inverse CMap mappings * Add CMap encoder * Address golint notices and small fix in the cmap package * Keep smaller charcodes when generating cmap inverse mappings * Update extractor test case * Keep latest supplement charcodes/CIDs when computing inverse mappings * Fix comment typo
37 lines
901 B
Go
37 lines
901 B
Go
/*
|
|
* This file is subject to the terms and conditions defined in
|
|
* file 'LICENSE.md', which is part of this source code package.
|
|
*/
|
|
|
|
package cmap
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
// CMap parser errors.
|
|
var (
|
|
ErrBadCMap = errors.New("bad cmap")
|
|
ErrBadCMapComment = errors.New("comment should start with %")
|
|
ErrBadCMapDict = errors.New("invalid dict")
|
|
)
|
|
|
|
const (
|
|
cidSystemInfo = "CIDSystemInfo"
|
|
begincmap = "begincmap"
|
|
endcmap = "endcmap"
|
|
begincodespacerange = "begincodespacerange"
|
|
endcodespacerange = "endcodespacerange"
|
|
beginbfchar = "beginbfchar"
|
|
endbfchar = "endbfchar"
|
|
beginbfrange = "beginbfrange"
|
|
endbfrange = "endbfrange"
|
|
begincidrange = "begincidrange"
|
|
endcidrange = "endcidrange"
|
|
usecmap = "usecmap"
|
|
|
|
cmapname = "CMapName"
|
|
cmaptype = "CMapType"
|
|
cmapversion = "CMapVersion"
|
|
)
|