< prev index next >
src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
Print this page
rev 11361 : imported patch refactor-fm.patch
*** 37,50 ****
import java.nio.file.Files;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
import java.util.Scanner;
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;
--- 37,50 ----
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.font.CompositeFontDescriptor;
import sun.font.FontManager;
import sun.font.FontConfigManager.FontConfigInfo;
import sun.font.FontConfigManager.FcCompFont;
import sun.font.FontConfigManager.FontConfigFont;
*** 90,100 ****
return true;
}
setFontConfiguration();
readFcInfo();
! X11FontManager fm = (X11FontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
if (fcCompFonts == null) {
fcCompFonts = fcm.loadFontConfig();
if (fcCompFonts != null) {
try {
--- 90,100 ----
return true;
}
setFontConfiguration();
readFcInfo();
! FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
if (fcCompFonts == null) {
fcCompFonts = fcm.loadFontConfig();
if (fcCompFonts != null) {
try {
*** 192,202 ****
}
@Override
public String[] getPlatformFontNames() {
HashSet<String> nameSet = new HashSet<String>();
! X11FontManager fm = (X11FontManager) 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);
--- 192,202 ----
}
@Override
public String[] getPlatformFontNames() {
HashSet<String> nameSet = new HashSet<String>();
! 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,243 ****
}
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
! X11FontManager fm = (X11FontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
--- 233,243 ----
}
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
! FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
FcCompFont[] fcCompFonts = fcm.loadFontConfig();
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
*** 366,376 ****
}
private void writeFcInfo() {
Properties props = new Properties();
props.setProperty("version", fileVersion);
! X11FontManager fm = (X11FontManager) 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++) {
--- 366,376 ----
}
private void writeFcInfo() {
Properties props = new Properties();
props.setProperty("version", fileVersion);
! 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,435 ****
File fcFile = getFcInfoFile();
if (!fcFile.exists()) {
return;
}
Properties props = new Properties();
! X11FontManager fm = (X11FontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
try {
FileInputStream fis = new FileInputStream(fcFile);
props.load(fis);
fis.close();
--- 425,435 ----
File fcFile = getFcInfoFile();
if (!fcFile.exists()) {
return;
}
Properties props = new Properties();
! FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
try {
FileInputStream fis = new FileInputStream(fcFile);
props.load(fis);
fis.close();
< prev index next >