< prev index next >

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

Print this page
rev 59106 : imported patch client


 205         }
 206         /* First, see if native code should be used to create the glyph.
 207          * GDI will return the integer metrics, not fractional metrics, which
 208          * may be requested for this strike, so we would require here that :
 209          * desc.fmHint != INTVAL_FRACTIONALMETRICS_ON
 210          * except that the advance returned by GDI is always overwritten by
 211          * the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
 212          */
 213         if (FontUtilities.isWindows && isXPorLater &&
 214             !FontUtilities.useJDKScaler &&
 215             !GraphicsEnvironment.isHeadless() &&
 216             !fileFont.useJavaRasterizer &&
 217             (desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HRGB ||
 218              desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HBGR) &&
 219             (matrix[1] == 0.0 && matrix[2] == 0.0 &&
 220              matrix[0] == matrix[3] &&
 221              matrix[0] >= 3.0 && matrix[0] <= 100.0) &&
 222             !((TrueTypeFont)fileFont).useEmbeddedBitmapsForSize(intPtSize)) {
 223             useNatives = true;
 224         }
 225         else if (fileFont.checkUseNatives() && desc.aaHint==0 && !algoStyle) {
 226             /* Check its a simple scale of a pt size in the range
 227              * where native bitmaps typically exist (6-36 pts) */
 228             if (matrix[1] == 0.0 && matrix[2] == 0.0 &&
 229                 matrix[0] >= 6.0 && matrix[0] <= 36.0 &&
 230                 matrix[0] == matrix[3]) {
 231                 useNatives = true;
 232                 int numNatives = fileFont.nativeFonts.length;
 233                 nativeStrikes = new NativeStrike[numNatives];
 234                 /* Maybe initialise these strikes lazily?. But we
 235                  * know we need at least one
 236                  */
 237                 for (int i=0; i<numNatives; i++) {
 238                     nativeStrikes[i] =
 239                         new NativeStrike(fileFont.nativeFonts[i], desc, false);
 240                 }
 241             }
 242         }
 243         if (FontUtilities.isLogging() && FontUtilities.isWindows) {
 244             FontUtilities.getLogger().info
 245                 ("Strike for " + fileFont + " at size = " + intPtSize +
 246                  " use natives = " + useNatives +
 247                  " useJavaRasteriser = " + fileFont.useJavaRasterizer +
 248                  " AAHint = " + desc.aaHint +
 249                  " Has Embedded bitmaps = " +
 250                  ((TrueTypeFont)fileFont).
 251                  useEmbeddedBitmapsForSize(intPtSize));
 252         }
 253         this.disposer = new FontStrikeDisposer(fileFont, desc, pScalerContext);
 254 
 255         /* Always get the image and the advance together for smaller sizes
 256          * that are likely to be important to rendering performance.
 257          * The pixel size of 48.0 can be thought of as
 258          * "maximumSizeForGetImageWithAdvance".
 259          * This should be no greater than OutlineTextRender.THRESHOLD.
 260          */
 261         double maxSz = 48.0;
 262         getImageWithAdvance =




 205         }
 206         /* First, see if native code should be used to create the glyph.
 207          * GDI will return the integer metrics, not fractional metrics, which
 208          * may be requested for this strike, so we would require here that :
 209          * desc.fmHint != INTVAL_FRACTIONALMETRICS_ON
 210          * except that the advance returned by GDI is always overwritten by
 211          * the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
 212          */
 213         if (FontUtilities.isWindows && isXPorLater &&
 214             !FontUtilities.useJDKScaler &&
 215             !GraphicsEnvironment.isHeadless() &&
 216             !fileFont.useJavaRasterizer &&
 217             (desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HRGB ||
 218              desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HBGR) &&
 219             (matrix[1] == 0.0 && matrix[2] == 0.0 &&
 220              matrix[0] == matrix[3] &&
 221              matrix[0] >= 3.0 && matrix[0] <= 100.0) &&
 222             !((TrueTypeFont)fileFont).useEmbeddedBitmapsForSize(intPtSize)) {
 223             useNatives = true;
 224         }


















 225         if (FontUtilities.isLogging() && FontUtilities.isWindows) {
 226             FontUtilities.getLogger().info
 227                 ("Strike for " + fileFont + " at size = " + intPtSize +
 228                  " use natives = " + useNatives +
 229                  " useJavaRasteriser = " + fileFont.useJavaRasterizer +
 230                  " AAHint = " + desc.aaHint +
 231                  " Has Embedded bitmaps = " +
 232                  ((TrueTypeFont)fileFont).
 233                  useEmbeddedBitmapsForSize(intPtSize));
 234         }
 235         this.disposer = new FontStrikeDisposer(fileFont, desc, pScalerContext);
 236 
 237         /* Always get the image and the advance together for smaller sizes
 238          * that are likely to be important to rendering performance.
 239          * The pixel size of 48.0 can be thought of as
 240          * "maximumSizeForGetImageWithAdvance".
 241          * This should be no greater than OutlineTextRender.THRESHOLD.
 242          */
 243         double maxSz = 48.0;
 244         getImageWithAdvance =


< prev index next >