unipdf/internal/cmap/cmap.go
2021-01-26 01:31:56 +00:00

12 lines
40 KiB
Go

//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
package cmap ;import (_g "bufio";_c "bytes";_ef "encoding/hex";_ce "errors";_d "fmt";_eb "github.com/unidoc/unipdf/v3/common";_ge "github.com/unidoc/unipdf/v3/core";_ed "github.com/unidoc/unipdf/v3/internal/cmap/bcmaps";_f "io";_cea "sort";_b "strconv";_af "strings";_a "unicode/utf16";);func IsPredefinedCMap (name string )bool {return _ed .AssetExists (name )};const (_ecf ="\u0043\u0049\u0044\u0053\u0079\u0073\u0074\u0065\u006d\u0049\u006e\u0066\u006f";_cege ="\u0062e\u0067\u0069\u006e\u0063\u006d\u0061p";_acg ="\u0065n\u0064\u0063\u006d\u0061\u0070";_ecce ="\u0062\u0065\u0067\u0069nc\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0072\u0061\u006e\u0067\u0065";_ddf ="\u0065\u006e\u0064\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065r\u0061\u006e\u0067\u0065";_beda ="b\u0065\u0067\u0069\u006e\u0062\u0066\u0063\u0068\u0061\u0072";_bagc ="\u0065n\u0064\u0062\u0066\u0063\u0068\u0061r";_eag ="\u0062\u0065\u0067i\u006e\u0062\u0066\u0072\u0061\u006e\u0067\u0065";_bbcg ="\u0065\u006e\u0064\u0062\u0066\u0072\u0061\u006e\u0067\u0065";_egd ="\u0062\u0065\u0067\u0069\u006e\u0063\u0069\u0064\u0072\u0061\u006e\u0067\u0065";_caf ="e\u006e\u0064\u0063\u0069\u0064\u0072\u0061\u006e\u0067\u0065";_ffa ="\u0075s\u0065\u0063\u006d\u0061\u0070";_aege ="\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065";_fbe ="\u0043\u004d\u0061\u0070\u0054\u0079\u0070\u0065";_cefa ="C\u004d\u0061\u0070\u0056\u0065\u0072\u0073\u0069\u006f\u006e";);func LoadPredefinedCMap (name string )(*CMap ,error ){cmap ,_ceb :=_dg (name );if _ceb !=nil {return nil ,_ceb ;};if cmap ._ba ==""{cmap .computeInverseMappings ();return cmap ,nil ;};_ebg ,_ceb :=_dg (cmap ._ba );if _ceb !=nil {return nil ,_ceb ;};for _gdg ,_cec :=range _ebg ._ac {if _ ,_gf :=cmap ._ac [_gdg ];!_gf {cmap ._ac [_gdg ]=_cec ;};};cmap ._eef =append (cmap ._eef ,_ebg ._eef ...);cmap .computeInverseMappings ();return cmap ,nil ;};func (cmap *CMap )Bytes ()[]byte {_eb .Log .Trace ("\u0063\u006d\u0061\u0070.B\u0079\u0074\u0065\u0073\u003a\u0020\u0063\u006d\u0061\u0070\u003d\u0025\u0073",cmap .String ());if len (cmap ._df )> 0{return cmap ._df ;};cmap ._df =[]byte (_af .Join ([]string {_bgda ,cmap .toBfData (),_fgdb },"\u000a"));return cmap ._df ;};func _efac (_bde cmapHexString )[]rune {if len (_bde ._bcdb )==1{return []rune {rune (_bde ._bcdb [0])};};_agg :=_bde ._bcdb ;if len (_agg )%2!=0{_agg =append (_agg ,0);_eb .Log .Debug ("\u0045\u0052\u0052O\u0052\u003a\u0020\u0068\u0065\u0078\u0054\u006f\u0052\u0075\u006e\u0065\u0073\u002e\u0020\u0050\u0061\u0064\u0064\u0069\u006e\u0067\u0020\u0073\u0068\u0065\u0078\u003d\u0025#\u0076\u0020\u0074\u006f\u0020\u0025\u002b\u0076",_bde ,_agg );};_gfaa :=len (_agg )>>1;_eeef :=make ([]uint16 ,_gfaa );for _cgec :=0;_cgec < _gfaa ;_cgec ++{_eeef [_cgec ]=uint16 (_agg [_cgec <<1])<<8+uint16 (_agg [_cgec <<1+1]);};_bgbe :=_a .Decode (_eeef );return _bgbe ;};func LoadCmapFromDataCID (data []byte )(*CMap ,error ){return LoadCmapFromData (data ,false )};func (cmap *CMap )CharcodeToUnicode (code CharCode )(string ,bool ){if _aadc ,_ggd :=cmap ._eed [code ];_ggd {return _aadc ,true ;};return MissingCodeString ,false ;};func (cmap *CMap )Stream ()(*_ge .PdfObjectStream ,error ){if cmap ._dff !=nil {return cmap ._dff ,nil ;};_agb ,_gda :=_ge .MakeStream (cmap .Bytes (),_ge .NewFlateEncoder ());if _gda !=nil {return nil ,_gda ;};cmap ._dff =_agb ;return cmap ._dff ,nil ;};func (cmap *CMap )CIDToCharcode (cid CharCode )(CharCode ,bool ){_aec ,_bab :=cmap ._egf [cid ];return _aec ,_bab ;};type cmapArray struct{Array []cmapObject ;};func (cmap *CMap )parseName ()error {_eda :="";_afc :=false ;for _agbf :=0;_agbf < 20&&!_afc ;_agbf ++{_bef ,_afb :=cmap .parseObject ();if _afb !=nil {return _afb ;};switch _bbcb :=_bef .(type ){case cmapOperand :switch _bbcb .Operand {case "\u0064\u0065\u0066":_afc =true ;default:_eb .Log .Debug ("\u0070\u0061\u0072\u0073\u0065\u004e\u0061\u006d\u0065\u003a\u0020\u0053\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020o\u003d\u0025\u0023\u0076\u0020n\u0061\u006de\u003d\u0025\u0023\u0071",_bef ,_eda );if _eda !=""{_eda =_d .Sprintf ("\u0025\u0073\u0020%\u0073",_eda ,_bbcb .Operand );};_eb .Log .Debug ("\u0070\u0061\u0072\u0073\u0065\u004e\u0061\u006d\u0065\u003a \u0052\u0065\u0063\u006f\u0076\u0065\u0072e\u0064\u002e\u0020\u006e\u0061\u006d\u0065\u003d\u0025\u0023\u0071",_eda );};case cmapName :_eda =_bbcb .Name ;};};if !_afc {_eb .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0070\u0061\u0072\u0073\u0065N\u0061m\u0065:\u0020\u004e\u006f\u0020\u0064\u0065\u0066 ");return ErrBadCMap ;};cmap ._gce =_eda ;return nil ;};func _aa (_bb bool )*CMap {_fe :=16;if _bb {_fe =8;};return &CMap {_ee :_fe ,_ac :make (map[CharCode ]CharCode ),_egf :make (map[CharCode ]CharCode ),_eed :make (map[CharCode ]string ),_ega :make (map[string ]CharCode )};};func (cmap *CMap )CharcodeBytesToUnicode (data []byte )(string ,int ){_bgd ,_bbcc :=cmap .BytesToCharcodes (data );if !_bbcc {_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0043\u0068\u0061\u0072\u0063\u006f\u0064\u0065\u0042\u0079\u0074\u0065s\u0054\u006f\u0055\u006e\u0069\u0063\u006f\u0064\u0065\u002e\u0020\u004e\u006f\u0074\u0020\u0069n\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u002e\u0020\u0064\u0061\u0074\u0061\u003d\u005b\u0025\u0020\u0030\u0032\u0078]\u0020\u0063\u006d\u0061\u0070=\u0025\u0073",data ,cmap );return "",0;};_gbfa :=make ([]string ,len (_bgd ));var _dcf []CharCode ;for _aca ,_fcg :=range _bgd {_bac ,_fee :=cmap ._eed [_fcg ];if !_fee {_dcf =append (_dcf ,_fcg );_bac =MissingCodeString ;};_gbfa [_aca ]=_bac ;};_ae :=_af .Join (_gbfa ,"");if len (_dcf )> 0{_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020C\u0068\u0061\u0072c\u006f\u0064\u0065\u0042y\u0074\u0065\u0073\u0054\u006f\u0055\u006e\u0069\u0063\u006f\u0064\u0065\u002e\u0020\u004e\u006f\u0074\u0020\u0069\u006e\u0020\u006d\u0061\u0070\u002e\u000a"+"\u0009d\u0061t\u0061\u003d\u005b\u0025\u00200\u0032\u0078]\u003d\u0025\u0023\u0071\u000a"+"\u0009\u0063h\u0061\u0072\u0063o\u0064\u0065\u0073\u003d\u0025\u0030\u0032\u0078\u000a"+"\u0009\u006d\u0069\u0073\u0073\u0069\u006e\u0067\u003d\u0025\u0064\u0020%\u0030\u0032\u0078\u000a"+"\u0009\u0075\u006e\u0069\u0063\u006f\u0064\u0065\u003d`\u0025\u0073\u0060\u000a"+"\u0009\u0063\u006d\u0061\u0070\u003d\u0025\u0073",data ,string (data ),_bgd ,len (_dcf ),_dcf ,_ae ,cmap );};return _ae ,len (_dcf );};func _cfc (_fceg string )string {_fgg :=[]rune (_fceg );_dad :=make ([]string ,len (_fgg ));for _aeg ,_beg :=range _fgg {_dad [_aeg ]=_d .Sprintf ("\u0025\u0030\u0034\u0078",_beg );};return _d .Sprintf ("\u003c\u0025\u0073\u003e",_af .Join (_dad ,""));};type cmapName struct{Name string ;};func _dg (_cgb string )(*CMap ,error ){_aad ,_aac :=_ed .Asset (_cgb );if _aac !=nil {return nil ,_aac ;};return LoadCmapFromDataCID (_aad );};func (cmap *CMap )String ()string {_edc :=cmap ._eg ;_dgc :=[]string {_d .Sprintf ("\u006e\u0062\u0069\u0074\u0073\u003a\u0025\u0064",cmap ._ee ),_d .Sprintf ("\u0074y\u0070\u0065\u003a\u0025\u0064",cmap ._dcb )};if cmap ._eaa !=""{_dgc =append (_dgc ,_d .Sprintf ("\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003a\u0025\u0073",cmap ._eaa ));};if cmap ._ba !=""{_dgc =append (_dgc ,_d .Sprintf ("u\u0073\u0065\u0063\u006d\u0061\u0070\u003a\u0025\u0023\u0071",cmap ._ba ));};_dgc =append (_dgc ,_d .Sprintf ("\u0073\u0079\u0073\u0074\u0065\u006d\u0049\u006e\u0066\u006f\u003a\u0025\u0073",_edc .String ()));if len (cmap ._eef )> 0{_dgc =append (_dgc ,_d .Sprintf ("\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u003a\u0025\u0064",len (cmap ._eef )));};if len (cmap ._eed )> 0{_dgc =append (_dgc ,_d .Sprintf ("\u0063\u006fd\u0065\u0054\u006fU\u006e\u0069\u0063\u006f\u0064\u0065\u003a\u0025\u0064",len (cmap ._eed )));};return _d .Sprintf ("\u0043\u004d\u0041P\u007b\u0025\u0023\u0071\u0020\u0025\u0073\u007d",cmap ._gce ,_af .Join (_dgc ,"\u0020"));};func (cmap *CMap )Name ()string {return cmap ._gce };type cMapParser struct{_ebee *_g .Reader };func (cmap *CMap )inCodespace (_fef CharCode ,_eba int )bool {for _ ,_abe :=range cmap ._eef {if _abe .Low <=_fef &&_fef <=_abe .High &&_eba ==_abe .NumBytes {return true ;};};return false ;};func (cmap *CMap )matchCode (_cecf []byte )(_fd CharCode ,_egfc int ,_bed bool ){for _bdf :=0;_bdf < _gd ;_bdf ++{if _bdf < len (_cecf ){_fd =_fd <<8|CharCode (_cecf [_bdf ]);_egfc ++;};_bed =cmap .inCodespace (_fd ,_bdf +1);if _bed {return _fd ,_egfc ,true ;};};_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063o\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0020m\u0061t\u0063\u0068\u0065\u0073\u0020\u0062\u0079\u0074\u0065\u0073\u003d\u005b\u0025\u0020\u0030\u0032\u0078\u005d=\u0025\u0023\u0071\u0020\u0063\u006d\u0061\u0070\u003d\u0025\u0073",_cecf ,string (_cecf ),cmap );return 0,0,false ;};type CharCode uint32 ;type cmapString struct{String string ;};type cmapInt struct{_ade int64 };func (cmap *CMap )NBits ()int {return cmap ._ee };func (cmap *CMap )toBfData ()string {if len (cmap ._eed )==0{return "";};_ege :=make ([]CharCode ,0,len (cmap ._eed ));for _bge :=range cmap ._eed {_ege =append (_ege ,_bge );};_cea .Slice (_ege ,func (_gcga ,_fgd int )bool {return _ege [_gcga ]< _ege [_fgd ]});var _gbb []charRange ;_eea :=charRange {_ege [0],_ege [0]};_babe :=cmap ._eed [_ege [0]];for _ ,_daa :=range _ege [1:]{_dcfc :=cmap ._eed [_daa ];if _daa ==_eea ._cd +1&&_fda (_dcfc )==_fda (_babe )+1{_eea ._cd =_daa ;}else {_gbb =append (_gbb ,_eea );_eea ._ea ,_eea ._cd =_daa ,_daa ;};_babe =_dcfc ;};_gbb =append (_gbb ,_eea );var _aadb []CharCode ;var _fag []fbRange ;for _ ,_cff :=range _gbb {if _cff ._ea ==_cff ._cd {_aadb =append (_aadb ,_cff ._ea );}else {_fag =append (_fag ,fbRange {_ga :_cff ._ea ,_ad :_cff ._cd ,_gc :cmap ._eed [_cff ._ea ]});};};_eb .Log .Trace ("\u0063\u0068ar\u0052\u0061\u006eg\u0065\u0073\u003d\u0025d f\u0062Ch\u0061\u0072\u0073\u003d\u0025\u0064\u0020fb\u0052\u0061\u006e\u0067\u0065\u0073\u003d%\u0064",len (_gbb ),len (_aadb ),len (_fag ));var _ace []string ;if len (_aadb )> 0{_deb :=(len (_aadb )+_fcgc -1)/_fcgc ;for _fac :=0;_fac < _deb ;_fac ++{_fce :=_fed (len (_aadb )-_fac *_fcgc ,_fcgc );_ace =append (_ace ,_d .Sprintf ("\u0025\u0064\u0020\u0062\u0065\u0067\u0069\u006e\u0062f\u0063\u0068\u0061\u0072",_fce ));for _bdbf :=0;_bdbf < _fce ;_bdbf ++{_cca :=_aadb [_fac *_fcgc +_bdbf ];_fea :=cmap ._eed [_cca ];_ace =append (_ace ,_d .Sprintf ("\u003c%\u0030\u0034\u0078\u003e\u0020\u0025s",_cca ,_cfc (_fea )));};_ace =append (_ace ,"\u0065n\u0064\u0062\u0066\u0063\u0068\u0061r");};};if len (_fag )> 0{_ccd :=(len (_fag )+_fcgc -1)/_fcgc ;for _eeb :=0;_eeb < _ccd ;_eeb ++{_aea :=_fed (len (_fag )-_eeb *_fcgc ,_fcgc );_ace =append (_ace ,_d .Sprintf ("\u0025d\u0020b\u0065\u0067\u0069\u006e\u0062\u0066\u0072\u0061\u006e\u0067\u0065",_aea ));for _egc :=0;_egc < _aea ;_egc ++{_dd :=_fag [_eeb *_fcgc +_egc ];_ace =append (_ace ,_d .Sprintf ("\u003c%\u00304\u0078\u003e\u003c\u0025\u0030\u0034\u0078\u003e\u0020\u0025\u0073",_dd ._ga ,_dd ._ad ,_cfc (_dd ._gc )));};_ace =append (_ace ,"\u0065\u006e\u0064\u0062\u0066\u0072\u0061\u006e\u0067\u0065");};};return _af .Join (_ace ,"\u000a");};type cmapFloat struct{_babed float64 };func (_efdc *cMapParser )parseDict ()(cmapDict ,error ){_eb .Log .Trace ("\u0052\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0050\u0044\u0046\u0020D\u0069\u0063\u0074\u0021");_affb :=_gbd ();_cda ,_ :=_efdc ._ebee .ReadByte ();if _cda !='<'{return _affb ,ErrBadCMapDict ;};_cda ,_ =_efdc ._ebee .ReadByte ();if _cda !='<'{return _affb ,ErrBadCMapDict ;};for {_efdc .skipSpaces ();_agfc ,_bda :=_efdc ._ebee .Peek (2);if _bda !=nil {return _affb ,_bda ;};if (_agfc [0]=='>')&&(_agfc [1]=='>'){_efdc ._ebee .ReadByte ();_efdc ._ebee .ReadByte ();break ;};_cegd ,_bda :=_efdc .parseName ();_eb .Log .Trace ("\u004be\u0079\u003a\u0020\u0025\u0073",_cegd .Name );if _bda !=nil {_eb .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u0052\u0065\u0074\u0075\u0072\u006e\u0069\u006e\u0067\u0020\u006e\u0061\u006d\u0065\u002e\u0020\u0065\u0072r=\u0025\u0076",_bda );return _affb ,_bda ;};_efdc .skipSpaces ();_ffcd ,_bda :=_efdc .parseObject ();if _bda !=nil {return _affb ,_bda ;};_affb .Dict [_cegd .Name ]=_ffcd ;_efdc .skipSpaces ();_agfc ,_bda =_efdc ._ebee .Peek (3);if _bda !=nil {return _affb ,_bda ;};if string (_agfc )=="\u0064\u0065\u0066"{_efdc ._ebee .Discard (3);};};return _affb ,nil ;};func (cmap *CMap )parseCodespaceRange ()error {for {_egb ,_gee :=cmap .parseObject ();if _gee !=nil {if _gee ==_f .EOF {break ;};return _gee ;};_gea ,_befd :=_egb .(cmapHexString );if !_befd {if _ecd ,_bgb :=_egb .(cmapOperand );_bgb {if _ecd .Operand ==_ddf {return nil ;};return _ce .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");};};_egb ,_gee =cmap .parseObject ();if _gee !=nil {if _gee ==_f .EOF {break ;};return _gee ;};_bbd ,_befd :=_egb .(cmapHexString );if !_befd {return _ce .New ("\u006e\u006f\u006e-\u0068\u0065\u0078\u0020\u0068\u0069\u0067\u0068");};if len (_gea ._bcdb )!=len (_bbd ._bcdb ){return _ce .New ("\u0075\u006e\u0065\u0071\u0075\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072\u0020o\u0066 \u0062\u0079\u0074\u0065\u0073\u0020\u0069\u006e\u0020\u0072\u0061\u006e\u0067\u0065");};_dcdc :=_baeg (_gea );_dbab :=_baeg (_bbd );if _dbab < _dcdc {_eb .Log .Debug ("\u0045R\u0052\u004fR\u003a\u0020\u0042\u0061d\u0020\u0063\u006fd\u0065\u0073\u0070\u0061\u0063\u0065\u002e\u0020\u006cow\u003d\u0030\u0078%\u0030\u0032x\u0020\u0068\u0069\u0067\u0068\u003d0\u0078\u00250\u0032\u0078",_dcdc ,_dbab );return ErrBadCMap ;};_cfd :=_bbd ._dgdd ;_bcd :=Codespace {NumBytes :_cfd ,Low :_dcdc ,High :_dbab };cmap ._eef =append (cmap ._eef ,_bcd );_eb .Log .Trace ("\u0043\u006f\u0064e\u0073\u0070\u0061\u0063e\u0020\u006c\u006f\u0077\u003a\u0020\u0030x\u0025\u0058\u002c\u0020\u0068\u0069\u0067\u0068\u003a\u0020\u0030\u0078\u0025\u0058",_dcdc ,_dbab );};if len (cmap ._eef )==0{_eb .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u0020\u0069\u006e\u0020\u0063ma\u0070\u002e");return ErrBadCMap ;};return nil ;};func (cmap *CMap )CharcodeToCID (code CharCode )(CharCode ,bool ){_bdbd ,_cc :=cmap ._ac [code ];return _bdbd ,_cc ;};var (ErrBadCMap =_ce .New ("\u0062\u0061\u0064\u0020\u0063\u006d\u0061\u0070");ErrBadCMapComment =_ce .New ("c\u006f\u006d\u006d\u0065\u006e\u0074 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074a\u0072\u0074\u0020w\u0069t\u0068\u0020\u0025");ErrBadCMapDict =_ce .New ("\u0069\u006e\u0076a\u006c\u0069\u0064\u0020\u0064\u0069\u0063\u0074"););func (cmap *CMap )computeInverseMappings (){for _ede ,_bc :=range cmap ._ac {if _ec ,_de :=cmap ._egf [_bc ];!_de ||(_de &&_ec > _ede ){cmap ._egf [_bc ]=_ede ;};};for _dec ,_ff :=range cmap ._eed {if _bgc ,_fa :=cmap ._ega [_ff ];!_fa ||(_fa &&_bgc > _dec ){cmap ._ega [_ff ]=_dec ;};};_cea .Slice (cmap ._eef ,func (_ded ,_gcee int )bool {return cmap ._eef [_ded ].Low < cmap ._eef [_gcee ].Low });};const (_fcgc =100;_bgda ="\u000a\u002f\u0043\u0049\u0044\u0049\u006e\u0069\u0074\u0020\u002f\u0050\u0072\u006fc\u0053\u0065\u0074\u0020\u0066\u0069\u006e\u0064\u0072es\u006fu\u0072c\u0065 \u0062\u0065\u0067\u0069\u006e\u000a\u0031\u0032\u0020\u0064\u0069\u0063\u0074\u0020\u0062\u0065\u0067\u0069n\u000a\u0062\u0065\u0067\u0069\u006e\u0063\u006d\u0061\u0070\n\u002f\u0043\u0049\u0044\u0053\u0079\u0073\u0074\u0065m\u0049\u006e\u0066\u006f\u0020\u003c\u003c\u0020\u002f\u0052\u0065\u0067\u0069\u0073t\u0072\u0079\u0020\u0028\u0041\u0064\u006f\u0062\u0065\u0029\u0020\u002f\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067\u0020\u0028\u0055\u0043\u0053)\u0020\u002f\u0053\u0075\u0070p\u006c\u0065\u006d\u0065\u006et\u0020\u0030\u0020\u003e\u003e\u0020\u0064\u0065\u0066\u000a\u002f\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065\u0020\u002f\u0041\u0064\u006f\u0062\u0065-\u0049\u0064\u0065\u006e\u0074\u0069\u0074\u0079\u002d\u0055\u0043\u0053\u0020\u0064\u0065\u0066\u000a\u002fC\u004d\u0061\u0070\u0054\u0079\u0070\u0065\u0020\u0032\u0020\u0064\u0065\u0066\u000a\u0031\u0020\u0062\u0065\u0067\u0069\u006e\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063e\u0072\u0061n\u0067\u0065\n\u003c\u0030\u0030\u0030\u0030\u003e\u0020<\u0046\u0046\u0046\u0046\u003e\u000a\u0065\u006e\u0064\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065r\u0061\u006e\u0067\u0065\u000a";_fgdb ="\u0065\u006e\u0064\u0063\u006d\u0061\u0070\u000a\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065\u0020\u0063ur\u0072e\u006e\u0074\u0064\u0069\u0063\u0074\u0020\u002f\u0043\u004d\u0061\u0070 \u0064\u0065\u0066\u0069\u006e\u0065\u0072\u0065\u0073\u006f\u0075\u0072\u0063\u0065\u0020\u0070\u006fp\u000a\u0065\u006e\u0064\u000a\u0065\u006e\u0064\u000a";);func _baeg (_ebb cmapHexString )CharCode {_bgdgf :=CharCode (0);for _ ,_bfg :=range _ebb ._bcdb {_bgdgf <<=8;_bgdgf |=CharCode (_bfg );};return _bgdgf ;};func (_decc *cMapParser )parseString ()(cmapString ,error ){_decc ._ebee .ReadByte ();_fcd :=_c .Buffer {};_gac :=1;for {_baa ,_afae :=_decc ._ebee .Peek (1);if _afae !=nil {return cmapString {_fcd .String ()},_afae ;};if _baa [0]=='\\'{_decc ._ebee .ReadByte ();_cfa ,_efd :=_decc ._ebee .ReadByte ();if _efd !=nil {return cmapString {_fcd .String ()},_efd ;};if _ge .IsOctalDigit (_cfa ){_agd ,_ccf :=_decc ._ebee .Peek (2);if _ccf !=nil {return cmapString {_fcd .String ()},_ccf ;};var _ceaf []byte ;_ceaf =append (_ceaf ,_cfa );for _ ,_fga :=range _agd {if _ge .IsOctalDigit (_fga ){_ceaf =append (_ceaf ,_fga );}else {break ;};};_decc ._ebee .Discard (len (_ceaf )-1);_eb .Log .Trace ("\u004e\u0075\u006d\u0065ri\u0063\u0020\u0073\u0074\u0072\u0069\u006e\u0067\u0020\u0022\u0025\u0073\u0022",_ceaf );_adb ,_ccf :=_b .ParseUint (string (_ceaf ),8,32);if _ccf !=nil {return cmapString {_fcd .String ()},_ccf ;};_fcd .WriteByte (byte (_adb ));continue ;};switch _cfa {case 'n':_fcd .WriteByte ('\n');case 'r':_fcd .WriteByte ('\r');case 't':_fcd .WriteByte ('\t');case 'b':_fcd .WriteByte ('\b');case 'f':_fcd .WriteByte ('\f');case '(':_fcd .WriteByte ('(');case ')':_fcd .WriteByte (')');case '\\':_fcd .WriteByte ('\\');};continue ;}else if _baa [0]=='('{_gac ++;}else if _baa [0]==')'{_gac --;if _gac ==0{_decc ._ebee .ReadByte ();break ;};};_fdc ,_ :=_decc ._ebee .ReadByte ();_fcd .WriteByte (_fdc );};return cmapString {_fcd .String ()},nil ;};func (_def *cMapParser )parseComment ()(string ,error ){var _aece _c .Buffer ;_ ,_ceef :=_def .skipSpaces ();if _ceef !=nil {return _aece .String (),_ceef ;};_bafg :=true ;for {_gdb ,_cgcb :=_def ._ebee .Peek (1);if _cgcb !=nil {_eb .Log .Debug ("p\u0061r\u0073\u0065\u0043\u006f\u006d\u006d\u0065\u006et\u003a\u0020\u0065\u0072r=\u0025\u0076",_cgcb );return _aece .String (),_cgcb ;};if _bafg &&_gdb [0]!='%'{return _aece .String (),ErrBadCMapComment ;};_bafg =false ;if (_gdb [0]!='\r')&&(_gdb [0]!='\n'){_dce ,_ :=_def ._ebee .ReadByte ();_aece .WriteByte (_dce );}else {break ;};};return _aece .String (),nil ;};func (_abad *cMapParser )parseObject ()(cmapObject ,error ){_abad .skipSpaces ();for {_agc ,_dagb :=_abad ._ebee .Peek (2);if _dagb !=nil {return nil ,_dagb ;};if _agc [0]=='%'{_abad .parseComment ();_abad .skipSpaces ();continue ;}else if _agc [0]=='/'{_fab ,_bcg :=_abad .parseName ();return _fab ,_bcg ;}else if _agc [0]=='('{_dfe ,_fca :=_abad .parseString ();return _dfe ,_fca ;}else if _agc [0]=='['{_egee ,_ceac :=_abad .parseArray ();return _egee ,_ceac ;}else if (_agc [0]=='<')&&(_agc [1]=='<'){_cba ,_aeb :=_abad .parseDict ();return _cba ,_aeb ;}else if _agc [0]=='<'{_afbb ,_gdd :=_abad .parseHexString ();return _afbb ,_gdd ;}else if _ge .IsDecimalDigit (_agc [0])||(_agc [0]=='-'&&_ge .IsDecimalDigit (_agc [1])){_fege ,_egdg :=_abad .parseNumber ();if _egdg !=nil {return nil ,_egdg ;};return _fege ,nil ;}else {_gdaf ,_dca :=_abad .parseOperand ();if _dca !=nil {return nil ,_dca ;};return _gdaf ,nil ;};};};type fbRange struct{_ga CharCode ;_ad CharCode ;_gc string ;};func (_cfg *cMapParser )parseArray ()(cmapArray ,error ){_bccf :=cmapArray {};_bccf .Array =[]cmapObject {};_cfg ._ebee .ReadByte ();for {_cfg .skipSpaces ();_gcef ,_bga :=_cfg ._ebee .Peek (1);if _bga !=nil {return _bccf ,_bga ;};if _gcef [0]==']'{_cfg ._ebee .ReadByte ();break ;};_fega ,_bga :=_cfg .parseObject ();if _bga !=nil {return _bccf ,_bga ;};_bccf .Array =append (_bccf .Array ,_fega );};return _bccf ,nil ;};type cmapDict struct{Dict map[string ]cmapObject ;};func (cmap *CMap )parseSystemInfo ()error {_ceg :=false ;_cce :=false ;_fgdd :="";_egaf :=false ;_bgf :=CIDSystemInfo {};for _egag :=0;_egag < 50&&!_egaf ;_egag ++{_feb ,_ffc :=cmap .parseObject ();if _ffc !=nil {return _ffc ;};switch _aaa :=_feb .(type ){case cmapDict :_fbd :=_aaa .Dict ;_bad ,_afe :=_fbd ["\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079"];if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_ebf ,_afe :=_bad .(cmapString );if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bgf .Registry =_ebf .String ;_bad ,_afe =_fbd ["\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067"];if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_ebf ,_afe =_bad .(cmapString );if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bgf .Ordering =_ebf .String ;_gbfge ,_afe :=_fbd ["\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074"];if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_ebaf ,_afe :=_gbfge .(cmapInt );if !_afe {_eb .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bgf .Supplement =int (_ebaf ._ade );_egaf =true ;case cmapOperand :switch _aaa .Operand {case "\u0062\u0065\u0067i\u006e":_ceg =true ;case "\u0065\u006e\u0064":_egaf =true ;case "\u0064\u0065\u0066":_cce =false ;};case cmapName :if _ceg {_fgdd =_aaa .Name ;_cce =true ;};case cmapString :if _cce {switch _fgdd {case "\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079":_bgf .Registry =_aaa .String ;case "\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067":_bgf .Ordering =_aaa .String ;};};case cmapInt :if _cce {switch _fgdd {case "\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074":_bgf .Supplement =int (_aaa ._ade );};};};};if !_egaf {_eb .Log .Debug ("\u0045\u0052\u0052O\u0052\u003a\u0020\u0050\u0061\u0072\u0073\u0065\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006e\u0066\u006f\u0020\u0064\u0069\u0063\u0074\u0020\u0069\u006ec\u006f\u0072\u0072\u0065\u0063\u0074\u006c\u0079");return ErrBadCMap ;};cmap ._eg =_bgf ;return nil ;};func _fda (_deg string )rune {_ccb :=[]rune (_deg );return _ccb [len (_ccb )-1]};func (_eaf *cMapParser )parseNumber ()(cmapObject ,error ){_efa ,_gcf :=_ge .ParseNumber (_eaf ._ebee );if _gcf !=nil {return nil ,_gcf ;};switch _eae :=_efa .(type ){case *_ge .PdfObjectFloat :return cmapFloat {float64 (*_eae )},nil ;case *_ge .PdfObjectInteger :return cmapInt {int64 (*_eae )},nil ;};return nil ,_d .Errorf ("\u0075n\u0068\u0061\u006e\u0064\u006c\u0065\u0064\u0020\u006e\u0075\u006db\u0065\u0072\u0020\u0074\u0079\u0070\u0065\u0020\u0025\u0054",_efa );};func _efc (_cdb cmapHexString )rune {_aebb :=_efac (_cdb );if _aga :=len (_aebb );_aga ==0{_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0068\u0065\u0078\u0054o\u0052\u0075\u006e\u0065\u002e\u0020\u0045\u0078p\u0065c\u0074\u0065\u0064\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0072u\u006e\u0065\u0020\u0073\u0068\u0065\u0078\u003d\u0025\u0023\u0076",_cdb );return MissingCodeRune ;};if len (_aebb )> 1{_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0068\u0065\u0078\u0054\u006f\u0052\u0075\u006e\u0065\u002e\u0020\u0045\u0078p\u0065\u0063\u0074\u0065\u0064\u0020\u0065\u0078\u0061\u0063\u0074\u006c\u0079\u0020\u006f\u006e\u0065\u0020\u0072\u0075\u006e\u0065\u0020\u0073\u0068\u0065\u0078\u003d\u0025\u0023v\u0020\u002d\u003e\u0020\u0025#\u0076",_cdb ,_aebb );};return _aebb [0];};func (_agf *cMapParser )skipSpaces ()(int ,error ){_gae :=0;for {_ddc ,_bce :=_agf ._ebee .Peek (1);if _bce !=nil {return 0,_bce ;};if _ge .IsWhiteSpace (_ddc [0]){_agf ._ebee .ReadByte ();_gae ++;}else {break ;};};return _gae ,nil ;};type CIDSystemInfo struct{Registry string ;Ordering string ;Supplement int ;};func (cmap *CMap )parseType ()error {_aff :=0;_bbfc :=false ;for _dba :=0;_dba < 3&&!_bbfc ;_dba ++{_bfc ,_bcc :=cmap .parseObject ();if _bcc !=nil {return _bcc ;};switch _gceea :=_bfc .(type ){case cmapOperand :switch _gceea .Operand {case "\u0064\u0065\u0066":_bbfc =true ;default:_eb .Log .Error ("\u0070\u0061r\u0073\u0065\u0054\u0079\u0070\u0065\u003a\u0020\u0073\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020\u006f=%\u0023\u0076",_bfc );return ErrBadCMap ;};case cmapInt :_aff =int (_gceea ._ade );};};cmap ._dcb =_aff ;return nil ;};func (_eccc *cMapParser )parseName ()(cmapName ,error ){_baga :="";_acbc :=false ;for {_afea ,_gefb :=_eccc ._ebee .Peek (1);if _gefb ==_f .EOF {break ;};if _gefb !=nil {return cmapName {_baga },_gefb ;};if !_acbc {if _afea [0]=='/'{_acbc =true ;_eccc ._ebee .ReadByte ();}else {_eb .Log .Debug ("\u0045\u0052\u0052OR\u003a\u0020\u004e\u0061\u006d\u0065\u0020\u0073\u0074a\u0072t\u0069n\u0067 \u0077\u0069\u0074\u0068\u0020\u0025\u0073\u0020\u0028\u0025\u0020\u0078\u0029",_afea ,_afea );return cmapName {_baga },_d .Errorf ("\u0069n\u0076a\u006c\u0069\u0064\u0020\u006ea\u006d\u0065:\u0020\u0028\u0025\u0063\u0029",_afea [0]);};}else {if _ge .IsWhiteSpace (_afea [0]){break ;}else if (_afea [0]=='/')||(_afea [0]=='[')||(_afea [0]=='(')||(_afea [0]==']')||(_afea [0]=='<')||(_afea [0]=='>'){break ;}else if _afea [0]=='#'{_bgcg ,_caa :=_eccc ._ebee .Peek (3);if _caa !=nil {return cmapName {_baga },_caa ;};_eccc ._ebee .Discard (3);_acgb ,_caa :=_ef .DecodeString (string (_bgcg [1:3]));if _caa !=nil {return cmapName {_baga },_caa ;};_baga +=string (_acgb );}else {_ggb ,_ :=_eccc ._ebee .ReadByte ();_baga +=string (_ggb );};};};return cmapName {_baga },nil ;};func (_agff *cMapParser )parseOperand ()(cmapOperand ,error ){_aef :=cmapOperand {};_ffcda :=_c .Buffer {};for {_fbb ,_ecceg :=_agff ._ebee .Peek (1);if _ecceg !=nil {if _ecceg ==_f .EOF {break ;};return _aef ,_ecceg ;};if _ge .IsDelimiter (_fbb [0]){break ;};if _ge .IsWhiteSpace (_fbb [0]){break ;};_gfd ,_ :=_agff ._ebee .ReadByte ();_ffcda .WriteByte (_gfd );};if _ffcda .Len ()==0{return _aef ,_d .Errorf ("\u0069\u006e\u0076al\u0069\u0064\u0020\u006f\u0070\u0065\u0072\u0061\u006e\u0064\u0020\u0028\u0065\u006d\u0070\u0074\u0079\u0029");};_aef .Operand =_ffcda .String ();return _aef ,nil ;};func (cmap *CMap )BytesToCharcodes (data []byte )([]CharCode ,bool ){var _aae []CharCode ;if cmap ._ee ==8{for _ ,_faa :=range data {_aae =append (_aae ,CharCode (_faa ));};return _aae ,true ;};for _gga :=0;_gga < len (data );{_bbb ,_gef ,_ebgb :=cmap .matchCode (data [_gga :]);if !_ebgb {_eb .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0061\u0074\u0020\u0069\u003d\u0025\u0064\u0020\u0062\u0079\u0074\u0065\u0073\u003d\u005b\u0025\u0020\u0030\u0032\u0078\u005d\u003d\u0025\u0023\u0071",_gga ,data ,string (data ));return _aae ,false ;};_aae =append (_aae ,_bbb );_gga +=_gef ;};return _aae ,true ;};func _gfad (_faf []byte )*cMapParser {_ecdf :=cMapParser {};_abdg :=_c .NewBuffer (_faf );_ecdf ._ebee =_g .NewReader (_abdg );return &_ecdf ;};func _fed (_gaed ,_gfb int )int {if _gaed < _gfb {return _gaed ;};return _gfb ;};func (cmap *CMap )parseBfchar ()error {for {_dag ,_ece :=cmap .parseObject ();if _ece !=nil {if _ece ==_f .EOF {break ;};return _ece ;};var _dbae CharCode ;switch _ca :=_dag .(type ){case cmapOperand :if _ca .Operand ==_bagc {return nil ;};return _ce .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");case cmapHexString :_dbae =_baeg (_ca );default:return _ce .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0074\u0079\u0070\u0065");};_dag ,_ece =cmap .parseObject ();if _ece !=nil {if _ece ==_f .EOF {break ;};return _ece ;};var _bag []rune ;switch _bae :=_dag .(type ){case cmapOperand :if _bae .Operand ==_bagc {return nil ;};_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0055\u006e\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020o\u0070\u0065\u0072\u0061\u006e\u0064\u002e\u0020\u0025\u0023\u0076",_bae );return ErrBadCMap ;case cmapHexString :_bag =_efac (_bae );case cmapName :_eb .Log .Debug ("E\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064 \u006e\u0061\u006de\u002e \u0025\u0023\u0076",_bae );_bag =[]rune {MissingCodeRune };default:_eb .Log .Debug ("E\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064 \u0074\u0079\u0070e\u002e \u0025\u0023\u0076",_dag );return ErrBadCMap ;};cmap ._eed [_dbae ]=string (_bag );};return nil ;};type CMap struct{*cMapParser ;_gce string ;_ee int ;_dcb int ;_eaa string ;_ba string ;_eg CIDSystemInfo ;_eef []Codespace ;_ac map[CharCode ]CharCode ;_egf map[CharCode ]CharCode ;_eed map[CharCode ]string ;_ega map[string ]CharCode ;_df []byte ;_dff *_ge .PdfObjectStream ;};type cmapObject interface{};const (_gd =4;MissingCodeRune ='\ufffd';MissingCodeString =string (MissingCodeRune ););type charRange struct{_ea CharCode ;_cd CharCode ;};func LoadCmapFromData (data []byte ,isSimple bool )(*CMap ,error ){_eb .Log .Trace ("\u004c\u006fa\u0064\u0043\u006d\u0061\u0070\u0046\u0072\u006f\u006d\u0044\u0061\u0074\u0061\u003a\u0020\u0069\u0073\u0053\u0069\u006d\u0070\u006ce=\u0025\u0074",isSimple );cmap :=_aa (isSimple );cmap .cMapParser =_gfad (data );_gba :=cmap .parse ();if _gba !=nil {return nil ,_gba ;};if len (cmap ._eef )==0{if cmap ._ba !=""{return cmap ,nil ;};_eb .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u002e\u0020\u0063\u006d\u0061p=\u0025\u0073",cmap );return nil ,ErrBadCMap ;};cmap .computeInverseMappings ();return cmap ,nil ;};type cmapOperand struct{Operand string ;};func (cmap *CMap )parse ()error {var _gca cmapObject ;for {_bcb ,_ddb :=cmap .parseObject ();if _ddb !=nil {if _ddb ==_f .EOF {break ;};_eb .Log .Debug ("\u0045\u0052\u0052OR\u003a\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0043\u004d\u0061\u0070\u003a\u0020\u0025\u0076",_ddb );return _ddb ;};switch _gfe :=_bcb .(type ){case cmapOperand :_ebe :=_gfe ;switch _ebe .Operand {case _ecce :_cgf :=cmap .parseCodespaceRange ();if _cgf !=nil {return _cgf ;};case _egd :_bf :=cmap .parseCIDRange ();if _bf !=nil {return _bf ;};case _beda :_acb :=cmap .parseBfchar ();if _acb !=nil {return _acb ;};case _eag :_fgf :=cmap .parseBfrange ();if _fgf !=nil {return _fgf ;};case _ffa :if _gca ==nil {_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0075\u0073\u0065\u0063m\u0061\u0070\u0020\u0077\u0069\u0074\u0068\u0020\u006e\u006f \u0061\u0072\u0067");return ErrBadCMap ;};_bbg ,_bfe :=_gca .(cmapName );if !_bfe {_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0075\u0073\u0065\u0063\u006d\u0061\u0070\u0020\u0061\u0072\u0067\u0020\u006eo\u0074\u0020\u0061\u0020\u006e\u0061\u006de\u0020\u0025\u0023\u0076",_gca );return ErrBadCMap ;};cmap ._ba =_bbg .Name ;case _ecf :_gbfg :=cmap .parseSystemInfo ();if _gbfg !=nil {return _gbfg ;};};case cmapName :_baf :=_gfe ;switch _baf .Name {case _ecf :_dgd :=cmap .parseSystemInfo ();if _dgd !=nil {return _dgd ;};case _aege :_gceb :=cmap .parseName ();if _gceb !=nil {return _gceb ;};case _fbe :_abf :=cmap .parseType ();if _abf !=nil {return _abf ;};case _cefa :_bedb :=cmap .parseVersion ();if _bedb !=nil {return _bedb ;};};};_gca =_bcb ;};return nil ;};func (cmap *CMap )Type ()int {return cmap ._dcb };func _gbd ()cmapDict {return cmapDict {Dict :map[string ]cmapObject {}}};type cmapHexString struct{_dgdd int ;_bcdb []byte ;};type Codespace struct{NumBytes int ;Low CharCode ;High CharCode ;};func (_cbc *cMapParser )parseHexString ()(cmapHexString ,error ){_cbc ._ebee .ReadByte ();_egea :=[]byte ("\u0030\u0031\u0032\u003345\u0036\u0037\u0038\u0039\u0061\u0062\u0063\u0064\u0065\u0066\u0041\u0042\u0043\u0044E\u0046");_adbb :=_c .Buffer {};for {_cbc .skipSpaces ();_ddg ,_ccbd :=_cbc ._ebee .Peek (1);if _ccbd !=nil {return cmapHexString {},_ccbd ;};if _ddg [0]=='>'{_cbc ._ebee .ReadByte ();break ;};_gdbe ,_ :=_cbc ._ebee .ReadByte ();if _c .IndexByte (_egea ,_gdbe )>=0{_adbb .WriteByte (_gdbe );};};if _adbb .Len ()%2==1{_eb .Log .Debug ("\u0070\u0061rs\u0065\u0048\u0065x\u0053\u0074\u0072\u0069ng:\u0020ap\u0070\u0065\u006e\u0064\u0069\u006e\u0067 '\u0030\u0027\u0020\u0074\u006f\u0020\u0025#\u0071",_adbb .String ());_adbb .WriteByte ('0');};_cefad :=_adbb .Len ()/2;_bedbf ,_ :=_ef .DecodeString (_adbb .String ());return cmapHexString {_dgdd :_cefad ,_bcdb :_bedbf },nil ;};func (cmap *CMap )StringToCID (s string )(CharCode ,bool ){_fb ,_gcgf :=cmap ._ega [s ];return _fb ,_gcgf ;};func (cmap *CMap )parseCIDRange ()error {for {_dbc ,_acba :=cmap .parseObject ();if _acba !=nil {if _acba ==_f .EOF {break ;};return _acba ;};_dda ,_dfg :=_dbc .(cmapHexString );if !_dfg {if _cde ,_aaf :=_dbc .(cmapOperand );_aaf {if _cde .Operand ==_caf {return nil ;};return _ce .New ("\u0063\u0069\u0064\u0020\u0069\u006e\u0074\u0065\u0072\u0076\u0061\u006c\u0020s\u0074\u0061\u0072\u0074\u0020\u006du\u0073\u0074\u0020\u0062\u0065\u0020\u0061\u0020\u0068\u0065\u0078\u0020\u0073t\u0072\u0069\u006e\u0067");};};_debg :=_baeg (_dda );_dbc ,_acba =cmap .parseObject ();if _acba !=nil {if _acba ==_f .EOF {break ;};return _acba ;};_ada ,_dfg :=_dbc .(cmapHexString );if !_dfg {return _ce .New ("\u0063\u0069d\u0020\u0069\u006e\u0074e\u0072\u0076a\u006c\u0020\u0065\u006e\u0064\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0061\u0020\u0068\u0065\u0078\u0020\u0073t\u0072\u0069\u006e\u0067");};if len (_dda ._bcdb )!=len (_ada ._bcdb ){return _ce .New ("\u0075\u006e\u0065\u0071\u0075\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072\u0020o\u0066 \u0062\u0079\u0074\u0065\u0073\u0020\u0069\u006e\u0020\u0072\u0061\u006e\u0067\u0065");};_ccag :=_baeg (_ada );if _debg > _ccag {_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u0043\u0049\u0044\u0020\u0072\u0061\u006e\u0067\u0065\u002e\u0020\u0073t\u0061\u0072\u0074\u003d\u0030\u0078\u0025\u0030\u0032\u0078\u0020\u0065\u006e\u0064=\u0030x\u0025\u0030\u0032\u0078",_debg ,_ccag );return ErrBadCMap ;};_dbc ,_acba =cmap .parseObject ();if _acba !=nil {if _acba ==_f .EOF {break ;};return _acba ;};_aega ,_dfg :=_dbc .(cmapInt );if !_dfg {return _ce .New ("\u0063\u0069\u0064\u0020\u0073t\u0061\u0072\u0074\u0020\u0076\u0061\u006c\u0075\u0065\u0020\u006d\u0075\u0073t\u0020\u0062\u0065\u0020\u0061\u006e\u0020\u0064\u0065\u0063\u0069\u006d\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072");};if _aega ._ade < 0{return _ce .New ("\u0069\u006e\u0076al\u0069\u0064\u0020\u0063\u0069\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0076\u0061\u006c\u0075\u0065");};_bfb :=_aega ._ade ;for _degb :=_debg ;_degb <=_ccag ;_degb ++{cmap ._ac [_degb ]=CharCode (_bfb );_bfb ++;};_eb .Log .Trace ("C\u0049\u0044\u0020\u0072\u0061\u006eg\u0065\u003a\u0020\u003c\u0030\u0078\u0025\u0058\u003e \u003c\u0030\u0078%\u0058>\u0020\u0025\u0064",_debg ,_ccag ,_aega ._ade );};return nil ;};func (_bd *CIDSystemInfo )String ()string {return _d .Sprintf ("\u0025\u0073\u002d\u0025\u0073\u002d\u0025\u0030\u0033\u0064",_bd .Registry ,_bd .Ordering ,_bd .Supplement );};func (cmap *CMap )parseBfrange ()error {for {var _feg CharCode ;_bfea ,_abd :=cmap .parseObject ();if _abd !=nil {if _abd ==_f .EOF {break ;};return _abd ;};switch _feed :=_bfea .(type ){case cmapOperand :if _feed .Operand ==_bbcg {return nil ;};return _ce .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");case cmapHexString :_feg =_baeg (_feed );default:return _ce .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0074\u0079\u0070\u0065");};var _dgca CharCode ;_bfea ,_abd =cmap .parseObject ();if _abd !=nil {if _abd ==_f .EOF {break ;};return _abd ;};switch _fbdg :=_bfea .(type ){case cmapOperand :_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0049\u006e\u0063\u006f\u006d\u0070\u006c\u0065\u0074\u0065\u0020\u0062\u0066r\u0061\u006e\u0067\u0065\u0020\u0074\u0072i\u0070\u006c\u0065\u0074");return ErrBadCMap ;case cmapHexString :_dgca =_baeg (_fbdg );default:_eb .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0055\u006e\u0065\u0078\u0070e\u0063t\u0065d\u0020\u0074\u0079\u0070\u0065\u0020\u0025T",_bfea );return ErrBadCMap ;};_bfea ,_abd =cmap .parseObject ();if _abd !=nil {if _abd ==_f .EOF {break ;};return _abd ;};switch _bbcf :=_bfea .(type ){case cmapArray :if len (_bbcf .Array )!=int (_dgca -_feg )+1{_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0049\u006e\u0076\u0061\u006c\u0069d\u0020\u006e\u0075\u006d\u0062\u0065r\u0020\u006f\u0066\u0020\u0069\u0074\u0065\u006d\u0073\u0020\u0069\u006e\u0020a\u0072\u0072\u0061\u0079");return ErrBadCMap ;};for _agbd :=_feg ;_agbd <=_dgca ;_agbd ++{_fcf :=_bbcf .Array [_agbd -_feg ];_dbg ,_adf :=_fcf .(cmapHexString );if !_adf {return _ce .New ("\u006e\u006f\u006e-h\u0065\u0078\u0020\u0073\u0074\u0072\u0069\u006e\u0067\u0020\u0069\u006e\u0020\u0061\u0072\u0072\u0061\u0079");};_gcb :=_efac (_dbg );cmap ._eed [_agbd ]=string (_gcb );};case cmapHexString :_cb :=_efac (_bbcf );_aba :=len (_cb );for _adaa :=_feg ;_adaa <=_dgca ;_adaa ++{cmap ._eed [_adaa ]=string (_cb );if _aba > 0{_cb [_aba -1]++;}else {_eb .Log .Debug ("\u004e\u006f\u0020c\u006d\u0061\u0070\u0020\u0074\u0061\u0072\u0067\u0065\u0074\u0020\u0063\u0068\u0061\u0072\u0061\u0063\u0074\u0065\u0072\u0020\u0073\u0070\u0065\u0063\u0069\u0066\u0069\u0065d\u0020\u0066\u006f\u0072\u0020\u0025\u0023\u0076",_adaa );};};default:_eb .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0055\u006e\u0065\u0078\u0070e\u0063t\u0065d\u0020\u0074\u0079\u0070\u0065\u0020\u0025T",_bfea );return ErrBadCMap ;};};return nil ;};func (cmap *CMap )parseVersion ()error {_dedg :="";_ecc :=false ;for _gcc :=0;_gcc < 3&&!_ecc ;_gcc ++{_gfa ,_bace :=cmap .parseObject ();if _bace !=nil {return _bace ;};switch _eca :=_gfa .(type ){case cmapOperand :switch _eca .Operand {case "\u0064\u0065\u0066":_ecc =true ;default:_eb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0070\u0061\u0072\u0073\u0065\u0056e\u0072\u0073\u0069\u006f\u006e\u003a \u0073\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020o\u003d\u0025\u0023\u0076",_gfa );return ErrBadCMap ;};case cmapInt :_dedg =_d .Sprintf ("\u0025\u0064",_eca ._ade );case cmapFloat :_dedg =_d .Sprintf ("\u0025\u0066",_eca ._babed );case cmapString :_dedg =_eca .String ;default:_eb .Log .Debug ("\u0045\u0052RO\u0052\u003a\u0020p\u0061\u0072\u0073\u0065Ver\u0073io\u006e\u003a\u0020\u0042\u0061\u0064\u0020ty\u0070\u0065\u002e\u0020\u006f\u003d\u0025#\u0076",_gfa );};};cmap ._eaa =_dedg ;return nil ;};func NewCIDSystemInfo (obj _ge .PdfObject )(_gad CIDSystemInfo ,_bg error ){_gcg ,_fc :=_ge .GetDict (obj );if !_fc {return CIDSystemInfo {},_ge .ErrTypeError ;};_cg ,_fc :=_ge .GetStringVal (_gcg .Get ("\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079"));if !_fc {return CIDSystemInfo {},_ge .ErrTypeError ;};_cf ,_fc :=_ge .GetStringVal (_gcg .Get ("\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067"));if !_fc {return CIDSystemInfo {},_ge .ErrTypeError ;};_dc ,_fc :=_ge .GetIntVal (_gcg .Get ("\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074"));if !_fc {return CIDSystemInfo {},_ge .ErrTypeError ;};return CIDSystemInfo {Registry :_cg ,Ordering :_cf ,Supplement :_dc },nil ;};func NewToUnicodeCMap (codeToRune map[CharCode ]rune )*CMap {_cgc :=make (map[CharCode ]string ,len (codeToRune ));for _dcd ,_ag :=range codeToRune {_cgc [_dcd ]=string (_ag );};cmap :=&CMap {_gce :"\u0041d\u006fb\u0065\u002d\u0049\u0064\u0065n\u0074\u0069t\u0079\u002d\u0055\u0043\u0053",_dcb :2,_ee :16,_eg :CIDSystemInfo {Registry :"\u0041\u0064\u006fb\u0065",Ordering :"\u0055\u0043\u0053",Supplement :0},_eef :[]Codespace {{Low :0,High :0xffff}},_eed :_cgc ,_ega :make (map[string ]CharCode ,len (codeToRune )),_ac :make (map[CharCode ]CharCode ,len (codeToRune )),_egf :make (map[CharCode ]CharCode ,len (codeToRune ))};cmap .computeInverseMappings ();return cmap ;};