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


Java Font.decode方法代码示例

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


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

示例1: MockingGenerationContext

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Instantiates a new Mocking generation context.
 *
 * @param locale                  the locale
 * @param preview                 the preview
 * @param release                 the release
 * @param enableServiceBrokerFake the enable service broker fake
 * @param supportedEnvironments   the supported environments
 */
public MockingGenerationContext(final Locale locale, final boolean preview, final boolean release, final boolean enableServiceBrokerFake,
                                final Env supportedEnvironments) {
    super(locale, preview, release, enableServiceBrokerFake, supportedEnvironments);
    this.locale = locale;
    scheduleContext = new MockingScheduleContext(locale, supportedEnvironments);
    fileHandles = new HashMap<>();
    printable = Mockito.mock(Printable.class);
    stack = new LinkedList<>();
    contextStack = new LinkedList<>();
    pageContext = Mockito.mock(Context.class);
    dataSet = Mockito.mock(Dataset.class);
    pageParams = Mockito.mock(PageParams.class);
    closeables = new LinkedList<>();
    context = Mockito.mock(Context.class);
    urlCreator = Mockito.mock(UrlCreator.class);
    urlCreatorProvider = Mockito.mock(UrlCreatorProvider.class);
    node = Mockito.mock(ContentProducer.class);
    navigationContext = Mockito.mock(IDProvider.class);
    encoding = Charset.forName("UTF-8").name();
    font = Font.decode(Font.MONOSPACED);
    evaluator = Mockito.mock(Evaluator.class);
    characterReplacer = Mockito.mock(CharacterReplacer.class);
}
 
开发者ID:e-Spirit,项目名称:FSTestTools,代码行数:33,代码来源:MockingGenerationContext.java

示例2: setLabelFont

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Set the label font, which is used for axis labels and legend labels.
 * The font names understood are those understood by
 * java.awt.Font.decode().
 *
 * @param name A font name.
 */

public synchronized void setLabelFont(String name) {
    // Changing legend means we need to repaint the offscreen buffer.
    _plotImage = null;

    _labelFont = Font.decode(name);
    _labelFontMetrics = getFontMetrics(_labelFont);
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:16,代码来源:PlotBox.java

示例3: setTitleFont

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Set the title font.
 * The font names understood are those understood by
 * java.awt.Font.decode().
 *
 * @param name A font name.
 */

public synchronized void setTitleFont(String name) {
    // Changing legend means we need to repaint the offscreen buffer.
    _plotImage = null;

    _titleFont = Font.decode(name);
    _titleFontMetrics = getFontMetrics(_titleFont);
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:16,代码来源:PlotBox.java

示例4: getDefaultFont

import java.awt.Font; //导入方法依赖的package包/类
public static Font getDefaultFont() {
    Font f = UIManager.getDefaults().getFont("TextField.font");
    if (f == null) {
        f = Font.decode(null);
    }
    return new Font(f.getName(), Font.BOLD, f.getSize());
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:8,代码来源:MapObjectImpl.java

示例5: createMainFont

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Create a default {@code Font} set on initialization of the GUI.
 * 
 * @param fontName Can be used to choose a different font from a
 *     user-provided name.
 * @param scaleFactor The applied scale factor.
 * @return The new {@code Font}.
 */
static Font createMainFont(String fontName, float scaleFactor) {
    final float defaultSize = 12f * scaleFactor;
    mainFont = null;
    if (fontName != null) {
        Font font = Font.decode(fontName);
        mainFont = font = font.deriveFont(defaultSize);
        return font;
    }
    return ResourceManager.getFont("font.normal").deriveFont(defaultSize);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:19,代码来源:FontLibrary.java

示例6: FontResource

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Do not use directly.
 *
 * @param resourceLocator The {@code URI} used when loading this
 *     resource.
 * @exception IOException if unable to read the font.
 */
public FontResource(URI resourceLocator) throws IOException {
    super(resourceLocator);
    font = null;
    try {
        if (resourceLocator.getPath() != null
            && resourceLocator.getPath().endsWith(".ttf")) {
            URL url = resourceLocator.toURL();
            font = Font.createFont(Font.TRUETYPE_FONT, url.openStream());
        } else {
            String name = resourceLocator.getSchemeSpecificPart();
            font = Font.decode(name.substring(SCHEME.length()));
        }

        if (font != null) {
            GraphicsEnvironment.getLocalGraphicsEnvironment()
                .registerFont(font);
        }

        logger.info("Loaded font: " + font.getFontName()
            + " from: " + resourceLocator);
    } catch (FontFormatException|IOException ex) {
        logger.log(Level.WARNING,
            "Failed loading font from: " + resourceLocator, ex);
        throw new IOException(ex.getMessage());
    }
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:34,代码来源:FontResource.java

示例7: PPMonospacedLabel

import java.awt.Font; //导入方法依赖的package包/类
public PPMonospacedLabel(String text, String str, String unit) {
   this(text, Font.decode(str), unit);
}
 
开发者ID:eric-roberts,项目名称:JavaPPTX,代码行数:4,代码来源:PPMonospacedLabel.java

示例8: parse

import java.awt.Font; //导入方法依赖的package包/类
@Override
public Font parse(String value) {
	return Font.decode(value);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:5,代码来源:Attributes.java

示例9: getEmergencyFont

import java.awt.Font; //导入方法依赖的package包/类
/**
 * Gets a font of last resort, as finding fonts must not fail!
 * Currently using the default Java font, not matter how ugly.
 *
 * @return The default Java font.
 */
public static Font getEmergencyFont() {
    logger.warning("Using emergency font");
    return Font.decode(null);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:11,代码来源:FontResource.java


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