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


Java TrueTypeFont类代码示例

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


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

示例1: platformFontCount

import sun.font.TrueTypeFont; //导入依赖的package包/类
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:WPathGraphics.java

示例2: run

import sun.font.TrueTypeFont; //导入依赖的package包/类
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:Win32FontManager.java

示例3: run

import sun.font.TrueTypeFont; //导入依赖的package包/类
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:Win32FontManager.java

示例4: getEUDCFont

import sun.font.TrueTypeFont; //导入依赖的package包/类
public TrueTypeFont getEUDCFont() {
    return eudcFont;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:Win32FontManager.java


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