本文整理汇总了Java中sun.font.FontConfigManager.FontConfigFont类的典型用法代码示例。如果您正苦于以下问题:Java FontConfigFont类的具体用法?Java FontConfigFont怎么用?Java FontConfigFont使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FontConfigFont类属于sun.font.FontConfigManager包,在下文中一共展示了FontConfigFont类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFcFontList
import sun.font.FontConfigManager.FontConfigFont; //导入依赖的package包/类
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
String fontname, int style) {
if (fontname.equals("dialog")) {
fontname = "sansserif";
} else if (fontname.equals("dialoginput")) {
fontname = "monospaced";
}
for (int i=0; i<fcFonts.length; i++) {
if (fontname.equals(fcFonts[i].jdkName) &&
style == fcFonts[i].style) {
return fcFonts[i].allFonts;
}
}
return fcFonts[0].allFonts;
}
示例2: get2DCompositeFontInfo
import sun.font.FontConfigManager.FontConfigFont; //导入依赖的package包/类
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
X11FontManager fm = (X11FontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
String fontName = publicFontNames[fontIndex];
for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {
String faceName = fontName + "." + styleNames[styleIndex];
FontConfigFont[] fcFonts =
getFcFontList(fcCompFonts,
fontNames[fontIndex], styleIndex);
int numFonts = fcFonts.length;
// fall back fonts listed in the lib/fonts/fallback directory
if (installedFallbackFontFiles != null) {
numFonts += installedFallbackFontFiles.length;
}
String[] fileNames = new String[numFonts];
String[] faceNames = new String[numFonts];
int index;
for (index = 0; index < fcFonts.length; index++) {
fileNames[index] = fcFonts[index].fontFile;
faceNames[index] = fcFonts[index].familyName;
}
if (installedFallbackFontFiles != null) {
System.arraycopy(installedFallbackFontFiles, 0,
fileNames, fcFonts.length,
installedFallbackFontFiles.length);
}
result[fontIndex * NUM_STYLES + styleIndex]
= new CompositeFontDescriptor(
faceName,
1,
faceNames,
fileNames,
null, null);
}
}
return result;
}
示例3: get2DCompositeFontInfo
import sun.font.FontConfigManager.FontConfigFont; //导入依赖的package包/类
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
String fontName = publicFontNames[fontIndex];
for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {
String faceName = fontName + "." + styleNames[styleIndex];
FontConfigFont[] fcFonts =
getFcFontList(fcCompFonts,
fontNames[fontIndex], styleIndex);
int numFonts = fcFonts.length;
// fall back fonts listed in the lib/fonts/fallback directory
if (installedFallbackFontFiles != null) {
numFonts += installedFallbackFontFiles.length;
}
String[] fileNames = new String[numFonts];
String[] faceNames = new String[numFonts];
int index;
for (index = 0; index < fcFonts.length; index++) {
fileNames[index] = fcFonts[index].fontFile;
faceNames[index] = fcFonts[index].familyName;
}
if (installedFallbackFontFiles != null) {
System.arraycopy(installedFallbackFontFiles, 0,
fileNames, fcFonts.length,
installedFallbackFontFiles.length);
}
result[fontIndex * NUM_STYLES + styleIndex]
= new CompositeFontDescriptor(
faceName,
1,
faceNames,
fileNames,
null, null);
}
}
return result;
}
示例4: get2DCompositeFontInfo
import sun.font.FontConfigManager.FontConfigFont; //导入依赖的package包/类
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
X11FontManager fm = (X11FontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
String fontName = publicFontNames[fontIndex];
for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {
String faceName = fontName + "." + styleNames[styleIndex];
FontConfigFont[] fcFonts =
getFcFontList(fcCompFonts,
fontNames[fontIndex], styleIndex);
int numFonts = fcFonts.length;
// fall back fonts listed in the lib/fonts/fallback directory
if (installedFallbackFontFiles != null) {
numFonts += installedFallbackFontFiles.length;
}
String[] fileNames = new String[numFonts];
int index;
for (index = 0; index < fcFonts.length; index++) {
fileNames[index] = fcFonts[index].fontFile;
}
if (installedFallbackFontFiles != null) {
System.arraycopy(installedFallbackFontFiles, 0,
fileNames, fcFonts.length,
installedFallbackFontFiles.length);
}
result[fontIndex * NUM_STYLES + styleIndex]
= new CompositeFontDescriptor(
faceName,
1,
null,
fileNames,
null, null);
}
}
return result;
}