本文整理汇总了Java中sun.font.CompositeFont.getFamilyName方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeFont.getFamilyName方法的具体用法?Java CompositeFont.getFamilyName怎么用?Java CompositeFont.getFamilyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.font.CompositeFont
的用法示例。
在下文中一共展示了CompositeFont.getFamilyName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFontConfigFUIR
import sun.font.CompositeFont; //导入方法依赖的package包/类
@Override
protected FontUIResource getFontConfigFUIR(String family, int style, int size) {
CompositeFont font2D = getFontConfigManager().getFontConfigFont(family, style);
if (font2D == null) { // Not expected, just a precaution.
return new FontUIResource(family, style, size);
}
/* The name of the font will be that of the physical font in slot,
* but by setting the handle to that of the CompositeFont it
* renders as that CompositeFont.
* It also needs to be marked as a created font which is the
* current mechanism to signal that deriveFont etc must copy
* the handle from the original font.
*/
FontUIResource fuir =
new FontUIResource(font2D.getFamilyName(null), style, size);
FontAccess.getFontAccess().setFont2D(fuir, font2D.handle);
FontAccess.getFontAccess().setCreatedFont(fuir);
return fuir;
}