当前位置: 首页>>代码示例>>Java>>正文


Java FontUtilities.debugFonts方法代码示例

本文整理汇总了Java中sun.font.FontUtilities.debugFonts方法的典型用法代码示例。如果您正苦于以下问题:Java FontUtilities.debugFonts方法的具体用法?Java FontUtilities.debugFonts怎么用?Java FontUtilities.debugFonts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.font.FontUtilities的用法示例。


在下文中一共展示了FontUtilities.debugFonts方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FontConfiguration

import sun.font.FontUtilities; //导入方法依赖的package包/类
public FontConfiguration(SunFontManager fm) {
    if (FontUtilities.debugFonts()) {
        FontUtilities.getLogger()
            .info("Creating standard Font Configuration");
    }
    if (FontUtilities.debugFonts() && logger == null) {
        logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
    }
    fontManager = fm;
    setOsNameAndVersion();  /* static initialization */
    setEncoding();          /* static initialization */
    /* Separating out the file location from the rest of the
     * initialisation, so the caller has the option of doing
     * something else if a suitable file isn't found.
     */
    findFontConfigFile();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:FontConfiguration.java

示例2: FontConfiguration

import sun.font.FontUtilities; //导入方法依赖的package包/类
public FontConfiguration(SunFontManager fm,
                         boolean preferLocaleFonts,
                         boolean preferPropFonts) {
    fontManager = fm;
    if (FontUtilities.debugFonts()) {
        FontUtilities.getLogger()
            .info("Creating alternate Font Configuration");
    }
    this.preferLocaleFonts = preferLocaleFonts;
    this.preferPropFonts = preferPropFonts;
    /* fontConfig should be initialised by default constructor, and
     * its data tables can be shared, since readFontConfigFile doesn't
     * update any other state. Also avoid a doPrivileged block.
     */
    initFontConfig();
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:17,代码来源:FontConfiguration.java

示例3: needToSearchForFile

import sun.font.FontUtilities; //导入方法依赖的package包/类
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:FontConfiguration.java

示例4: readFontConfigFile

import sun.font.FontUtilities; //导入方法依赖的package包/类
private void readFontConfigFile(File f) {
    /* This is invoked here as readFontConfigFile is only invoked
     * once per VM, and always in a privileged context, thus the
     * directory containing installed fall back fonts is accessed
     * from this context
     */
    getInstalledFallbackFonts(javaLib);

    if (f != null) {
        try {
            FileInputStream in = new FileInputStream(f.getPath());
            if (isProperties) {
                loadProperties(in);
            } else {
                loadBinary(in);
            }
            in.close();
            if (FontUtilities.debugFonts()) {
                logger.config("Read logical font configuration from " + f);
            }
        } catch (IOException e) {
            if (FontUtilities.debugFonts()) {
                logger.config("Failed to read logical font configuration from " + f);
            }
        }
    }
    String version = getVersion();
    if (!"1".equals(version) && FontUtilities.debugFonts()) {
        logger.config("Unsupported fontconfig version: " + version);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:FontConfiguration.java

示例5: specificFontIDForName

import sun.font.FontUtilities; //导入方法依赖的package包/类
private String specificFontIDForName(String name) {

        int[] hPos = new int[14];
        int hyphenCnt = 1;
        int pos = 1;

        while (pos != -1 && hyphenCnt < 14) {
            pos = name.indexOf('-', pos);
            if (pos != -1) {
                hPos[hyphenCnt++] = pos;
                    pos++;
            }
        }

        if (hyphenCnt != 14) {
            if (FontUtilities.debugFonts()) {
                FontUtilities.getLogger()
                    .severe("Font Configuration Font ID is malformed:" + name);
            }
            return name; // what else can we do?
        }

        StringBuffer sb =
            new StringBuffer(name.substring(hPos[FAMILY_NAME_FIELD-1],
                                            hPos[SETWIDTH_NAME_FIELD]));
        sb.append(name.substring(hPos[CHARSET_REGISTRY_FIELD-1]));
        String retval = sb.toString().toLowerCase (Locale.ENGLISH);
        return retval;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:X11FontManager.java

示例6: MFontConfiguration

import sun.font.FontUtilities; //导入方法依赖的package包/类
public MFontConfiguration(SunFontManager fm,
                          boolean preferLocaleFonts,
                          boolean preferPropFonts) {
    super(fm, preferLocaleFonts, preferPropFonts);
    if (FontUtilities.debugFonts()) {
        logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
    }
    initTables();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:MFontConfiguration.java

示例7: getPlatformFontPathFromFontConfig

import sun.font.FontUtilities; //导入方法依赖的package包/类
private void getPlatformFontPathFromFontConfig() {
    if (fontConfigDirs == null) {
        fontConfigDirs = getFontConfiguration().getAWTFontPathSet();
        if (FontUtilities.debugFonts() && fontConfigDirs != null) {
            String[] names = fontConfigDirs.toArray(new String[0]);
            for (int i=0;i<names.length;i++) {
                FontUtilities.getLogger().info("awtfontpath : " + names[i]);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:X11FontManager.java

示例8: MFontConfiguration

import sun.font.FontUtilities; //导入方法依赖的package包/类
public MFontConfiguration(SunFontManager fm) {
    super(fm);
    if (FontUtilities.debugFonts()) {
        logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
    }
    initTables();
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:8,代码来源:MFontConfiguration.java

示例9: parseExclusions

import sun.font.FontUtilities; //导入方法依赖的package包/类
private int[] parseExclusions(String key, String exclusions) {
    if (exclusions == null) {
        return EMPTY_INT_ARRAY;
    }
    // range format is xxxx-XXXX,yyyyyy-YYYYYY,.....
    int numExclusions = 1;
    int pos = 0;
    while ((pos = exclusions.indexOf(',', pos)) != -1) {
        numExclusions++;
        pos++;
    }
    int[] exclusionRanges = new int[numExclusions * 2];
    pos = 0;
    int newPos = 0;
    for (int j = 0; j < numExclusions * 2; ) {
        String lower, upper;
        int lo = 0, up = 0;
        try {
            newPos = exclusions.indexOf('-', pos);
            lower = exclusions.substring(pos, newPos);
            pos = newPos + 1;
            newPos = exclusions.indexOf(',', pos);
            if (newPos == -1) {
                newPos = exclusions.length();
            }
            upper = exclusions.substring(pos, newPos);
            pos = newPos + 1;
            int lowerLength = lower.length();
            int upperLength = upper.length();
            if (lowerLength != 4 && lowerLength != 6
                || upperLength != 4 && upperLength != 6) {
                throw new Exception();
            }
            lo = Integer.parseInt(lower, 16);
            up = Integer.parseInt(upper, 16);
            if (lo > up) {
                throw new Exception();
            }
        } catch (Exception e) {
            if (FontUtilities.debugFonts() &&
                logger != null) {
                logger.config("Failed parsing " + key +
                          " property of font configuration.");

            }
            return EMPTY_INT_ARRAY;
        }
        exclusionRanges[j++] = lo;
        exclusionRanges[j++] = up;
    }
    return exclusionRanges;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:53,代码来源:FontConfiguration.java

示例10: switchFontIDForName

import sun.font.FontUtilities; //导入方法依赖的package包/类
private String switchFontIDForName(String name) {

        int[] hPos = new int[14];
        int hyphenCnt = 1;
        int pos = 1;

        while (pos != -1 && hyphenCnt < 14) {
            pos = name.indexOf('-', pos);
            if (pos != -1) {
                hPos[hyphenCnt++] = pos;
                    pos++;
            }
        }

        if (hyphenCnt != 14) {
            if (FontUtilities.debugFonts()) {
                FontUtilities.getLogger()
                    .severe("Font Configuration Font ID is malformed:" + name);
            }
            return name; // what else can we do?
        }

        String slant = name.substring(hPos[SLANT_FIELD-1]+1,
                                           hPos[SLANT_FIELD]);
        String family = name.substring(hPos[FAMILY_NAME_FIELD-1]+1,
                                           hPos[FAMILY_NAME_FIELD]);
        String registry = name.substring(hPos[CHARSET_REGISTRY_FIELD-1]+1,
                                           hPos[CHARSET_REGISTRY_FIELD]);
        String encoding = name.substring(hPos[CHARSET_ENCODING_FIELD-1]+1);

        if (slant.equals("i")) {
            slant = "o";
        } else if (slant.equals("o")) {
            slant = "i";
        }
        // workaround for #4471000
        if (family.equals("itc zapfdingbats")
            && registry.equals("sun")
            && encoding.equals("fontspecific")){
            registry = "adobe";
        }
        StringBuffer sb =
            new StringBuffer(name.substring(hPos[FAMILY_NAME_FIELD-1],
                                            hPos[SLANT_FIELD-1]+1));
        sb.append(slant);
        sb.append(name.substring(hPos[SLANT_FIELD],
                                 hPos[SETWIDTH_NAME_FIELD]+1));
        sb.append(registry);
        sb.append(name.substring(hPos[CHARSET_ENCODING_FIELD-1]));
        String retval = sb.toString().toLowerCase (Locale.ENGLISH);
        return retval;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:53,代码来源:X11FontManager.java


注:本文中的sun.font.FontUtilities.debugFonts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。