ADi-FontEngine  1.1
C++ Font Library
FontEngine Namespace Reference

Classes

struct  T1PiecesLength
 the length of the three parts of PostScript Type 1 fonts More...
 
struct  TBBox
 struct to keep rectangle More...
 
struct  TCacheItem
 The main font cache data struct. 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  TCode
 template class to keep small memory objects More...
 
class  TDBank
 flexible data bank class template More...
 
struct  TDBComp
 The default comparison function template to sort items in data bank class. 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  TEncGlyph
 struct glyph data bank with encoding information More...
 
struct  TEncInfo
 the enum to encoding settings, to understand the sense see OpenType Spec
http://www.microsoft.com/typography/otspec/name.htm More...
 
class  TFont
 The primary font class with short sample to open font and get glyph information: More...
 
struct  TFontCache
 the font cache class 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  TFontError
 FontEngine C++ exception type. More...
 
struct  TFontProblems
 parameter struct to keep some problem information, can be used by function getFontDump(..) More...
 
struct  TFPoint
 struct to keep single 2D point More...
 
struct  TGlyph
 the glyph data struct, used as main type in font cache data bank class More...
 
struct  TGlyphBox
 struct to keep glyph bounding box and width More...
 
struct  TGOutline
 struct to keep glyph outline, width and stem hint info More...
 
class  TPSCMap
 PostScript CMaps files will be used to define encodings or tounicode mappings. More...
 
struct  TRange
 
struct  TToUNiCodeEnc
 abstract class interface from Character-Code to Unicode converter More...
 
struct  TUNiDataEval
 
struct  TUNiDataOut
 
struct  TUNiDataRangeEval
 
struct  TWidth
 struct to keep glyph width info More...
 

Typedefs

typedef TDBank< TCacheItem, TCacheItem::ECSelector, TCacheItem::ecsLastSelector, TCacheItemTCacheDBank
 The type declaration of main font cache data base. More...
 
typedef boost::shared_ptr< TFontCacheTGlobalFontCache
 Global Font Cache instance. More...
 
typedef std::bitset< ettp_LAST_ENTRYTTProblemBS
 
typedef std::bitset< ecffp_LAST_ENTRYTCFFProblemBS
 
typedef std::bitset< et1pp_LAST_ENTRYTT1ProblemBS
 
typedef std::vector< double > TNumberVec
 
typedef std::basic_string< char > TBlock
 
typedef FontEngine::TCode TCharCode
 
typedef TCharCode::TUNiData TUNiData
 
typedef unsigned short TCID
 
typedef std::vector< TCIDTCIDVec
 
typedef unsigned char TMD5Hash[16]
 
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 TPointsVec::size_type TPointsVecST
 
typedef std::pair< double, double > TStemPair
 
typedef std::vector< TStemPairTStemVec
 
typedef std::string TTGInstruction
 
typedef TDBank< TGlyph, TGlyph::EGSelector, TGlyph::egsCID+1, TGlyphTGlyphDBank
 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, TGlyphTGInfo
 
typedef std::vector< TGInfoTGInfoVec
 
typedef std::vector< TEmbFontDataTEmbFontDataVec
 
typedef std::bitset< effNoGInstruction+1 > EEmbFontFlags
 
typedef unsigned int TPDFFontFlags
 combination of bits from EPDFFontFlags More...
 
typedef std::map< std::string, FontEngine::TPathTPathParamMap
 

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, ettpWrong_loca, ettpMissAligned_loca, ettp_locaTypeFail,
  ettpWrongAddress, ettpGNumLesser_hmtx, ettpGNumDiffer_post, ettpsizeOfInstructions,
  ettpnumOfPoints, ettpnumOfContour, ettpnumOfCompPoints, ettpnumOfCompContours,
  ettGInstrSize, ettGlyphDamaged, ettWrongOS2Version, ettWrong_maxpVersion,
  ettWrong_nameVersion, 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, ecffpWrong_hintmask, ecffpNameEmpty,
  ecffpWrongOffset, ecffpHugeCharstring, ecffpToManyArgs, ecffp_LAST_ENTRY
}
 CFF font problems, this could be a error or can be ignored. More...
 
enum  ET1Problems { et1ppNoOtherSubrs, et1pendGlyph, et1pp_LAST_ENTRY }
 PostScript Type1 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,
  ettMissInstruction, ettWrongStorageIdx, ettStackOverflow, ettToFewStackOps,
  ettWrongCvtIdx, ettNestedFunc, ettWrongCustomI, ettWrongGlyph,
  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, edtCFFCharStrings,
  edtT1Operator = 100, edtPSOperator, edtT1Null, edtT1Boolean,
  edtT1Fixed, edtT1Integer, edtT1Name, edtT1String,
  edtT1Array, edtT1Dictionary, edtT1CharStringsDict, edtT1Procedure,
  edtT1Glyph, edtT1FontName, edtT1GlyphData, edtTTDirectory = 200,
  edtTTBYTE, edtTTCHAR, edtTTUSHORT, edtTTSHORT,
  edtTTULONG, edtTTLONG, edtTTFIXED, edtTTFUNIT,
  edtTTFWORD, edtTTUFWORD, edtTTF2DOT14, edtTTLONGDATETIME,
  edtTTTableHead, edtTTTableHead_glyf, edtTTBitEnable, edtTTBitDisable,
  edtTTGlyphName, edtTTGlyphCoord, edtTTGlyphMtx, edtTTGlyphEmpty,
  edtTTGlyph, edtTTNumContour, edtTTGlyphRaw, edtTTInstruction,
  edtTTInstByte, edtTTInstShort, edtTTag
}
 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, effFullEmbedd, effNoGInstruction
}
 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...
 
FONTENGINE_EXPORTS 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, unsigned int reg_len, const char *ordering, unsigned int ord_len, const std::wstring &cmaprespath, bool vert_wmode=false)
 get CID to Unicode converter instance pointer More...
 
const TCIDToUNiCode *const getCIDToUNiCode (const std::string &registry, const std::string &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...
 
std::string getProblemText (TFontProblems problem)
 
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 isPredefinedGlyphName (const char *gname, unsigned char len)
 get true if it is a known Adobe PostScript glyph name, see this links: https://github.com/adobe-type-tools/agl-aglfn/blob/master/aglfn.txt https://github.com/adobe-type-tools/agl-aglfn/blob/master/glyphlist.txt https://github.com/adobe-type-tools/agl-aglfn/blob/master/zapfdingbats.txt 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

◆ EEmbFontFlags

typedef std::bitset< effNoGInstruction + 1 > FontEngine::EEmbFontFlags

◆ TAltNameSet

typedef std::set< std::string > FontEngine::TAltNameSet

◆ TBlock

typedef std::basic_string<char> FontEngine::TBlock

◆ TCacheDBank

The type declaration of main font cache data base.

◆ TCFFProblemBS

◆ TCharCode

◆ TCID

typedef unsigned short FontEngine::TCID

◆ TCIDVec

typedef std::vector< TCID > FontEngine::TCIDVec

◆ TCoordVec

< 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

◆ TEmbFontDataVec

◆ TEncGlyphVec

typedef std::vector<TEncGlyph> FontEngine::TEncGlyphVec

◆ TEncInfoVec

typedef std::vector<TEncInfo> FontEngine::TEncInfoVec

◆ TGInfo

typedef std::pair<TEncInfo, TGlyph> FontEngine::TGInfo

◆ TGInfoVec

typedef std::vector<TGInfo> FontEngine::TGInfoVec

◆ TGlobalFontCache

typedef boost::shared_ptr<TFontCache> FontEngine::TGlobalFontCache

Global Font Cache instance.

◆ TGlyphDBank

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

◆ TMD5Hash

typedef unsigned char FontEngine::TMD5Hash[16]

◆ TNumberVec

typedef std::vector<double> FontEngine::TNumberVec

◆ TPath

typedef std::wstring FontEngine::TPath

◆ TPathParamMap

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

◆ TPathVec

typedef std::vector< TPath > FontEngine::TPathVec

◆ TPDFFontFlags

typedef unsigned int FontEngine::TPDFFontFlags

combination of bits from EPDFFontFlags

◆ TPointsVec

typedef std::vector<TCoordVec> FontEngine::TPointsVec

◆ TPointsVecST

typedef TPointsVec::size_type FontEngine::TPointsVecST

◆ TPSName

typedef std::pair<const char*, unsigned int> FontEngine::TPSName

◆ TStemPair

typedef std::pair<double, double> FontEngine::TStemPair

◆ TStemVec

typedef std::vector<TStemPair> FontEngine::TStemVec

◆ TT1ProblemBS

◆ TTGInstruction

typedef std::string FontEngine::TTGInstruction

◆ TTProblemBS

◆ TUNiData

◆ TUShortBoolRes

typedef std::pair<unsigned short, bool> FontEngine::TUShortBoolRes

Enumeration Type Documentation

◆ ECFFProblems

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

Enumerator
ecffpEmptySubrs 

( 0) Font has empty "Subrs" data; a font without local subroutines should have 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

ecffpWrong_hintmask 

(10) A glyph starts with incorrect command 'hintmask'

ecffpNameEmpty 

(11) A "Name" INDEX data table is empty

ecffpWrongOffset 

(12) A calculated file offset is wrong, unable to read requested data

ecffpHugeCharstring 

(13) A glyph charstring exceed the implementation limit for Type2 charstring interpreter

ecffpToManyArgs 

(14) The number of arguments on the argument stack exceed the implementation limit for Type2 charstring interpreter

ecffp_LAST_ENTRY 

◆ EDBCompActionRes

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

◆ EDumpType

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

edtCFFCharStrings 

(18) CFF "CharStrings" INDEX data

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

edtT1CharStringsDict 

(110) PostScript "CharStrings" dictionary

edtT1Procedure 

(111) PostScript procedure

edtT1Glyph 

(112) T1 glyph

edtT1FontName 

(112) CID fontname from FDArray FontInfo dict

edtT1GlyphData 

(113) 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

edtTTTableHead_glyf 

(214) the 'glyf' tabel directory entry head

edtTTBitEnable 

(215) a single bit from bitfield with enable state

edtTTBitDisable 

(216) a single bit from bitfield with disable state

edtTTGlyphName 

(217) a glyph name used by PostScript table

edtTTGlyphCoord 

(218) TT glyph coordinate

edtTTGlyphMtx 

(219) TT composite glyph matrix

edtTTGlyphEmpty 

(220) TT empty glyph

edtTTGlyph 

(221) TT glyph

edtTTNumContour 

(222) "Number of contour" metadata dump line

edtTTGlyphRaw 

(223) glyph raw data

edtTTInstruction 

(224) TT instruction

edtTTInstByte 

(225) TT instruction push unsigned byte

edtTTInstShort 

(226) TT instruction push short

edtTTag 

(227) a 4 byte tag

◆ EEmbFFlags

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)

effFullEmbedd 

insert also all other glyphs, glyphs listed in _embFontDataVec must be checked to right width

effNoGInstruction 

remove all instructions from TrueType glyphs, to avoid problems in some viewer

◆ EErrorCodes

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

ettMissInstruction 

(2015) tt - instruction expected

ettWrongStorageIdx 

(2016) tt - Wrong storage area index in instruction

ettStackOverflow 

(2017) tt - stack limit is reached

ettToFewStackOps 

(2018) tt - missing stack entry in instruction

ettWrongCvtIdx 

(2019) tt - index to cvt 'Control Value Table' is invalid

ettNestedFunc 

(2020) tt - nested functions not allowed in instructions

ettWrongCustomI 

(2021) tt - instructions definition use invalid argument

ettWrongGlyph 

(2022) tt - A glyph description is wrong

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

◆ EFontOutType

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].

◆ ENameIgnoreMarker

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

◆ EPDFFontFlags

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.

◆ ET1Problems

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

Enumerator
et1ppNoOtherSubrs 

( 0) The "OtherSubrs" is missing though other subroutines will be called, this will only succeed if base routines will be simulated [0, 1, 2, 3, 14-18]

et1pendGlyph 

( 1) A glyph with name "end" exists, this is forbidden

et1pp_LAST_ENTRY 

◆ ETTProblems

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 as well

ettpChecksum 

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

ettpFourByteBoundary 

( 2) At least one table offset begins 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' table in font file is not aligned to four byte boundary

ettpCompGRecursion 

( 6) Wrong composite glyph, uses a self recursion

ettpmaxCompElements 

( 7) Wrong maxComponentElements entry in 'maxp' table

ettpmaxCompDepth 

( 8) Wrong maxComponentDepth entry in 'maxp' table

ettpWrong_loca 

( 9) Wrong 'loca' offset entry

ettpMissAligned_loca 

(10) A 'loca' offset is not aligned to four byte boundary

ettp_locaTypeFail 

(11) The indexToLocFormat in 'head' table is not 0 or 1, derived from the size of 'loca' table

ettpWrongAddress 

(12) A calculated address in any table is wrong

ettpGNumLesser_hmtx 

(12) The 'hmtx' table contains more entries as number of glyphs

ettpGNumDiffer_post 

(13) The number of glyphs in 'maxp' table is different from 'post' table

ettpsizeOfInstructions 

(14) Wrong maxSizeOfInstructions entry in 'maxp' table

ettpnumOfPoints 

(15) Wrong maxPoints entry in 'maxp' table

ettpnumOfContour 

(16) Wrong maxContours entry in 'maxp' table

ettpnumOfCompPoints 

(17) Wrong maxCompositePoints entry in 'maxp' table

ettpnumOfCompContours 

(18) Wrong maxCompositeContours entry in 'maxp' table

ettGInstrSize 

(19) Glyph instructions are malformed; address mismatch

ettGlyphDamaged 

(20) Glyph data is damaged, unable to render glyph

ettWrongOS2Version 

(21) The version entry in 'OS/2' table is incorrect, too few data

ettWrong_maxpVersion 

(22) The version entry in 'maxp' table is incorrect, too few data

ettWrong_nameVersion 

(23) The version entry in 'name' table is incorrect

ettp_LAST_ENTRY 

Function Documentation

◆ checkLatinLigature()

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

◆ findGlyphNameFromUnicode()

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

◆ findUnicodeFromGlyphName()

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

◆ FontEngine_Assert()

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

◆ fontengine_debug()

void FontEngine::fontengine_debug ( )

◆ getCIDToUNiCode() [1/2]

FONTENGINE_EXPORTS const TCIDToUNiCode* const FontEngine::getCIDToUNiCode ( const char *  registry,
unsigned int  reg_len,
const char *  ordering,
unsigned int  ord_len,
const std::wstring &  cmaprespath,
bool  vert_wmode = false 
)

get CID to Unicode converter instance pointer

Parameters
registryname of the registrar of the character collection.
reg_lenlength of registry name string
orderingunique name for this specified registry.
ord_lenlength of ordering name string
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

◆ getCIDToUNiCode() [2/2]

const TCIDToUNiCode* const FontEngine::getCIDToUNiCode ( const std::string &  registry,
const std::string &  ordering,
const std::wstring &  cmaprespath,
bool  vert_wmode = false 
)
inline

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

◆ getEncodedText()

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

◆ getEncodedTTName()

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

◆ getProblemText()

std::string FontEngine::getProblemText ( TFontProblems  problem)
inline

◆ getSysText()

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

◆ getToUNiCodeEncoder()

FONTENGINE_EXPORTS 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

◆ getUCS2Text() [1/2]

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

◆ getUCS2Text() [2/2]

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

◆ getUTF8Text()

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

◆ globalFontCache()

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

◆ globalFontCacheRelease()

FONTENGINE_EXPORTS void FontEngine::globalFontCacheRelease ( )

release this global singleton font cache instance

◆ isPredefinedGlyphName()

FONTENGINE_EXPORTS bool FontEngine::isPredefinedGlyphName ( const char *  gname,
unsigned char  len 
)

get true if it is a known Adobe PostScript glyph name, see this links: https://github.com/adobe-type-tools/agl-aglfn/blob/master/aglfn.txt https://github.com/adobe-type-tools/agl-aglfn/blob/master/glyphlist.txt https://github.com/adobe-type-tools/agl-aglfn/blob/master/zapfdingbats.txt

Parameters
gnamethe PostScript glyph name
lenthe length of the PostScript glyph name
Returns
true if it is a known Adobe PostScript glyph name

◆ operator<<() [1/2]

std::ostream& FontEngine::operator<< ( std::ostream &  out,
const TUNiDataOut< char > &  unid 
)
inline

◆ operator<<() [2/2]

std::wostream& FontEngine::operator<< ( std::wostream &  out,
const TUNiDataOut< wchar_t > &  unid 
)
inline

◆ setUnicodeRange()

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

◆ ThrowFontEngineException()

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