summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/xetexdir/XeTeX_mac.c
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2006-12-06 17:29:15 +0000
committerJonathan Kew <jfkthame@googlemail.com>2006-12-06 17:29:15 +0000
commite908059c852606dc94864e34c963f682da27e67b (patch)
tree627f62320c0c51fd1125ae98b2bf3e2c84ca9f1c /Build/source/texk/web2c/xetexdir/XeTeX_mac.c
parent62dfc6d9588e7c3aa6a85b06b53479697b272243 (diff)
xetex updates for version 0.996
git-svn-id: svn://tug.org/texlive/trunk@2602 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/xetexdir/XeTeX_mac.c')
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_mac.c57
1 files changed, 56 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c
index 8a892be8fc4..6aba6083f41 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c
@@ -43,7 +43,7 @@ authorization from SIL International.
#undef input /* this is defined in texmfmp.h, but we don't need it and it confuses the carbon headers */
#include <Carbon/Carbon.h>
-#include <Quicktime/Quicktime.h>
+#include <QuickTime/QuickTime.h>
#include "TECkit_Engine.h"
#include "XeTeX_ext.h"
@@ -468,6 +468,61 @@ int MapGlyphToIndex_AAT(ATSUStyle style, const char* glyphName)
return rval;
}
+char*
+GetGlyphName_AAT(ATSUStyle style, UInt16 gid, int* len)
+{
+ static char buffer[256];
+ const char* namePtr;
+
+ ATSUFontID fontID;
+ ATSUGetAttribute(style, kATSUFontTag, sizeof(ATSUFontID), &fontID, 0);
+
+ ATSFontRef fontRef = FMGetATSFontRefFromFont(fontID);
+
+ ByteCount length;
+ OSStatus status = ATSFontGetTable(fontRef, kPost, 0, 0, 0, &length);
+ if (status != noErr)
+ return 0;
+
+ void* table = xmalloc(length);
+ status = ATSFontGetTable(fontRef, kPost, 0, length, table, &length);
+ if (status != noErr) {
+ free(table);
+ return 0;
+ }
+
+ namePtr = getGlyphNamePtr(table, length, gid, len);
+ if (*len > 255)
+ *len = 255;
+ if (namePtr) {
+ memcpy(buffer, namePtr, *len);
+ buffer[*len] = 0;
+ }
+
+ free(table);
+
+ return &buffer[0];
+}
+
+/*
+int
+GetFontCharRange_AAT(ATSUStyle style, int reqFirst)
+{
+ if (reqFirst) {
+ int ch = 0;
+ while (MapCharToGlyph_AAT(style, ch) == 0 && ch < 0x10ffff)
+ ++ch;
+ return ch;
+ }
+ else {
+ int ch = 0x10ffff;
+ while (MapCharToGlyph_AAT(style, ch) == 0 && ch > 0)
+ --ch;
+ return ch;
+ }
+}
+*/
+
ATSUFontVariationAxis
find_axis_by_name(ATSUFontID fontID, const char* name, int nameLength)
{