--- old/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc 2017-01-13 12:25:15.366877593 -0800 +++ new/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc 2017-01-13 12:25:15.250877593 -0800 @@ -49,7 +49,7 @@ JNIEnv* env = jdkFontInfo->env; jobject font2D = jdkFontInfo->font2D; hb_codepoint_t u = (variation_selector==0) ? unicode : variation_selector; - + *glyph = (hb_codepoint_t) env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, u); return (*glyph != 0); @@ -61,7 +61,7 @@ hb_codepoint_t glyph, void *user_data HB_UNUSED) { - + float fadv = 0.0f; if ((glyph & 0xfffe) == 0xfffe) { return 0; // JDK uses this glyph code. @@ -72,7 +72,7 @@ jobject fontStrike = jdkFontInfo->fontStrike; jobject pt = env->CallObjectMethod(fontStrike, sunFontIDs.getGlyphMetricsMID, glyph); - + if (pt == NULL) { return 0; } @@ -89,7 +89,7 @@ hb_codepoint_t glyph, void *user_data HB_UNUSED) { - + float fadv = 0.0f; if ((glyph & 0xfffe) == 0xfffe) { return 0; // JDK uses this glyph code. @@ -100,7 +100,7 @@ jobject fontStrike = jdkFontInfo->fontStrike; jobject pt = env->CallObjectMethod(fontStrike, sunFontIDs.getGlyphMetricsMID, glyph); - + if (pt == NULL) { return 0; } @@ -108,7 +108,7 @@ env->DeleteLocalRef(pt); return HBFloatToFixed(fadv); - + } static hb_bool_t @@ -196,7 +196,7 @@ jobject pt = env->CallObjectMethod(fontStrike, sunFontIDs.getGlyphPointMID, glyph, point_index); - + if (pt == NULL) { *x = 0; *y = 0; return true; @@ -238,8 +238,8 @@ hb_font_funcs_t *ff; if (!jdk_ffuncs) { - ff = hb_font_funcs_create(); - + ff = hb_font_funcs_create(); + hb_font_funcs_set_glyph_func(ff, hb_jdk_get_glyph, NULL, NULL); hb_font_funcs_set_glyph_h_advance_func(ff, hb_jdk_get_glyph_h_advance, NULL, NULL); @@ -278,7 +278,7 @@ jobject font2D = jdkFontInfo->font2D; jsize length; jbyte* buffer; - + // HB_TAG_NONE is 0 and is used to get the whole font file. // It is not expected not be needed for JDK. if (tag == 0) {