ADi-FontEngine  1.0
PDF Optimized FontEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FontEngine Namespace Reference

Classes

struct  TCacheItem
 The main font cache data struct. More...
 
struct  TFontCache
 the font cache class More...
 
struct  TDBComp
 The default comparison function template to sort items in data bank class. More...
 
class  TDBank
 flexible data bank class template More...
 
struct  TToUNiCodeEnc
 abstract class interface from Character-Code to Unicode converter More...
 
struct  TCIDToUNiCode
 abstract class interface from CID to Unicode converter. CID's are Character Collection for CID-Keyed fonts from Adobe saved in CMap files More...
 
struct  TFontError
 FontEngine C++ exception type. More...
 
struct  TCode
 template class to keep small memory objects More...
 
struct  TRange
 
struct  TUNiDataEval
 
struct  TUNiDataRangeEval
 
struct  TUNiDataOut
 
struct  TWidth
 struct to keep glyph width info More...
 
struct  TGOutline
 struct to keep glyph outline, width and stem hint info More...
 
struct  TFPoint
 struct to keep single 2D point More...
 
struct  TBBox
 struct to keep rectangle More...
 
struct  TGlyphBox
 struct to keep glyph bounding box and width More...
 
struct  TGlyph
 the glyph data struct, used as main type in font cache data bank class More...
 
struct  TEncInfo
 the enum to encoding settings, to understand the sense see OpenType Spec
http://www.microsoft.com/typography/otspec/name.htm More...
 
struct  TEncGlyph
 struct glyph data bank with encoding information More...
 
struct  TDumpEntry
 dump result entry struct keep information about one dump entity More...
 
struct  TDumpParam
 dump parameter struct to select all dump feature More...
 
struct  TEmbFontData
 struct to define glyph decriptions inclusive outline data for input or modify new or existing glyphs More...
 
struct  TEmbFontParameter
 contains parameter to create new font or subset existing font More...
 
struct  TFontDictionary
 contain font properties, derived from PDF format, see also FontDescriptor
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf More...
 
struct  T1PiecesLength
 the length of the three parts of PostScript Type 1 fonts More...
 
class  TPSCMap
 PostScript CMaps files will be used to define encodings or tounicode mappings. More...
 
class  TFont
 The primary font class with short sample to open font and get glyph information: More...
 

Typedefs

typedef TDBank< TCacheItem,
TCacheItem::ECSelector,
TCacheItem::ecsLastSelector,
TCacheItem
TCacheDBank
 The type declaration of main font cache data base. More...
 
typedef boost::shared_ptr
< TFontCache
TGlobalFontCache
 Global Font Cache instance. More...
 
typedef std::bitset
< ettp_LAST_ENTRY
TTProblemBS
 
typedef std::bitset
< ecffp_LAST_ENTRY
TCFFProblemBS
 
typedef std::vector< double > TNumberVec
 
typedef std::basic_string< char > TBlock
 
typedef FontEngine::TCode TCharCode
 
typedef TCharCode::TUNiData TUNiData
 
typedef std::pair< const char
*, unsigned int > 
TPSName
 
typedef std::wstring TPath
 
typedef std::vector< TPathTPathVec
 
typedef std::set< std::string > TAltNameSet
 
typedef std::pair< unsigned
short, bool > 
TUShortBoolRes
 
typedef TNumberVec TCoordVec
 
typedef std::vector< TCoordVecTPointsVec
 
typedef std::pair< double, double > TStemPair
 
typedef std::vector< TStemPairTStemVec
 
typedef TDBank< TGlyph,
TGlyph::EGSelector,
TGlyph::egsCID+1, TGlyph
TGlyphDBank
 the font cache data bank type definition, good sample for TDBank template class More...
 
typedef std::vector< TEncInfoTEncInfoVec
 
typedef std::vector< TEncGlyphTEncGlyphVec
 
typedef std::pair< TEncInfo,
TGlyph
TGInfo
 
typedef std::vector< TGInfoTGInfoVec
 
typedef std::vector< TEmbFontDataTEmbFontDataVec
 
typedef std::bitset
< eeffUseGNames+1 > 
EEmbFontFlags
 
typedef unsigned int TPDFFontFlags
 combination of bits from EPDFFontFlags More...
 
typedef std::map< std::string,
FontEngine::TPath
TPathParamMap
 

Enumerations

enum  EDBCompActionRes { edbaInsertAlways, edbaOverwriteInsert, edbaInsertNever, edbaThrowIfExist }
 The insert action enum, to set data bank behavior if a item will be inserted, modified or imported. More...
 
enum  ETTProblems {
  ettpMissing_cmap, ettpChecksum, ettpFourByteBoundary, ettpPaddingNotZero,
  ettpWrong_hmtx, ettpMissAligned_cmap, ettpCompGRecursion, ettpmaxCompElements,
  ettpmaxCompDepth, ettp_LAST_ENTRY
}
 TrueType font problems, this could be a error or can be ignored. More...
 
enum  ECFFProblems {
  ecffpEmptySubrs, ecffpBlueArraySize, ecffpBlueValues, ecffpOtherBlues,
  ecffpStemSnapH, ecffpStemSnapV, ecffpDict, ecffpDictInteger,
  ecffpDictReal, ecffpDictTwoByteOp, ecffp_LAST_ENTRY
}
 CFF font problems, this could be a error or can be ignored. More...
 
enum  EErrorCodes {
  eNoError = 0, eUnknown = 1, eNoOpenFont, eParameterFail,
  eUserCancel, eWrongDBSelector, eDBEntryExist, eDBEntryInvalid,
  eDBIndexInvalid, ecffUnknown = 1000, ecffHeader, ecffNameIndex,
  ecffTopDictIndex, ecffTopDictData, ecffStringIndex, ecffGlobSubIndex,
  ecffLocaleSubIndex, ecffCharStringIndex, ecffFDArrayIndex, ecffFDSelectArray,
  ecffFDSelectIdx, ecffPrivate, ecffIntNumber, ecffRealNumber,
  ecffTwoByteOperator, ecffWrongEncoding, ecffWrongCharset, ecffWrongCharstring,
  ecffCharstringEnd, ecffSubRNotFound, ecffWrongOffset, ecffWrite,
  ecffNotANumber, ettUnknown = 2000, ettHeader, ettOffsetInvalid,
  ettMagicNumber, ettMissRequiredTbl, ettCFFOTPossible, ettCMap,
  ettLoca, ettPostScript, ettRead, ettWrite,
  ettInvalidCharCode, ettNoGlyphfound, ettWrongAddress, ettWrongGID,
  et1Unknown = 3000, et1NoPostScript, et1NoFontDict, et1Semantic,
  et1WrongGlyphName, et1MissEncoding, et1WrongEncoding, et1OperandsLimit,
  et1FlexSubRFail, et1GlobSubIndex, et1WrongCharstring, et1IntNumber,
  et1CharstringEnd, et1OtherSubMissing, et1CIDSystemInfo, et1MissCIDParam,
  et1GlyphOverflow, eencUnknown = 4000, eencCMap, eencETCPath,
  efcUnknown = 5000, efccPath, efccCacheHeader, efccCacheRead,
  efccCacheEmpty, efccInvalidIterator, efccIndexInvalid
}
 FontEngine error codes. More...
 
enum  EDumpType {
  edtGeneric, edtHeadline, edtStringUTF8, edtCFFCard8,
  edtCFFOffSize, edtCFFCard16, edtCFFSID, edtCFFOffset,
  edtCFFGID, edtCFFOperator, edtCFFBoolean, edtCFFNumber,
  edtCFFArray, edtCFFDelta, edtCFFDictData, edtCFFINDEXData,
  edtCFFFDArray, edtCFFFDSelect, edtCFFGlyph, edtT1Operator = 100,
  edtPSOperator, edtT1Null, edtT1Boolean, edtT1Fixed,
  edtT1Integer, edtT1Name, edtT1String, edtT1Array,
  edtT1Dictionary, edtT1Procedure, edtT1Glyph, edtT1FontName,
  edtT1GlyphData, edtTTDirectory = 200, edtTTBYTE, edtTTCHAR,
  edtTTUSHORT, edtTTSHORT, edtTTULONG, edtTTLONG,
  edtTTFIXED, edtTTFUNIT, edtTTFWORD, edtTTUFWORD,
  edtTTF2DOT14, edtTTLONGDATETIME, edtTTTableHead, edtTTBitEnable,
  edtTTBitDisable, edtTTGlyphName, edtTTGlyphCoord, edtTTGlyphMtx,
  edtTTGlyphEmpty, edtTTGlyph, edtTTNumContour
}
 enum to interpret dump result entries, this is a metainfo to get context information More...
 
enum  ENameIgnoreMarker { enimIgnore = 0xffff }
 The ignore marker to select ignore state for platform, encoding and/or language parameter. More...
 
enum  EFontOutType { efotCFF, efotCIDCFF, efotTrueType, efotCIDTrueType }
 enum to define possible font output format type used by font write functions More...
 
enum  EEmbFFlags {
  eeffSymbol, eeffPDF1_4Compliant, eeffPostScript, eeffHiResTT,
  eeffUseGNames
}
 enum to config some font output traits if font should be converted, subseted or created More...
 
enum  EPDFFontFlags {
  epdfFixedPitch = 0x00000001, epdfSerif = 0x00000002, epdfSymbolic = 0x00000004, epdfScript = 0x00000008,
  epdfNonsymbolic = 0x00000020, epdfItalic = 0x00000040, epdfAllCap = 0x00010000, epdfSmallCap = 0x00020000,
  epdfForceBold = 0x00040000
}
 enum to define various characteristics of a font, derived from PDF format, see also FontDescriptor Flags
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf More...
 

Functions

FONTENGINE_EXPORTS TGlobalFontCache globalFontCache (const TPathParamMap &ppm)
 get a global singleton font cache instance More...
 
FONTENGINE_EXPORTS void globalFontCacheRelease ()
 release this global singleton font cache instance More...
 
const TToUNiCodeEnc *const getToUNiCodeEncoder (unsigned int platform, unsigned int encoding, const std::wstring &cmaprespath)
 get Character-Code to Unicode converter instance pointer More...
 
FONTENGINE_EXPORTS const
TCIDToUNiCode *const 
getCIDToUNiCode (const char *registry, const char *ordering, const std::wstring &cmaprespath, bool vert_wmode=false)
 get CID to Unicode converter instance pointer More...
 
FONTENGINE_EXPORTS bool checkLatinLigature (TCharCode &unicode)
 try to convert some used unicode combinations to single ligature unicode U+0066 U+0066 ==> U+fb00; U+0066 U+0069 ==> U+fb01; U+0066 U+006c ==> U+fb02; U+017f U+0074 ==> U+fb05; U+0073 U+0074 ==> U+fb06; U+0066 U+0066 U+0069 ==> U+fb03; U+0066 U+0069 U+006c ==> U+fb04; More...
 
FONTENGINE_EXPORTS std::string getUTF8Text (const std::wstring &text)
 get utf8 encoded unicode string from wstring More...
 
FONTENGINE_EXPORTS std::string getSysText (const std::wstring &text)
 get sys encoded unicode string from wstring More...
 
FONTENGINE_EXPORTS std::wstring getUCS2Text (const char *text, unsigned int textlen)
 get wstring from utf8 encoded unicode string More...
 
std::wstring getUCS2Text (const std::string &text)
 get wstring from utf8 encoded unicode string More...
 
FONTENGINE_EXPORTS std::wstring getEncodedTTName (unsigned int platform, unsigned int encoding, const char *text, unsigned int len)
 get wstring from TrueType name string More...
 
FONTENGINE_EXPORTS std::wstring getEncodedText (unsigned int platform, unsigned int encoding, const std::string &text, bool big_endian)
 get wstring from string buffer could be contain 2 byte character also, the format is certain by encoding. More...
 
void fontengine_debug ()
 
void ThrowFontEngineException (bool expr, EErrorCodes errcode, bool dbg_break=true)
 function to raise FontEngine exception More...
 
void FontEngine_Assert (bool expr)
 function to check program process no excption raise More...
 
FONTENGINE_EXPORTS std::string findGlyphNameFromUnicode (const TCharCode &unicode)
 get Adobe PostScript glyph name from unicode or empty string if no name exist More...
 
FONTENGINE_EXPORTS TCharCode findUnicodeFromGlyphName (const char *gname, unsigned char len)
 get Unicode from Adobe PostScript glyph name from Unicode or empty TCharCode if no Unicode exist More...
 
FONTENGINE_EXPORTS bool setUnicodeRange (const TCharCode &unicode, unsigned char unicodeRange[16])
 set Unicode range in unicodeRange pattern came from OS/2 table TrueType font see
http://www.microsoft.com/typography/otspec/os2.htm#cpr More...
 
std::ostream & operator<< (std::ostream &out, const TUNiDataOut< char > &unid)
 
std::wostream & operator<< (std::wostream &out, const TUNiDataOut< wchar_t > &unid)
 

Typedef Documentation

typedef std::bitset< eeffUseGNames + 1 > FontEngine::EEmbFontFlags
typedef std::set< std::string > FontEngine::TAltNameSet
typedef std::basic_string<char> FontEngine::TBlock

The type declaration of main font cache data base.

< Description of TCoordVec path command vector, number of entries determine what does it mean

  1. size is 3: a move command consumer must close open path first [x, y, dummy]
  2. size is 2: a lineto command [x, y]
  3. Size is 6: a bezier curve [x1 y1 x2 y2 x3 y3]
  4. Size is 1: a hinting index + 1, a negative value show a vertical stem into _vstem else it is a horizontal stem into _hstem
typedef std::vector<TEncGlyph> FontEngine::TEncGlyphVec
typedef std::vector<TEncInfo> FontEngine::TEncInfoVec
typedef std::pair<TEncInfo, TGlyph> FontEngine::TGInfo
typedef std::vector<TGInfo> FontEngine::TGInfoVec
typedef boost::shared_ptr<TFontCache> FontEngine::TGlobalFontCache

Global Font Cache instance.

the font cache data bank type definition, good sample for TDBank template class

typedef std::vector<double> FontEngine::TNumberVec
typedef std::wstring FontEngine::TPath
typedef std::map<std::string, FontEngine::TPath> FontEngine::TPathParamMap

Parameter map to define some working directories to get font encoding resources
"etc" - must show to library "../etc" path
"cmapres" - must show to cmap resource folder library will normaly expect "../etc/Encoding"
"usecmap" - must show to cmap folder in which the usecmap resides

typedef std::vector< TPath > FontEngine::TPathVec
typedef unsigned int FontEngine::TPDFFontFlags

combination of bits from EPDFFontFlags

typedef std::vector<TCoordVec> FontEngine::TPointsVec
typedef std::pair<const char*, unsigned int> FontEngine::TPSName
typedef std::pair<double, double> FontEngine::TStemPair
typedef std::vector<TStemPair> FontEngine::TStemVec
typedef std::pair<unsigned short, bool> FontEngine::TUShortBoolRes

Enumeration Type Documentation

CFF font problems, this could be a error or can be ignored.

Enumerator
ecffpEmptySubrs 

( 0) font has empty Subrs data, a font without local subrs has no Subrs operator in the Private DICT.

ecffpBlueArraySize 

( 1) any of BlueValues, OtherBlues, FamilyBlues, FamilyOtherBlues has wrong size must be multiple of 2

ecffpBlueValues 

( 2) array of up to 7 pairs numbers

ecffpOtherBlues 

( 3) array of up to 5 pairs numbers

ecffpStemSnapH 

( 4) array of up to 12 real numbers

ecffpStemSnapV 

( 5) array of up to 12 real numbers

ecffpDict 

( 6) a dictionary (font | privat) is wrong

ecffpDictInteger 

( 7) a dictionary (font | privat) is wrong, integer expected

ecffpDictReal 

( 8) a dictionary (font | privat) is wrong, real number expected

ecffpDictTwoByteOp 

( 9) a dictionary (font | privat) is wrong, two byte operator expected

ecffp_LAST_ENTRY 

The insert action enum, to set data bank behavior if a item will be inserted, modified or imported.

Enumerator
edbaInsertAlways 

always insert the item, allow duplicates of same item

edbaOverwriteInsert 

overwrite an existing item avoid duplicates

edbaInsertNever 

keep existing item discard new item

edbaThrowIfExist 

throw an exception if such item already exist

enum to interpret dump result entries, this is a metainfo to get context information

Enumerator
edtGeneric 

( 0) any type

edtHeadline 

( 1) Headline

edtStringUTF8 

( 1) UTF8 encoded string

edtCFFCard8 

( 2) [0 - 255] 1-byte unsigned number

edtCFFOffSize 

( 3) [1 - 4] 1-byte unsigned number specifies the size of an Offset field or fields

edtCFFCard16 

( 4) [0 - 65535] 2-byte unsigned number

edtCFFSID 

( 5) [0 - 64999] 2-byte string identifier

edtCFFOffset 

( 6) varies 1, 2, 3, or 4 byte offset (specified by OffSize field)

edtCFFGID 

( 7) a glyph index, (charsets, encodings, and glyphs are related in CFF as 3 “parallel” arrays that are indexed in unison)

edtCFFOperator 

( 8) one or two byte operator

edtCFFBoolean 

( 9) operators operant, integer type with the values 0 (false) and 1 (true)

edtCFFNumber 

(10) operators operant, integer or real number

edtCFFArray 

(11) operators operant array, one or more numbers

edtCFFDelta 

(12) operators operant, a number or a delta-encoded array of numbers

edtCFFDictData 

(13) Font dictionary data comprising key-value pairs

edtCFFINDEXData 

(14) An INDEX is an array of variable-sized objects.

edtCFFFDArray 

(15) the FDArray data

edtCFFFDSelect 

(16) the FDSelect data

edtCFFGlyph 

(17) CFF glyph

edtT1Operator 

(100) one or two byte Fype1 operator

edtPSOperator 

(101) PostScript operator

edtT1Null 

(102) operators operant, boolean value

edtT1Boolean 

(103) operators operant, boolean value

edtT1Fixed 

(104) operators operant, fixed number

edtT1Integer 

(105) operators operant, integer number

edtT1Name 

(106) PostScript name

edtT1String 

(107) PostScript string

edtT1Array 

(108) PostScript array

edtT1Dictionary 

(109) PostScript dictionary

edtT1Procedure 

(110) PostScript procedure

edtT1Glyph 

(111) T1 glyph

edtT1FontName 

(112) CID fontname from FDArray FontInfo dict

edtT1GlyphData 

(112) CID GlyphData string in CID font

edtTTDirectory 

(200) The TrueType table directory

edtTTBYTE 

(201) 8-bit unsigned integer.

edtTTCHAR 

(202) 8-bit signed integer.

edtTTUSHORT 

(203) 16-bit unsigned integer.

edtTTSHORT 

(204) 16-bit signed integer.

edtTTULONG 

(205) 32-bit unsigned integer.

edtTTLONG 

(206) 32-bit signed integer.

edtTTFIXED 

(207) 32-bit signed fixed-point number (16.16)

edtTTFUNIT 

(208) Smallest measurable distance in the em space.

edtTTFWORD 

(209) 16-bit signed integer (SHORT) that describes a quantity in FUnits.

edtTTUFWORD 

(210) Unsigned 16-bit integer (USHORT) that describes a quantity in FUnits.

edtTTF2DOT14 

(211) 16-bit signed fixed number with the low 14 bits of fraction (2.14).

edtTTLONGDATETIME 

(212) Date represented in number of seconds since 12:00 midnight, January 1, 1904. The value is represented as a signed 64-bit integer.

edtTTTableHead 

(213) the tabel directory entry head

edtTTBitEnable 

(214) a single bit from bitfield with enable state

edtTTBitDisable 

(215) a single bit from bitfield with disable state

edtTTGlyphName 

(216) a glyph name used by PostScript table

edtTTGlyphCoord 

(217) TT glyph coordinate

edtTTGlyphMtx 

(218) TT composite glyph matrix

edtTTGlyphEmpty 

(219) TT empty glyph

edtTTGlyph 

(220) TT glyph

edtTTNumContour 

(221) "Number of contour" metadata dump line

enum to config some font output traits if font should be converted, subseted or created

Enumerator
eeffSymbol 

the font is declared as symbol font

eeffPDF1_4Compliant 

in PDF 1.4 symbol TrueType fonts should contain a (1,0) instead of (3,0) cmap

eeffPostScript 

create PostScript 'post' information in TrueType font file

eeffHiResTT 

if font converted from CFF to TrueType the cubic bezier curves will be split into 4 pieces instead of 2

eeffUseGNames 

if font is a cff font force use of PostScript glyph names instead of gid's (glyph index id)

FontEngine error codes.

Enumerator
eNoError 
eUnknown 

( 1) Unknown error

eNoOpenFont 

( 2) first open font

eParameterFail 

( 3) wrong parameter

eUserCancel 

( 4) user cancel command occur

eWrongDBSelector 

( 5) wrong selector in dbank class

eDBEntryExist 

( 6) dbank entry already exist

eDBEntryInvalid 

( 7) dbank entry or iterator is invalid

eDBIndexInvalid 

( 8) dbank direct index is invalid

ecffUnknown 

(1000) cff - Unknown error

ecffHeader 

(1001) cff - Header could not be read/write

ecffNameIndex 

(1002) cff - Name INDEX could not be read/write

ecffTopDictIndex 

(1003) cff - Top DICT INDEX could not be read/write

ecffTopDictData 

(1004) cff - Top DICT INDEX DATA could not be read

ecffStringIndex 

(1005) cff - String INDEX could not be read/write

ecffGlobSubIndex 

(1006) cff - Global Sub INDEX could not be read/write

ecffLocaleSubIndex 

(1007) cff - Locale Sub INDEX could not be read/write

ecffCharStringIndex 

(1008) cff - CharString INDEX could not be read/write

ecffFDArrayIndex 

(1009) cff - FDArray INDEX could not be read/write

ecffFDSelectArray 

(1010) cff - FDSelect array could not be read

ecffFDSelectIdx 

(1011) cff - FDSelect array index ist to large for FDArray

ecffPrivate 

(1012) cff - Private DICT could not be read/write

ecffIntNumber 

(1013) cff - Integer number expected

ecffRealNumber 

(1014) cff - BCD real number expected

ecffTwoByteOperator 

(1015) cff - Two byte operator expected

ecffWrongEncoding 

(1016) cff - Unable to read encoding data

ecffWrongCharset 

(1017) cff - Unable to read charset data

ecffWrongCharstring 

(1018) cff - Unable to read charstring data

ecffCharstringEnd 

(1019) cff - charstring ends with return

ecffSubRNotFound 

(1020) cff - a subroutione could not found

ecffWrongOffset 

(1021) cff - offset in INDEX is out of data range

ecffWrite 

(1022) cff - unable to write font file

ecffNotANumber 

(1023) cff - result of matrix calculation is undefined

ettUnknown 

(2000) tt - Unknown error

ettHeader 

(2001) tt - Header could not be read

ettOffsetInvalid 

(2002) tt - A given offset or lenght entry is out of file

ettMagicNumber 

(2003) tt - _magicNumber member in TT header missmatch

ettMissRequiredTbl 

(2004) tt - Required tables missing

ettCFFOTPossible 

(2005) tt - the font could be a CFF OpenType font

ettCMap 

(2006) tt - cmap struct could not be read

ettLoca 

(2007) tt - loca table is to short

ettPostScript 

(2008) tt - post table is invalid some pointer out of data

ettRead 

(2009) tt - unable to read from font file

ettWrite 

(2010) tt - unable to write font file

ettInvalidCharCode 

(2011) tt - Character Code is to big to use in simple font

ettNoGlyphfound 

(2012) tt - The font contains no glyph

ettWrongAddress 

(2013) tt - A caculated address into font is out of range

ettWrongGID 

(2014) tt - A given GID is unknown

et1Unknown 

(3000) t1 - Unknown error

et1NoPostScript 

(3001) t1 - invalid PostScript file

et1NoFontDict 

(3002) t1 - there is no font dictionary

et1Semantic 

(3003) t1 - semantic error in Type1 PostScript code, e.g. wrong "FontBBox" not 4 numbers

et1WrongGlyphName 

(3004) t1 - a CharStrings contain glyph without name key

et1MissEncoding 

(3005) t1 - the Encoding vector is required

et1WrongEncoding 

(3007) t1 - Encoding vector must be size of 256 and all objects are names

et1OperandsLimit 

(3008) t1 - The number of operands is bigger than 24, 24 is the limit for BuildChar operand stack

et1FlexSubRFail 

(3009) t1 - The flex subroutine has not right order or number

et1GlobSubIndex 

(3010) t1 - Global Sub INDEX could not be read

et1WrongCharstring 

(3011) t1 - Unable to read charstring data

et1IntNumber 

(3012) t1 - Integer number expected

et1CharstringEnd 

(3013) t1 - charstring ends with return

et1OtherSubMissing 

(3014) t1 - Unable to find other subroutine

et1CIDSystemInfo 

(3015) t1 - invalid CIDSystemInfo found

et1MissCIDParam 

(3016) t1 - CID font parameter is missing

et1GlyphOverflow 

(3017) t1 - CID glyph offset overflow

eencUnknown 

(4000) encoding - Unknown error

eencCMap 

(4001) encoding - CMap file is invalid

eencETCPath 

(4002) encoding - invalid cmap resource files lying in etc/Encoding folder

efcUnknown 

(5000) font cache - Unknown error

efccPath 

(5001) font cache - Cache file could not open

efccCacheHeader 

(5002) font cache - Wrong font cache file haeder

efccCacheRead 

(5003) font cache - Wrong font cache binaer file

efccCacheEmpty 

(5004) font cache - The font cache file contains no data

efccInvalidIterator 

(5005) font cache - The search iterator is invalid

efccIndexInvalid 

(5006) font cache - index is invalid

enum to define possible font output format type used by font write functions

Enumerator
efotCFF 

simple CFF font, valid character codes rage are [0 - 255]

efotCIDCFF 

CID CFF font, valid character codes rage are [0 - 65535].

efotTrueType 

simple TrueType font, valid character codes rage are [0 - 255]

efotCIDTrueType 

CID TrueType font, valid character codes rage are [0 - 65535].

The ignore marker to select ignore state for platform, encoding and/or language parameter.

Enumerator
enimIgnore 

ignore marker for platform, encoding and/or language parameter

enum to define various characteristics of a font, derived from PDF format, see also FontDescriptor Flags
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf

Enumerator
epdfFixedPitch 

All glyphs have the same width (as opposed to proportional or variable-pitch fonts, which have different widths).

epdfSerif 

Glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems. (Sans serif fonts do not have serifs.)

epdfSymbolic 

Font contains glyphs outside the Adobe standard Latin character set. This flag and the Nonsymbolic flag shall not both be set or both be clear.

epdfScript 

Glyphs resemble cursive handwriting.

epdfNonsymbolic 

Font uses the Adobe standard Latin character set or a subset of it.

epdfItalic 

Glyphs have dominant vertical strokes that are slanted.

epdfAllCap 

Font contains no lowercase letters; typically used for display purposes, such as for titles or headlines.

epdfSmallCap 

Font contains both uppercase and lowercase letters. The glyphs for the lowercase letters have the same shapes as the corresponding uppercase letters, but they are sized.

epdfForceBold 

Shall determine whether bold glyphs shall be painted with extra pixels even at very small text sizes.

TrueType font problems, this could be a error or can be ignored.

Enumerator
ettpMissing_cmap 

( 0) 'cmap' table is not available therfore no encoding info also

ettpChecksum 

( 1) at least one of the table checksum is incorrect with exception of 'head'

ettpFourByteBoundary 

( 2) at least one table offset begin not on a four byte boundary

ettpPaddingNotZero 

( 3) at least one table padding bytes are not zero

ettpWrong_hmtx 

( 4) the size of 'hmtx' table is wrong

ettpMissAligned_cmap 

( 5) one cmap in font file is not aligned to four byte boundary

ettpCompGRecursion 

( 6) wrong composite glyph, there is a self recursion into

ettpmaxCompElements 

( 7) wrong maxComponentElements entry in maxp.

ettpmaxCompDepth 

( 8) wrong maxComponentDepth entry in maxp

ettp_LAST_ENTRY 

Function Documentation

FONTENGINE_EXPORTS bool FontEngine::checkLatinLigature ( TCharCode &  unicode)

try to convert some used unicode combinations to single ligature unicode U+0066 U+0066 ==> U+fb00; U+0066 U+0069 ==> U+fb01; U+0066 U+006c ==> U+fb02; U+017f U+0074 ==> U+fb05; U+0073 U+0074 ==> U+fb06; U+0066 U+0066 U+0069 ==> U+fb03; U+0066 U+0069 U+006c ==> U+fb04;

Parameters
unicodethe given Unicode, will be changed by the function
Returns
true if ligature was found
FONTENGINE_EXPORTS std::string FontEngine::findGlyphNameFromUnicode ( const TCharCode &  unicode)

get Adobe PostScript glyph name from unicode or empty string if no name exist

Parameters
unicodethe given Unicode to get PostScript glyph name
Returns
the PostScript glyph name
FONTENGINE_EXPORTS TCharCode FontEngine::findUnicodeFromGlyphName ( const char *  gname,
unsigned char  len 
)

get Unicode from Adobe PostScript glyph name from Unicode or empty TCharCode if no Unicode exist

Parameters
gnamethe PostScript glyph name
lenthe length of the PostScript glyph name
Returns
the Unicode or an empty TCharCode if no unicode exist
void FontEngine::FontEngine_Assert ( bool  expr)
inline

function to check program process no excption raise

Parameters
exprif false the program will stop if a debugger is present
void FontEngine::fontengine_debug ( )
FONTENGINE_EXPORTS const TCIDToUNiCode* const FontEngine::getCIDToUNiCode ( const char *  registry,
const char *  ordering,
const std::wstring &  cmaprespath,
bool  vert_wmode = false 
)

get CID to Unicode converter instance pointer

Parameters
registryname of the registrar of the character collection.
orderingunique name for this specified registry.
cmaprespaththe file path to CMap files
vert_wmodeif true get converter for vertical write mode
Returns
a CID to Unicode converter instance or NULL if not such exist
FONTENGINE_EXPORTS std::wstring FontEngine::getEncodedText ( unsigned int  platform,
unsigned int  encoding,
const std::string &  text,
bool  big_endian 
)

get wstring from string buffer could be contain 2 byte character also, the format is certain by encoding.

Parameters
platformthe platfoem id, see OpenType Spec
http://www.microsoft.com/typography/otspec/name.htm
encodingthe encoding id, see OpenType Spec
textTrueType name string
big_endianmust be true if text contains 2 byte character with big endian order
Returns
wstring of TrueType name string
FONTENGINE_EXPORTS std::wstring FontEngine::getEncodedTTName ( unsigned int  platform,
unsigned int  encoding,
const char *  text,
unsigned int  len 
)

get wstring from TrueType name string

Parameters
platformthe platfoem id, see OpenType Spec
http://www.microsoft.com/typography/otspec/name.htm
encodingthe encoding id, see OpenType Spec
textTrueType name string
lenthe length of TrueType name string
Returns
wstring of TrueType name string
FONTENGINE_EXPORTS std::string FontEngine::getSysText ( const std::wstring &  text)

get sys encoded unicode string from wstring

Parameters
textthe wstring to convert
Returns
sys encoded unicode string
const TToUNiCodeEnc* const FontEngine::getToUNiCodeEncoder ( unsigned int  platform,
unsigned int  encoding,
const std::wstring &  cmaprespath 
)

get Character-Code to Unicode converter instance pointer

Parameters
platformthe platfoem id, see OpenType Spec
http://www.microsoft.com/typography/otspec/name.htm
encodingthe encoding id, see OpenType Spec
cmaprespaththe file path to encoding CMap files
Returns
a Character-Code to Unicode converter instance or NULL if not such exist
FONTENGINE_EXPORTS std::wstring FontEngine::getUCS2Text ( const char *  text,
unsigned int  textlen 
)

get wstring from utf8 encoded unicode string

Parameters
textpointer to utf8 encoded unicode string
textlenthe length of utf8 encoded unicode string
Returns
wstring
std::wstring FontEngine::getUCS2Text ( const std::string &  text)
inline

get wstring from utf8 encoded unicode string

Parameters
textpointer to utf8 encoded unicode string
Returns
wstring
FONTENGINE_EXPORTS std::string FontEngine::getUTF8Text ( const std::wstring &  text)

get utf8 encoded unicode string from wstring

Parameters
textthe wstring to convert
Returns
utf8 encoded unicode string
FONTENGINE_EXPORTS TGlobalFontCache FontEngine::globalFontCache ( const TPathParamMap &  ppm)

get a global singleton font cache instance

Parameters
ppmparameter map, see description at TPathParamMap
Returns
a singleton font cache instance
FONTENGINE_EXPORTS void FontEngine::globalFontCacheRelease ( )

release this global singleton font cache instance

std::ostream& FontEngine::operator<< ( std::ostream &  out,
const TUNiDataOut< char > &  unid 
)
inline
std::wostream& FontEngine::operator<< ( std::wostream &  out,
const TUNiDataOut< wchar_t > &  unid 
)
inline
FONTENGINE_EXPORTS bool FontEngine::setUnicodeRange ( const TCharCode &  unicode,
unsigned char  unicodeRange[16] 
)

set Unicode range in unicodeRange pattern came from OS/2 table TrueType font see
http://www.microsoft.com/typography/otspec/os2.htm#cpr

Parameters
unicodethe unicode
unicodeRangesame format ulCodePageRange1 and ulCodePageRange2 filled by funvtion
Returns
true if the unicode is known and a bit was set in unicodeRange
void FontEngine::ThrowFontEngineException ( bool  expr,
EErrorCodes  errcode,
bool  dbg_break = true 
)
inline

function to raise FontEngine exception

Parameters
exprif false a exception with error code will be raised
errcodeFontEngine error codes
dbg_breakif true the program will stop if a debugger is present
InsideFont and ADI-FontEngine : Andreas Dippe, © 2013
http://www.insidefont.de