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


Java Font.getFontData方法代码示例

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


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

示例1: updateScaledFont

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
/**
 * update scaledFonts
 * @param zoom
 * 				at zoom 
 */
private void updateScaledFont(double zoom) {
	if (cachedZoom == zoom)
		return;
	
	Text text = (Text)getCellEditor().getControl();
	Font font = getEditPart().getFigure().getFont();
	
	disposeScaledFont();
	cachedZoom = zoom;
	if (zoom == 1.0)
		text.setFont(font);
	else {
		FontData fd = font.getFontData()[0];
		fd.setHeight((int)(fd.getHeight() * zoom));
		text.setFont(scaledFont = new Font(null, fd));
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:CommentBoxLabelEditManager.java

示例2: get

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
@Override
public Font get() {
	final Font font = getDialogArea().getFont();
	final FontData[] data = font.getFontData();
	for (int i = 0; i < data.length; i++) {
		data[i].setStyle(BOLD);
	}
	return new Font(font.getDevice(), data);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:OpenTypeSelectionDialog.java

示例3: initFormText

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
public static void initFormText(FormText formText) {

        formText.setWhitespaceNormalized(false);

        Font formTextFont = formText.getFont();
        FontData formTextFontData = formTextFont.getFontData()[0];

        FontData h1FontData = new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 5, SWT.BOLD);
        final Font h1Font = new Font(formTextFont.getDevice(), h1FontData);
        formText.setFont(FONT_H1_KEY, h1Font);

        FontData h3FontData = new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 3, SWT.BOLD);
        final Font h3Font = new Font(formTextFont.getDevice(), h3FontData);
        formText.setFont(FONT_H3_KEY, h3Font);

        Font codeFont = JFaceResources.getTextFont();
        formText.setFont(FONT_CODE_KEY, codeFont);

        formText.addDisposeListener(new DisposeListener() {

            @Override
            public void widgetDisposed(DisposeEvent e) {
                h1Font.dispose();
                h3Font.dispose();
            }
        });

        // Set fontKeySet = JFaceResources.getFontRegistry().getKeySet();
        // if (fontKeySet != null) {
        // for (Object fontKey : fontKeySet) {
        // System.out.println(fontKey);
        // }
        // }

    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:36,代码来源:JmxDocFormText.java

示例4: setProviderLoadingFailureText

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
/**
 * Set the supplied text for the provider description text widget and make its font style
 * bold.
 * @param text The text for the provider description text widget.
 */
private void setProviderLoadingFailureText(String text) {
	this.providerDescriptionText.setText(text);
	Font font = this.providerDescriptionText.getFont();
	FontData[] fontData = font.getFontData();
	fontData[0].setStyle(SWT.BOLD);
	this.providerDescriptionText.setFont(new Font(this.display, fontData));
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:13,代码来源:GeneratorSelectionComposite.java

示例5: setGeneratorLoadingFailureText

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
/**
 * Set the supplied text for the generator description text widget and make its font style
 * bold.
 * @param text The text for the generator description text widget.
 */
private void setGeneratorLoadingFailureText(String text) {
	this.generatorDescriptionText.setText(text);
	Font font = this.generatorDescriptionText.getFont();
	FontData[] fontData = font.getFontData();
	fontData[0].setStyle(SWT.BOLD);
	this.generatorDescriptionText.setFont(new Font(this.display, fontData));
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:13,代码来源:GeneratorSelectionComposite.java

示例6: newStyledFont

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
private Font newStyledFont(int index, int style) {

        Font f = regFonts[index];
        if (isset(f)) {
            FontData[] fontData = f.getFontData();
            fontData[0].setStyle(style);
            fontData[0].setLocale(Translate.getLocale().toString());
            return new Font(Display.getDefault(), fontData);
        } else {
            Application.report("newBold failed. f=" + f);
        }
        return null;
    }
 
开发者ID:openaudible,项目名称:openaudible,代码行数:14,代码来源:FontShop.java

示例7: newDefaultFont

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
private Font newDefaultFont(int id) {
    Display display = Display.getCurrent();
    int bump = 0;
    Font fontCopy = null;

    switch (id) {
        case DIALOG_FONT:
            fontCopy = JFaceResources.getDialogFont();
            break;
        case TABLE_FONT:
            fontCopy = JFaceResources.getDefaultFont();
            if (GUI.isMac())
                bump = -1;
            break;

        case TEXT_FONT:

            fontCopy = JFaceResources.getTextFont();
            break;

        case HEADER_FONT:
            fontCopy = JFaceResources.getDefaultFont();
            break;
        case TREE_FONT:
            fontCopy = JFaceResources.getTextFont();
            break;

        default:
            break;
    }

    FontData fd;

    if (fontCopy != null)
        fd = fontCopy.getFontData()[0];
    else
        fd = display.getSystemFont().getFontData()[0];
    int size = Math.round(fd.getHeight()) + bump;

    Font f = new Font(display, fd.getName(), size, 0);
    FontData ff = f.getFontData()[0];

    return f;
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:45,代码来源:FontShop.java

示例8: toAwtFont

import org.eclipse.swt.graphics.Font; //导入方法依赖的package包/类
/**
 * Create an awt font by converting as much information 
 * as possible from the provided swt <code>Font</code>.
 * 
 * @param device The swt device to draw on (display or gc device).
 * @param font The swt font to convert.
 * @return An awt font converted from the provided swt font.
 */
public static java.awt.Font toAwtFont(Device device, Font font) {
    FontData fontData = font.getFontData()[0]; 
    return toAwtFont(device, fontData, true);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:SWTUtils.java


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