/** Return value of OpenTTFont() */ enumclass SFErrCodes {
Ok, /**< no error */
BadFile, /**< file not found */
FileIo, /**< file I/O error */
Memory, /**< memory allocation error */
GlyphNum, /**< incorrect number of glyphs */
BadArg, /**< incorrect arguments */
TtFormat, /**< incorrect TrueType font format */
FontNo /**< incorrect logical font number of a TTC font */
};
#ifndef FW_THIN /* WIN32 compilation would conflict */ /** Value of the weight member of the TTGlobalFontInfo struct */ enum WeightClass {
FW_THIN = 100, /**< Thin */
FW_EXTRALIGHT = 200, /**< Extra-light (Ultra-light) */
FW_LIGHT = 300, /**< Light */
FW_NORMAL = 400, /**< Normal (Regular) */
FW_MEDIUM = 500, /**< Medium */
FW_SEMIBOLD = 600, /**< Semi-bold (Demi-bold) */
FW_BOLD = 700, /**< Bold */
FW_EXTRABOLD = 800, /**< Extra-bold (Ultra-bold) */
FW_BLACK = 900/**< Black (Heavy) */
}; #endif/* FW_THIN */
/** Value of the width member of the TTGlobalFontInfo struct */ enum WidthClass {
FWIDTH_ULTRA_CONDENSED = 1, /**< 50% of normal */
FWIDTH_EXTRA_CONDENSED = 2, /**< 62.5% of normal */
FWIDTH_CONDENSED = 3, /**< 75% of normal */
FWIDTH_SEMI_CONDENSED = 4, /**< 87.5% of normal */
FWIDTH_NORMAL = 5, /**< Medium, 100% */
FWIDTH_SEMI_EXPANDED = 6, /**< 112.5% of normal */
FWIDTH_EXPANDED = 7, /**< 125% of normal */
FWIDTH_EXTRA_EXPANDED = 8, /**< 150% of normal */
FWIDTH_ULTRA_EXPANDED = 9/**< 200% of normal */
};
/** Structure used by GetTTSimpleCharMetrics() functions */ typedefstruct {
sal_uInt16 adv; /**< advance width or height */
sal_Int16 sb; /**< left or top sidebearing */
} TTSimpleGlyphMetrics;
/** Structure used by the TrueType Creator and GetRawGlyphData() */
typedefstruct {
sal_uInt32 glyphID; /**< glyph ID */
sal_uInt16 nbytes; /**< number of bytes in glyph data */
std::unique_ptr<sal_uInt8[]> ptr; /**< pointer to glyph data */
sal_uInt16 aw; /**< advance width */
sal_Int16 lsb; /**< left sidebearing */ bool compflag; /**< false- if non-composite */
sal_uInt16 npoints; /**< number of points */
sal_uInt16 ncontours; /**< number of contours */ /* */
sal_uInt32 newID; /**< used internally by the TTCR */
} GlyphData;
/** Structure used by the TrueType Creator and CreateTTFromTTGlyphs() */ struct NameRecord {
sal_uInt16 platformID; /**< Platform ID */
sal_uInt16 encodingID; /**< Platform-specific encoding ID */
LanguageType languageID; /**< Language ID */
sal_uInt16 nameID; /**< Name ID */
std::vector<sal_uInt8> sptr; /**< string data (not zero-terminated!) */
};
/** Return value of GetTTGlobalFontInfo() */
typedefstruct TTGlobalFontInfo_ {
OString family; /**< family name */
OUString ufamily; /**< family name UCS2 */
OString subfamily; /**< subfamily name */
OUString usubfamily; /**< subfamily name UCS2 */
OString psname; /**< PostScript name */
sal_uInt16 macStyle = 0; /**< macstyle bits from 'HEAD' table */ int weight = 0; /**< value of WeightClass or 0 if can't be determined */ int width = 0; /**< value of WidthClass or 0 if can't be determined */ int pitch = 0; /**< 0: proportional font, otherwise: monospaced */ int italicAngle = 0; /**< in counter-clockwise degrees * 65536 */ int xMin = 0; /**< global bounding box: xMin */ int yMin = 0; /**< global bounding box: yMin */ int xMax = 0; /**< global bounding box: xMax */ int yMax = 0; /**< global bounding box: yMax */ int ascender = 0; /**< typographic ascent. */ int descender = 0; /**< typographic descent. */ int linegap = 0; /**< typographic line gap.\ Negative values are treated as
zero in Win 3.1, System 6 and System 7. */ int typoAscender = 0; /**< OS/2 portable typographic ascender */ int typoDescender = 0; /**< OS/2 portable typographic descender */ int typoLineGap = 0; /**< OS/2 portable typographic line gap */ int winAscent = 0; /**< ascender metric for Windows */ int winDescent = 0; /**< descender metric for Windows */ bool microsoftSymbolEncoded = false; /**< true: MS symbol encoded */
sal_uInt8 panose[10] = {}; /**< PANOSE classification number */
sal_uInt32 typeFlags = 0; /**< type flags (copyright bits) */
sal_uInt16 fsSelection = 0; /**< OS/2 fsSelection */
} TTGlobalFontInfo;
/** ControlPoint structure used by GetTTGlyphPoints() */ typedefstruct {
sal_uInt32 flags; /**< 00000000 00000000 e0000000 bbbbbbbb */ /**< b - byte flags from the glyf array */ /**< e == 0 - regular point */ /**< e == 1 - end contour */
sal_Int16 x; /**< X coordinate in EmSquare units */
sal_Int16 y; /**< Y coordinate in EmSquare units */
} ControlPoint;
// From Version 0 of OpenType int16sTypoAscender68 int16sTypoDescender70 int16sTypoLineGap72 uint16usWinAscent74 uint16usWinDescent76
=>lengthforOpenTypeversion0=78bytes
// From Version 1 of OpenType uint32ulCodePageRange178 uint32ulCodePageRange282
=>lengthforOpenTypeversion1=86bytes
// From Version 2 of OpenType // (idem for Versions 3 and 4) int16sxHeight86 int16sCapHeight88 uint16usDefaultChar90 uint16usBreakChar92 uint16usMaxContext94
=>lengthforOpenTypeversion2,3and4=96bytes
// From Version 5 of OpenType uint16usLowerOpticalPointSize96 uint16usUpperOpticalPointSize98 END100
=>lengthforOS/2tableversion5=100bytes
*/
constexpr int OS2_Legacy_length = 68;
constexpr int OS2_V0_length = 78;
constexpr int OS2_V1_length = 86;
constexpr int OS2_usWeightClass_offset = 4;
constexpr int OS2_usWidthClass_offset = 6;
constexpr int OS2_fsType_offset = 8;
constexpr int OS2_panose_offset = 32;
constexpr int OS2_panoseNbBytes_offset = 10;
constexpr int OS2_ulUnicodeRange1_offset = 42;
constexpr int OS2_ulUnicodeRange2_offset = 46;
constexpr int OS2_ulUnicodeRange3_offset = 50;
constexpr int OS2_ulUnicodeRange4_offset = 54;
constexpr int OS2_fsSelection_offset = 62;
constexpr int OS2_typoAscender_offset = 68;
constexpr int OS2_typoDescender_offset = 70;
constexpr int OS2_typoLineGap_offset = 72;
constexpr int OS2_winAscent_offset = 74;
constexpr int OS2_winDescent_offset = 76;
constexpr int OS2_ulCodePageRange1_offset = 78;
constexpr int OS2_ulCodePageRange2_offset = 82;
constexpr int HHEA_ascender_offset = 4;
constexpr int HHEA_descender_offset = 6;
constexpr int HHEA_lineGap_offset = 8;
constexpr int HHEA_caretSlopeRise_offset = 18;
constexpr int HHEA_caretSlopeRun_offset = 20;
=>lengthheadtable=54bytes
*/
constexpr int HEAD_Length = 54;
constexpr int HEAD_majorVersion_offset = 0;
constexpr int HEAD_fontRevision_offset = 4;
constexpr int HEAD_magicNumber_offset = 12;
constexpr int HEAD_flags_offset = 16;
constexpr int HEAD_unitsPerEm_offset = 18;
constexpr int HEAD_created_offset = 20;
constexpr int HEAD_xMin_offset = 36;
constexpr int HEAD_yMin_offset = 38;
constexpr int HEAD_xMax_offset = 40;
constexpr int HEAD_yMax_offset = 42;
constexpr int HEAD_macStyle_offset = 44;
constexpr int HEAD_lowestRecPPEM_offset = 46;
constexpr int HEAD_fontDirectionHint_offset = 48;
constexpr int HEAD_indexToLocFormat_offset = 50;
constexpr int HEAD_glyphDataFormat_offset = 52;
constexpr int MAXP_numGlyphs_offset = 4;
constexpr int MAXP_maxPoints_offset = 6;
constexpr int MAXP_maxContours_offset = 8;
constexpr int MAXP_maxCompositePoints_offset = 10;
constexpr int MAXP_maxCompositeContours_offset = 12;
constexpr int GLYF_numberOfContours_offset = 0;
constexpr int GLYF_xMin_offset = 2;
constexpr int GLYF_yMin_offset = 4;
constexpr int GLYF_xMax_offset = 6;
constexpr int GLYF_yMax_offset = 8;
class TrueTypeFont final : public AbstractTrueTypeFont
{ struct TTFontTable_
{ const sal_uInt8* pData = nullptr; /* pointer to a raw subtable in the SFNT file */
sal_uInt32 nSize = 0; /* table size */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.