< prev index next >

modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java

Print this page

        

*** 54,64 **** public static final boolean isMacOSX; public static final boolean isIOS; public static final boolean isAndroid; public static final boolean isEmbedded; public static final int cacheLayoutSize; - static boolean useNativeRasterizer; private static int subPixelMode; public static final int SUB_PIXEL_ON = 1; public static final int SUB_PIXEL_Y = 2; public static final int SUB_PIXEL_NATIVE = 4; private static float fontSizeLimit = 80f; --- 54,63 ----
*** 67,77 **** private static float lcdContrast = -1; private static String jreFontDir; private static final String jreDefaultFont = "Lucida Sans Regular"; private static final String jreDefaultFontLC = "lucida sans regular"; private static final String jreDefaultFontFile = "LucidaSansRegular.ttf"; - private static final String T2K_FACTORY = "com.sun.javafx.font.t2k.T2KFactory"; private static final String CT_FACTORY = "com.sun.javafx.font.coretext.CTFactory"; private static final String DW_FACTORY = "com.sun.javafx.font.directwrite.DWFactory"; private static final String FT_FACTORY = "com.sun.javafx.font.freetype.FTFactory"; /* We need two maps. One to hold pointers to the raw fonts, another --- 66,75 ----
*** 132,152 **** } catch (NumberFormatException nfe) { System.err.println("Cannot parse fontSizeLimit '" + s + "'"); } } ! useNativeRasterizer = isMacOSX || isWindows || isLinux; ! String defPrismText = useNativeRasterizer ? "native" : "t2k"; ! String prismText = System.getProperty("prism.text", defPrismText); ! if (useNativeRasterizer) { ! useNativeRasterizer = !prismText.equals("t2k"); ! } else { ! useNativeRasterizer = prismText.equals("native"); ! } ! ! boolean lcdTextOff = (isMacOSX && !useNativeRasterizer) || ! isIOS || isAndroid || isEmbedded; String defLCDProp = lcdTextOff ? "false" : "true"; String lcdProp = System.getProperty("prism.lcdtext", defLCDProp); lcdEnabled = lcdProp.equals("true"); s = System.getProperty("prism.cacheLayoutSize"); --- 130,140 ---- } catch (NumberFormatException nfe) { System.err.println("Cannot parse fontSizeLimit '" + s + "'"); } } ! boolean lcdTextOff = isIOS || isAndroid || isEmbedded; String defLCDProp = lcdTextOff ? "false" : "true"; String lcdProp = System.getProperty("prism.lcdtext", defLCDProp); lcdEnabled = lcdProp.equals("true"); s = System.getProperty("prism.cacheLayoutSize");
*** 199,215 **** private static PrismFontFactory theFontFactory = null; public static synchronized PrismFontFactory getFontFactory() { if (theFontFactory != null) { return theFontFactory; } ! String factoryClass = null; ! if (useNativeRasterizer) { ! factoryClass = getNativeFactoryName(); ! } if (factoryClass == null) { ! useNativeRasterizer = false; ! factoryClass = T2K_FACTORY; } if (debugFonts) { System.err.println("Loading FontFactory " + factoryClass); if (subPixelMode != 0) { String s = "Subpixel: enabled"; --- 187,199 ---- private static PrismFontFactory theFontFactory = null; public static synchronized PrismFontFactory getFontFactory() { if (theFontFactory != null) { return theFontFactory; } ! String factoryClass = getNativeFactoryName(); if (factoryClass == null) { ! throw new InternalError("cannot find a native font factory"); } if (debugFonts) { System.err.println("Loading FontFactory " + factoryClass); if (subPixelMode != 0) { String s = "Subpixel: enabled";
*** 222,247 **** System.err.println(s); } } theFontFactory = getFontFactory(factoryClass); if (theFontFactory == null) { ! if (useNativeRasterizer) { ! // If native failed use T2K (i.e. Windows Vista) ! useNativeRasterizer = false; ! factoryClass = T2K_FACTORY; ! } else { ! // If T2K failed use native (i.e. OpenJFX build) ! useNativeRasterizer = true; ! factoryClass = getNativeFactoryName(); ! } ! if (factoryClass != null) { ! theFontFactory = getFontFactory(factoryClass); ! } ! if (debugFonts) { ! System.err.println("*** Loading primary font factory failed. ***"); ! System.err.println("*** Fallbacking to " + factoryClass + " ***"); ! } } return theFontFactory; } private static synchronized PrismFontFactory getFontFactory(String factoryClass) { --- 206,216 ---- System.err.println(s); } } theFontFactory = getFontFactory(factoryClass); if (theFontFactory == null) { ! throw new InternalError("cannot load font factory: "+ factoryClass); } return theFontFactory; } private static synchronized PrismFontFactory getFontFactory(String factoryClass) {
*** 524,537 **** } if (fr == null) { continue; } storeInMap(lcFontName, fr); - // if (wantComp) { - // // wrap with fallback support - // fr = new T2KCompositeFontResource(fr, lcFontName); - // } } if (bold == fr.isBold() && italic == fr.isItalic()) { storeInMap(lcFamilyName+styleStr, fr); if (wantComp) { // wrap with fallback support fr = new PrismCompositeFontResource(fr, --- 493,502 ----
*** 2041,2048 **** } return monospaceFontFamily; } } ! /* Called from T2KFontFile which caches the return value */ static native short getSystemLCID(); } --- 2006,2013 ---- } return monospaceFontFamily; } } ! /* Called from PrismFontFile which caches the return value */ static native short getSystemLCID(); }
< prev index next >