src/share/classes/sun/font/FileFontStrike.java
Print this page
rev 1297 : [mq]: fontmanager.patch
@@ -112,11 +112,11 @@
/* Perform global initialisation needed for Windows native rasterizer */
private static native boolean initNative();
private static boolean isXPorLater = false;
static {
- if (FontManager.isWindows && !FontManager.useT2K &&
+ if (FontUtilities.isWindows && !FontUtilities.useT2K &&
!GraphicsEnvironment.isHeadless()) {
isXPorLater = initNative();
}
}
@@ -199,22 +199,22 @@
* rather than using a switch this will be more efficient.
*/
this.disposer = new FontStrikeDisposer(fileFont, desc);
initGlyphCache();
pScalerContext = NullFontScaler.getNullScalerContext();
- FontManager.deRegisterBadFont(fileFont);
+ SunFontManager.getInstance().deRegisterBadFont(fileFont);
return;
}
/* First, see if native code should be used to create the glyph.
* GDI will return the integer metrics, not fractional metrics, which
* may be requested for this strike, so we would require here that :
* desc.fmHint != INTVAL_FRACTIONALMETRICS_ON
* except that the advance returned by GDI is always overwritten by
* the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
*/
- if (FontManager.isWindows && isXPorLater &&
- !FontManager.useT2K &&
+ if (FontUtilities.isWindows && isXPorLater &&
+ !FontUtilities.useT2K &&
!GraphicsEnvironment.isHeadless() &&
!fileFont.useJavaRasterizer &&
(desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HRGB ||
desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HBGR) &&
(matrix[1] == 0.0 && matrix[2] == 0.0 &&
@@ -239,12 +239,12 @@
nativeStrikes[i] =
new NativeStrike(fileFont.nativeFonts[i], desc, false);
}
}
}
- if (FontManager.logging && FontManager.isWindows) {
- FontManager.logger.info
+ if (FontUtilities.isLogging() && FontUtilities.isWindows) {
+ FontUtilities.getLogger().info
("Strike for " + fileFont + " at size = " + intPtSize +
" use natives = " + useNatives +
" useJavaRasteriser = " + fileFont.useJavaRasterizer +
" AAHint = " + desc.aaHint +
" Has Embedded bitmaps = " +
@@ -296,11 +296,11 @@
public int getNumGlyphs() {
return fileFont.getNumGlyphs();
}
long getGlyphImageFromNative(int glyphCode) {
- if (FontManager.isWindows) {
+ if (FontUtilities.isWindows) {
return getGlyphImageFromWindows(glyphCode);
} else {
return getGlyphImageFromX11(glyphCode);
}
}
@@ -364,12 +364,12 @@
if ((glyphPtr = getCachedGlyphPtr(glyphCode)) != 0L) {
return glyphPtr;
} else {
if (useNatives) {
glyphPtr = getGlyphImageFromNative(glyphCode);
- if (glyphPtr == 0L && FontManager.logging) {
- FontManager.logger.info
+ if (glyphPtr == 0L && FontUtilities.isLogging()) {
+ FontUtilities.getLogger().info
("Strike for " + fileFont +
" at size = " + intPtSize +
" couldn't get native glyph for code = " + glyphCode);
}
} if (glyphPtr == 0L) {
@@ -526,21 +526,21 @@
int numGlyphs = mapper.getNumGlyphs();
if (segmentedCache) {
int numSegments = (numGlyphs + SEGSIZE-1)/SEGSIZE;
- if (FontManager.longAddresses) {
+ if (longAddresses) {
glyphCacheFormat = SEGLONGARRAY;
segLongGlyphImages = new long[numSegments][];
this.disposer.segLongGlyphImages = segLongGlyphImages;
} else {
glyphCacheFormat = SEGINTARRAY;
segIntGlyphImages = new int[numSegments][];
this.disposer.segIntGlyphImages = segIntGlyphImages;
}
} else {
- if (FontManager.longAddresses) {
+ if (longAddresses) {
glyphCacheFormat = LONGARRAY;
longGlyphImages = new long[numGlyphs];
this.disposer.longGlyphImages = longGlyphImages;
} else {
glyphCacheFormat = INTARRAY;