changeset 4235:9bbba7779511

RT-31187: Mac OS X 10.8, Korean characters are not shown with System font
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 09 Jul 2013 16:42:20 -0700
parents 08a346875ce7
children 74160b530dfa
files modules/graphics/src/main/native-font/coretext.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-font/coretext.c	Tue Jul 09 11:41:18 2013 -0700
+++ b/modules/graphics/src/main/native-font/coretext.c	Tue Jul 09 16:42:20 2013 -0700
@@ -795,21 +795,22 @@
     if (tableData == NULL) return FALSE;
     length = CFDataGetLength(tableData);
     UInt32 offset1 = 0, offset2 = 0;
+    UInt32 index = arg2 & 0xFFFF;
     if (indexToLocFormat) {
         const UInt32 * loca = (const UInt32 *)CFDataGetBytePtr(tableData);
         if (loca != NULL && length / 4 > arg2) {
-            offset1 = CFSwapInt32BigToHost(loca[arg2]);
-            offset2 = CFSwapInt32BigToHost(loca[arg2 + 1]);
+            offset1 = CFSwapInt32BigToHost(loca[index]);
+            offset2 = CFSwapInt32BigToHost(loca[index + 1]);
         }
     } else {
         const UInt16 * loca = (const UInt16 *)CFDataGetBytePtr(tableData);
         if (loca != NULL && length / 2 > arg2) {
-            offset1 = CFSwapInt16BigToHost(loca[arg2]) << 1;
-            offset2 = CFSwapInt16BigToHost(loca[arg2 + 1]) << 1;
+            offset1 = CFSwapInt16BigToHost(loca[index]) << 1;
+            offset2 = CFSwapInt16BigToHost(loca[index + 1]) << 1;
         }
     }
     CFRelease(tableData);
-
+    jboolean result = FALSE;
     if (offset2 > offset1 && (offset2 - offset1) >= 10) {
         tableData = CTFontCopyTable(fontRef, kCTFontTableGlyf, options);
         if (tableData == NULL) return FALSE;
@@ -828,10 +829,11 @@
                 (SInt16)CFSwapInt16BigToHost(glyf[4]),
             };
             (*env)->SetIntArrayRegion(env, arg4, 0, 4, data);
+            result = TRUE;
         }
         CFRelease(tableData);
     }
-    return TRUE;
+    return result;
 }
 
 JNIEXPORT jdouble JNICALL OS_NATIVE(CTFontGetAdvancesForGlyphs)