< prev index next >
src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
Print this page
rev 11361 : imported patch refactor-fm.patch
@@ -37,14 +37,14 @@
import java.nio.file.Files;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
import java.util.Scanner;
+import sun.awt.FcFontManager;
import sun.awt.FontConfiguration;
import sun.awt.FontDescriptor;
import sun.awt.SunToolkit;
-import sun.awt.X11FontManager;
import sun.font.CompositeFontDescriptor;
import sun.font.FontManager;
import sun.font.FontConfigManager.FontConfigInfo;
import sun.font.FontConfigManager.FcCompFont;
import sun.font.FontConfigManager.FontConfigFont;
@@ -90,11 +90,11 @@
return true;
}
setFontConfiguration();
readFcInfo();
- X11FontManager fm = (X11FontManager) fontManager;
+ FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
if (fcCompFonts == null) {
fcCompFonts = fcm.loadFontConfig();
if (fcCompFonts != null) {
try {
@@ -192,11 +192,11 @@
}
@Override
public String[] getPlatformFontNames() {
HashSet<String> nameSet = new HashSet<String>();
- X11FontManager fm = (X11FontManager) fontManager;
+ FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
for (int i=0; i<fcCompFonts.length; i++) {
for (int j=0; j<fcCompFonts[i].allFonts.length; j++) {
nameSet.add(fcCompFonts[i].allFonts[j].fontFile);
@@ -233,11 +233,11 @@
}
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
- X11FontManager fm = (X11FontManager) fontManager;
+ FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
@@ -366,11 +366,11 @@
}
private void writeFcInfo() {
Properties props = new Properties();
props.setProperty("version", fileVersion);
- X11FontManager fm = (X11FontManager) fontManager;
+ FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FontConfigInfo fcInfo = fcm.getFontConfigInfo();
props.setProperty("fcversion", Integer.toString(fcInfo.fcVersion));
if (fcInfo.cacheDirs != null) {
for (int i=0;i<fcInfo.cacheDirs.length;i++) {
@@ -425,11 +425,11 @@
File fcFile = getFcInfoFile();
if (!fcFile.exists()) {
return;
}
Properties props = new Properties();
- X11FontManager fm = (X11FontManager) fontManager;
+ FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
try {
FileInputStream fis = new FileInputStream(fcFile);
props.load(fis);
fis.close();
< prev index next >