diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-01 13:24:38 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-01 13:24:38 +0000 |
commit | 3131715fb5bce44da6c7584315237731aa752eba (patch) | |
tree | b4e748ed3b19d603c4ac1b29f33340c196003e0e /Build/source/texk/ttfdump/libttf/font.c | |
parent | 9417d53067c450b541cecd8c3ae224e5d17b8e54 (diff) |
ttfdump: Added functionality
- do not segfault for fonts without loca table
- allow cmap subtables with format 8, 10, 12, and 13
- handle GPOS and GSUB tables
- additional tests
git-svn-id: svn://tug.org/texlive/trunk@24713 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump/libttf/font.c')
-rw-r--r-- | Build/source/texk/ttfdump/libttf/font.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Build/source/texk/ttfdump/libttf/font.c b/Build/source/texk/ttfdump/libttf/font.c index 0ee6c25ec02..8b5e0d0a247 100644 --- a/Build/source/texk/ttfdump/libttf/font.c +++ b/Build/source/texk/ttfdump/libttf/font.c @@ -42,6 +42,7 @@ void ttfLoadFont(TTFontPtr font, ULONG offset) ttfLoadRequiredTables(font); ttfLoadOptionalTables(font); + ttfLoadOpenTypeTables(font); ttfInitInterpreter(font); @@ -55,6 +56,8 @@ void ttfFreeFont(TTFontPtr font) ttfFreeOptionalTables(font); + ttfFreeOpenTypeTables(font); + ttfFreeTableDir(font->dir); free(font->refcount); free(font); @@ -67,7 +70,6 @@ void ttfLoadRequiredTables(TTFontPtr font) ttfInitMAXP(font); ttfInitHEAD(font); - ttfInitLOCA(font); ttfInitGlyphCache(font); ttfInitGLYF(font); @@ -85,7 +87,6 @@ void ttfFreeRequiredTables(TTFontPtr font) ttfFreeNAME(font->name); ttfCleanUpGlyphCache(font); - ttfFreeLOCA(font->loca); ttfFreeHEAD(font->head); ttfFreeMAXP(font->maxp); @@ -103,6 +104,7 @@ void ttfLoadOptionalTables(TTFontPtr font) ttfInitGASP(font); ttfInitHDMX(font); ttfInitKERN(font); + ttfInitLOCA(font); ttfInitPREP(font); ttfInitLTSH(font); ttfInitPCLT(font); @@ -117,6 +119,7 @@ void ttfFreeOptionalTables(TTFontPtr font) ttfFreeGASP(font->gasp); ttfFreeHDMX(font->hdmx); ttfFreeKERN(font->kern); + ttfFreeLOCA(font->loca); ttfFreePREP(font->prep); ttfFreeLTSH(font->ltsh); ttfFreePCLT(font->pclt); @@ -125,6 +128,17 @@ void ttfFreeOptionalTables(TTFontPtr font) ttfFreeVMTX(font->vmtx); } +void ttfLoadOpenTypeTables(TTFontPtr font) +{ + ttfInitGPOS(font); + ttfInitGSUB(font); +} +void ttfFreeOpenTypeTables(TTFontPtr font) +{ + ttfFreeGPOS(font->gpos); + ttfFreeGSUB(font->gsub); +} + #if 0 /* Not used */ /* make a clone of the origional font |