src/java.desktop/share/classes/sun/font/StandardGlyphVector.java

Print this page

        

@@ -1122,10 +1122,13 @@
         font2D.getMapper().charsToGlyphs(count, text, glyphs);
     }
 
     private void initFontData() {
         font2D = FontUtilities.getFont2D(font);
+        if (font2D instanceof FontSubstitution) {
+           font2D = ((FontSubstitution)font2D).getCompositeFont2D();
+        }
         float s = font.getSize2D();
         if (font.isTransformed()) {
             ftx = font.getTransform();
             if (ftx.getTranslateX() != 0 || ftx.getTranslateY() != 0) {
                 addFlags(FLAG_HAS_POSITION_ADJUSTMENTS);

@@ -1740,11 +1743,16 @@
                                                      tx,
                                                      sgv.font.getStyle(),
                                                      aa, fm);
             // Get the strike via the handle. Shouldn't matter
             // if we've invalidated the font but its an extra precaution.
-            FontStrike strike = sgv.font2D.handle.font2D.getStrike(desc);  // !!! getStrike(desc, false)
+        // do we want the CompFont from CFont here ?
+        Font2D f2d = sgv.font2D;
+        if (f2d instanceof FontSubstitution) {
+           f2d = ((FontSubstitution)f2d).getCompositeFont2D();
+        }
+            FontStrike strike = f2d.handle.font2D.getStrike(desc);  // !!! getStrike(desc, false)
 
             return new GlyphStrike(sgv, strike, dx, dy);
         }
 
         private GlyphStrike(StandardGlyphVector sgv, FontStrike strike, float dx, float dy) {