void ttfInitLTSH(TTFontPtr font) { ULONG tag = FT_MAKE_TAG ('L', 'T', 'S', 'H'); TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->ltsh = XCALLOC1 (LTSH); ttfLoadLTSH(font->fp,font->ltsh,ptd->offset); } }
void ttfInitMAXP(TTFontPtr font) { ULONG tag = FT_MAKE_TAG ('m', 'a', 'x', 'p'); TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->maxp = XCALLOC1 (MAXP); ttfLoadMAXP(font->fp,font->maxp,ptd->offset); } }
void ttfInitCMAP(TTFontPtr font) { ULONG tag = 'c' | 'm' << 8 | 'a' << 16 | 'p' << 24; TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->cmap = ttfAllocCMAP(font); ttfLoadCMAP(font->fp,font->cmap,ptd->offset); } }
void ttfInitNAME(TTFontPtr font) { ULONG tag = 'n' | 'a' << 8 | 'm' << 16 | 'e' <<24; TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->name = ttfAllocNAME(font); ttfLoadNAME(font->fp,font->name,ptd->offset); } }
void ttfInitKERN(TTFontPtr font) { ULONG tag = 'k' | 'e' << 8 | 'r' << 16 | 'n' << 24; TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->kern = ttfAllocKERN(font); ttfLoadKERN(font->fp,font->kern,ptd->offset); } }
void ttfInitGASP(TTFontPtr font) { ULONG tag = FT_MAKE_TAG ('g', 'a', 's', 'p'); TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->gasp = XCALLOC1 (GASP); ttfLoadGASP(font->fp,font->gasp,ptd->offset); } }
void ttfInitCVT(TTFontPtr font) { ULONG tag = FT_MAKE_TAG ('c', 'v', 't', ' '); TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->cvtLength = ptd->length / sizeof(FWord); font->cvt = XCALLOC (font->cvtLength, FWord); ttfLoadCVT(font->fp,font->cvt,font->cvtLength,ptd->offset); } }
void ttfInitPREP(TTFontPtr font) { ULONG tag = 'p' | 'r' << 8 | 'e' << 16 | 'p' << 24; TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->prepLength = ptd->length; font->prep = (BYTE *) calloc(font->prepLength, sizeof(BYTE)); if (font->prep != NULL) ttfLoadPREP(font->fp,font->prep,font->prepLength,ptd->offset); } }
void ttfInitFPGM(TTFontPtr font) { ULONG tag = 'f' | 'p' << 8 | 'g' << 16 | 'm' << 24; TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->fpgmLength = ptd->length; font->fpgm = (BYTE *) calloc(font->fpgmLength, sizeof(BYTE)); if (font->fpgm != NULL) ttfLoadFPGM(font->fp,font->fpgm,font->fpgmLength,ptd->offset); } }
/* Caution: Because of interdependency between tables, * table vhea and maxp should be well initalized before * ttfInitVMTX has been called */ void ttfInitVMTX(TTFontPtr font) { ULONG tag = FT_MAKE_TAG ('v', 'm', 't', 'x'); TableDirPtr ptd; if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) { font->vmtx = XCALLOC1 (VMTX); font->vmtx->numOfLongVerMetrics = font->vhea->numOfLongVerMetrics; font->vmtx->numOfTSB = font->maxp->numGlyphs - font->vhea->numOfLongVerMetrics; ttfLoadVMTX(font->fp,font->vmtx,ptd->offset); } }