< prev index next >

src/java.desktop/share/native/libfontmanager/freetypeScaler.c

Print this page

        

@@ -459,10 +459,12 @@
     /**** Note: only some metrics are affected by styling ***/
 
     /* See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657854 */
 #define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
 
+#define contextAwareMetricsX(vx, vy) (FTFixedToFloat(context->transform.xx) * (vx) - FTFixedToFloat(context->transform.xy) * (vy))
+#define contextAwareMetricsY(vx, vy) (-FTFixedToFloat(context->transform.yx) * (vx) + FTFixedToFloat(context->transform.yy) * (vy))
     /*
      * See FreeType source code: src/base/ftobjs.c ft_recompute_scaled_metrics()
      * http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659
      */
     /* ascent */

@@ -491,11 +493,15 @@
     my = 0;
 
     metrics = (*env)->NewObject(env,
                                 sunFontIDs.strikeMetricsClass,
                                 sunFontIDs.strikeMetricsCtr,
-                                ax, ay, dx, dy, bx, by, lx, ly, mx, my);
+        contextAwareMetricsX(ax, ay), contextAwareMetricsY(ax, ay),
+        contextAwareMetricsX(dx, dy), contextAwareMetricsY(dx, dy),
+        bx, by,
+        contextAwareMetricsX(lx, ly), contextAwareMetricsY(lx, ly),
+        contextAwareMetricsX(mx, my), contextAwareMetricsY(mx, my));
 
     return metrics;
 }
 
 /*
< prev index next >