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


Java FontManagerForSGE类代码示例

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


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

示例1: getAllFonts

import sun.font.FontManagerForSGE; //导入依赖的package包/类
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:SunGraphicsEnvironment.java

示例2: getAvailableFontFamilyNames

import sun.font.FontManagerForSGE; //导入依赖的package包/类
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:SunGraphicsEnvironment.java

示例3: getAvailableFontFamilyNames

import sun.font.FontManagerForSGE; //导入依赖的package包/类
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = map.get(keyNames[i]);
        }
        return retval;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:SunGraphicsEnvironment.java

示例4: getFontManagerForSGE

import sun.font.FontManagerForSGE; //导入依赖的package包/类
public static FontManagerForSGE getFontManagerForSGE() {
    FontManager fm = FontManagerFactory.getInstance();
    return (FontManagerForSGE) fm;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:SunGraphicsEnvironment.java


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