< prev index next >

src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 35,45 **** import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.HashMap; import java.util.HashSet; - import java.util.Locale; import java.util.Properties; import java.util.Scanner; import sun.awt.FcFontManager; import sun.awt.FontConfiguration; import sun.awt.FontDescriptor; --- 35,44 ----
*** 263,273 **** String[] faceNames = new String[numFonts]; int index; for (index = 0; index < fcFonts.length; index++) { fileNames[index] = fcFonts[index].fontFile; ! faceNames[index] = fcFonts[index].fullName; } if (installedFallbackFontFiles != null) { System.arraycopy(installedFallbackFontFiles, 0, fileNames, fcFonts.length, --- 262,272 ---- 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,
*** 356,370 **** } String userDir = System.getProperty("user.home"); String version = System.getProperty("java.version"); String fs = File.separator; String dir = userDir+fs+".java"+fs+"fonts"+fs+version; ! Locale locale = SunToolkit.getStartupLocale(); ! String lang = locale.getLanguage(); ! String country = locale.getCountry(); String name = "fcinfo-"+fileVersion+"-"+hostname+"-"+ ! osName+"-"+osVersion+"-"+lang+"-"+country+".properties"; fcInfoFileName = dir+fs+name; } return new File(fcInfoFileName); } --- 355,367 ---- } String userDir = System.getProperty("user.home"); String version = System.getProperty("java.version"); String fs = File.separator; String dir = userDir+fs+".java"+fs+"fonts"+fs+version; ! String lang = SunToolkit.getStartupLocale().getLanguage(); String name = "fcinfo-"+fileVersion+"-"+hostname+"-"+ ! osName+"-"+osVersion+"-"+lang+".properties"; fcInfoFileName = dir+fs+name; } return new File(fcInfoFileName); }
*** 386,401 **** FcCompFont fci = fcCompFonts[i]; String styleKey = fci.jdkName+"."+fci.style; props.setProperty(styleKey+".length", Integer.toString(fci.allFonts.length)); for (int j=0; j<fci.allFonts.length; j++) { props.setProperty(styleKey+"."+j+".file", fci.allFonts[j].fontFile); - if (fci.allFonts[j].fullName != null) { - props.setProperty(styleKey+"."+j+".fullName", - fci.allFonts[j].fullName); - } } } try { /* This writes into a temp file then renames when done. * Since the rename is an atomic action within the same --- 383,396 ---- FcCompFont fci = fcCompFonts[i]; String styleKey = fci.jdkName+"."+fci.style; props.setProperty(styleKey+".length", Integer.toString(fci.allFonts.length)); for (int j=0; j<fci.allFonts.length; j++) { + props.setProperty(styleKey+"."+j+".family", + fci.allFonts[j].familyName); props.setProperty(styleKey+"."+j+".file", fci.allFonts[j].fontFile); } } try { /* This writes into a temp file then renames when done. * Since the rename is an atomic action within the same
*** 506,518 **** return; // bad file } fci[index].allFonts = new FontConfigFont[nfonts]; for (int f=0; f<nfonts; f++) { fci[index].allFonts[f] = new FontConfigFont(); ! String fkey = key+"."+f+".fullName"; ! String fullName = (String)props.get(fkey); ! fci[index].allFonts[f].fullName = fullName; fkey = key+"."+f+".file"; String file = (String)props.get(fkey); if (file == null) { return; // bad file } --- 501,513 ---- return; // bad file } fci[index].allFonts = new FontConfigFont[nfonts]; for (int f=0; f<nfonts; f++) { fci[index].allFonts[f] = new FontConfigFont(); ! String fkey = key+"."+f+".family"; ! String family = (String)props.get(fkey); ! fci[index].allFonts[f].familyName = family; fkey = key+"."+f+".file"; String file = (String)props.get(fkey); if (file == null) { return; // bad file }
< prev index next >