diff options
Diffstat (limited to 'Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp index c598b9c96a1..fc21a6837a0 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp @@ -71,6 +71,8 @@ XeTeXFontInst::XeTeXFontInst(float pointSize, LEErrorCode &status) , fNumGlyphsInited(false) , fVertical(false) , fFilename(NULL) + , fFirstCharCode(-1) + , fLastCharCode(-1) { // the concrete subclass is responsible to call initialize() } @@ -296,3 +298,37 @@ XeTeXFontInst::mapGlyphToIndex(const char* glyphName) const else return 0; } + +const char* +XeTeXFontInst::getGlyphName(LEGlyphID gid, int& nameLen) +{ + le_uint32 len; + const char *p = (const char*)readFontTable(LE_POST_TABLE_TAG, len); + if (p != NULL) { + return getGlyphNamePtr(p, len, gid, &nameLen); + } +} + +LEUnicode32 +XeTeXFontInst::getFirstCharCode() +{ + if (fFirstCharCode == -1) { + int ch = 0; + while (mapCharToGlyph(ch) == 0 && ch < 0x10ffff) + ++ch; + fFirstCharCode = ch; + } + return fFirstCharCode; +} + +LEUnicode32 +XeTeXFontInst::getLastCharCode() +{ + if (fLastCharCode == -1) { + int ch = 0x10ffff; + while (mapCharToGlyph(ch) == 0 && ch > 0) + --ch; + fLastCharCode = ch; + } + return fLastCharCode; +} |