author | prr |
Fri, 25 May 2018 16:23:17 -0700 | |
changeset 50348 | 008f416a79cb |
parent 47216 | 71c04702a3d5 |
child 54871 | c2e4aef5edf2 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
31653
d88ff422c7fb
8080405: Exception in thread "AWT-EventQueue-1" java.security.AccessControlException
serb
parents:
29922
diff
changeset
|
2 |
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
12047 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package sun.font; |
|
27 |
||
28 |
import java.awt.*; |
|
29 |
import java.io.File; |
|
23900
fd98305f0d19
8031477: [macosx] Loading AWT native library fails
pchelko
parents:
22584
diff
changeset
|
30 |
import java.security.AccessController; |
fd98305f0d19
8031477: [macosx] Loading AWT native library fails
pchelko
parents:
22584
diff
changeset
|
31 |
import java.security.PrivilegedAction; |
12047 | 32 |
import java.util.ArrayList; |
33 |
import java.util.HashMap; |
|
34 |
import java.util.Hashtable; |
|
35 |
import java.util.Locale; |
|
36 |
import java.util.TreeMap; |
|
37 |
import java.util.Vector; |
|
38 |
||
39 |
import javax.swing.plaf.FontUIResource; |
|
40 |
||
41 |
import sun.awt.FontConfiguration; |
|
13767
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
42 |
import sun.awt.HeadlessToolkit; |
24520
e8afd90fcb69
8035169: Move ThreadGroupUtils from the sun.misc package
pchelko
parents:
23900
diff
changeset
|
43 |
import sun.awt.util.ThreadGroupUtils; |
12047 | 44 |
import sun.lwawt.macosx.*; |
45 |
||
26007
dba8f49653ce
8035165: Expose internal representation in sun.awt.X11
serb
parents:
24520
diff
changeset
|
46 |
public final class CFontManager extends SunFontManager { |
12047 | 47 |
private static Hashtable<String, Font2D> genericFonts = new Hashtable<String, Font2D>(); |
48 |
||
49 |
@Override |
|
50 |
protected FontConfiguration createFontConfiguration() { |
|
51 |
FontConfiguration fc = new CFontConfiguration(this); |
|
52 |
fc.init(); |
|
53 |
return fc; |
|
54 |
} |
|
55 |
||
56 |
@Override |
|
57 |
public FontConfiguration createFontConfiguration(boolean preferLocaleFonts, |
|
58 |
boolean preferPropFonts) |
|
59 |
{ |
|
60 |
return new CFontConfiguration(this, preferLocaleFonts, preferPropFonts); |
|
61 |
} |
|
62 |
||
63 |
/* |
|
64 |
* Returns an array of two strings. The first element is the |
|
65 |
* name of the font. The second element is the file name. |
|
66 |
*/ |
|
67 |
@Override |
|
26007
dba8f49653ce
8035165: Expose internal representation in sun.awt.X11
serb
parents:
24520
diff
changeset
|
68 |
protected String[] getDefaultPlatformFont() { |
dba8f49653ce
8035165: Expose internal representation in sun.awt.X11
serb
parents:
24520
diff
changeset
|
69 |
return new String[]{"Lucida Grande", |
dba8f49653ce
8035165: Expose internal representation in sun.awt.X11
serb
parents:
24520
diff
changeset
|
70 |
"/System/Library/Fonts/LucidaGrande.ttc"}; |
12047 | 71 |
} |
72 |
||
73 |
// This is a way to register any kind of Font2D, not just files and composites. |
|
74 |
public static Font2D[] getGenericFonts() { |
|
22584
eed64ee05369
8032733: Fix cast lint warnings in client libraries
darcy
parents:
21278
diff
changeset
|
75 |
return genericFonts.values().toArray(new Font2D[0]); |
12047 | 76 |
} |
77 |
||
78 |
public Font2D registerGenericFont(Font2D f) |
|
79 |
{ |
|
80 |
return registerGenericFont(f, false); |
|
81 |
} |
|
82 |
public Font2D registerGenericFont(Font2D f, boolean logicalFont) |
|
83 |
{ |
|
84 |
int rank = 4; |
|
85 |
||
86 |
String fontName = f.fullName; |
|
87 |
String familyName = f.familyName; |
|
88 |
||
89 |
if (fontName == null || "".equals(fontName)) { |
|
90 |
return null; |
|
91 |
} |
|
92 |
||
93 |
// logical fonts always need to be added to the family |
|
94 |
// plus they never need to be added to the generic font list |
|
95 |
// or the fullNameToFont table since they are covers for |
|
96 |
// already existing fonts in this list |
|
97 |
if (logicalFont || !genericFonts.containsKey(fontName)) { |
|
98 |
if (FontUtilities.debugFonts()) { |
|
99 |
FontUtilities.getLogger().info("Add to Family "+familyName + |
|
100 |
", Font " + fontName + " rank="+rank); |
|
101 |
} |
|
102 |
FontFamily family = FontFamily.getFamily(familyName); |
|
103 |
if (family == null) { |
|
104 |
family = new FontFamily(familyName, false, rank); |
|
105 |
family.setFont(f, f.style); |
|
106 |
} else if (family.getRank() >= rank) { |
|
107 |
family.setFont(f, f.style); |
|
108 |
} |
|
109 |
if (!logicalFont) |
|
110 |
{ |
|
111 |
genericFonts.put(fontName, f); |
|
112 |
fullNameToFont.put(fontName.toLowerCase(Locale.ENGLISH), f); |
|
113 |
} |
|
114 |
return f; |
|
115 |
} else { |
|
22584
eed64ee05369
8032733: Fix cast lint warnings in client libraries
darcy
parents:
21278
diff
changeset
|
116 |
return genericFonts.get(fontName); |
12047 | 117 |
} |
118 |
} |
|
119 |
||
120 |
@Override |
|
121 |
public Font2D[] getRegisteredFonts() { |
|
122 |
Font2D[] regFonts = super.getRegisteredFonts(); |
|
123 |
||
124 |
// Add in the Mac OS X native fonts |
|
125 |
Font2D[] genericFonts = getGenericFonts(); |
|
126 |
Font2D[] allFonts = new Font2D[regFonts.length+genericFonts.length]; |
|
127 |
System.arraycopy(regFonts, 0, allFonts, 0, regFonts.length); |
|
128 |
System.arraycopy(genericFonts, 0, allFonts, regFonts.length, genericFonts.length); |
|
129 |
||
130 |
return allFonts; |
|
131 |
} |
|
132 |
||
133 |
@Override |
|
134 |
protected void addNativeFontFamilyNames(TreeMap<String, String> familyNames, Locale requestedLocale) { |
|
135 |
Font2D[] genericfonts = getGenericFonts(); |
|
136 |
for (int i=0; i < genericfonts.length; i++) { |
|
137 |
if (!(genericfonts[i] instanceof NativeFont)) { |
|
138 |
String name = genericfonts[i].getFamilyName(requestedLocale); |
|
139 |
familyNames.put(name.toLowerCase(requestedLocale), name); |
|
140 |
} |
|
141 |
} |
|
142 |
} |
|
143 |
||
42726
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
144 |
protected void registerFontsInDir(final String dirName, boolean useJavaRasterizer, |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
145 |
int fontRank, boolean defer, boolean resolveSymLinks) { |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
146 |
|
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
147 |
String[] files = AccessController.doPrivileged((PrivilegedAction<String[]>) () -> { |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
148 |
return new File(dirName).list(getTrueTypeFilter()); |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
149 |
}); |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
150 |
|
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
151 |
if (files == null) { |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
152 |
return; |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
153 |
} else { |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
154 |
for (String f : files) { |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
155 |
loadNativeDirFonts(dirName+File.separator+f); |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
156 |
} |
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
157 |
} |
12047 | 158 |
super.registerFontsInDir(dirName, useJavaRasterizer, fontRank, defer, resolveSymLinks); |
159 |
} |
|
160 |
||
42726
ffe8f242155d
8167103: Intermittent font loading failure on macOS with JFXPanel application
prr
parents:
37550
diff
changeset
|
161 |
private native void loadNativeDirFonts(String fontPath); |
12047 | 162 |
private native void loadNativeFonts(); |
163 |
||
164 |
void registerFont(String fontName, String fontFamilyName) { |
|
165 |
final CFont font = new CFont(fontName, fontFamilyName); |
|
166 |
||
167 |
registerGenericFont(font); |
|
28996
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
168 |
} |
12047 | 169 |
|
28996
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
170 |
void registerItalicDerived() { |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
171 |
FontFamily[] famArr = FontFamily.getAllFontFamilies(); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
172 |
for (int i=0; i<famArr.length; i++) { |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
173 |
FontFamily family = famArr[i]; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
174 |
|
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
175 |
Font2D f2dPlain = family.getFont(Font.PLAIN); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
176 |
if (f2dPlain != null && !(f2dPlain instanceof CFont)) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
177 |
Font2D f2dBold = family.getFont(Font.BOLD); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
178 |
if (f2dBold != null && !(f2dBold instanceof CFont)) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
179 |
Font2D f2dItalic = family.getFont(Font.ITALIC); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
180 |
if (f2dItalic != null && !(f2dItalic instanceof CFont)) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
181 |
Font2D f2dBoldItalic = family.getFont(Font.BOLD|Font.ITALIC); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
182 |
if (f2dBoldItalic != null && !(f2dBoldItalic instanceof CFont)) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
183 |
|
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
184 |
CFont plain = (CFont)f2dPlain; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
185 |
CFont bold = (CFont)f2dBold; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
186 |
CFont italic = (CFont)f2dItalic; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
187 |
CFont boldItalic = (CFont)f2dBoldItalic; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
188 |
|
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
189 |
if (bold == null) bold = plain; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
190 |
if (plain == null && bold == null) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
191 |
if (italic != null && boldItalic != null) continue; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
192 |
if (plain != null && italic == null) { |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
193 |
registerGenericFont(plain.createItalicVariant(), true); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
194 |
} |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
195 |
if (bold != null && boldItalic == null) { |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
196 |
registerGenericFont(bold.createItalicVariant(), true); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
197 |
} |
12047 | 198 |
} |
199 |
} |
|
200 |
||
201 |
Object waitForFontsToBeLoaded = new Object(); |
|
28996
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
202 |
private boolean loadedAllFonts = false; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
203 |
|
12047 | 204 |
public void loadFonts() |
205 |
{ |
|
206 |
synchronized(waitForFontsToBeLoaded) |
|
207 |
{ |
|
208 |
super.loadFonts(); |
|
209 |
java.security.AccessController.doPrivileged( |
|
210 |
new java.security.PrivilegedAction<Object>() { |
|
211 |
public Object run() { |
|
28996
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
212 |
if (!loadedAllFonts) { |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
213 |
loadNativeFonts(); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
214 |
registerItalicDerived(); |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
215 |
loadedAllFonts = true; |
4d9228fac01a
8064833: [macosx] Native font lookup uses family+style, not full name/postscript name
prr
parents:
26037
diff
changeset
|
216 |
} |
12047 | 217 |
return null; |
218 |
} |
|
219 |
} |
|
220 |
); |
|
221 |
||
222 |
String defaultFont = "Lucida Grande"; |
|
50348
008f416a79cb
8191522: Remove Bigelow&Holmes Lucida fonts from JDK sources
prr
parents:
47216
diff
changeset
|
223 |
String defaultFallback = "Lucida Grande"; |
12047 | 224 |
|
225 |
setupLogicalFonts("Dialog", defaultFont, defaultFallback); |
|
50348
008f416a79cb
8191522: Remove Bigelow&Holmes Lucida fonts from JDK sources
prr
parents:
47216
diff
changeset
|
226 |
setupLogicalFonts("Serif", "Times", "Times"); |
12047 | 227 |
setupLogicalFonts("SansSerif", defaultFont, defaultFallback); |
50348
008f416a79cb
8191522: Remove Bigelow&Holmes Lucida fonts from JDK sources
prr
parents:
47216
diff
changeset
|
228 |
setupLogicalFonts("Monospaced", "Menlo", "Courier"); |
12047 | 229 |
setupLogicalFonts("DialogInput", defaultFont, defaultFallback); |
230 |
} |
|
231 |
} |
|
232 |
||
233 |
protected void setupLogicalFonts(String logicalName, String realName, String fallbackName) { |
|
234 |
FontFamily realFamily = getFontFamilyWithExtraTry(logicalName, realName, fallbackName); |
|
235 |
||
236 |
cloneStyledFont(realFamily, logicalName, Font.PLAIN); |
|
237 |
cloneStyledFont(realFamily, logicalName, Font.BOLD); |
|
238 |
cloneStyledFont(realFamily, logicalName, Font.ITALIC); |
|
239 |
cloneStyledFont(realFamily, logicalName, Font.BOLD | Font.ITALIC); |
|
240 |
} |
|
241 |
||
242 |
protected FontFamily getFontFamilyWithExtraTry(String logicalName, String realName, String fallbackName){ |
|
243 |
FontFamily family = getFontFamily(realName, fallbackName); |
|
244 |
if (family != null) return family; |
|
245 |
||
246 |
// at this point, we recognize that we probably needed a fallback font |
|
247 |
super.loadFonts(); |
|
248 |
||
249 |
family = getFontFamily(realName, fallbackName); |
|
250 |
if (family != null) return family; |
|
251 |
||
252 |
System.err.println("Warning: the fonts \"" + realName + "\" and \"" + fallbackName + "\" are not available for the Java logical font \"" + logicalName + "\", which may have unexpected appearance or behavior. Re-enable the \""+ realName +"\" font to remove this warning."); |
|
253 |
return null; |
|
254 |
} |
|
255 |
||
256 |
protected FontFamily getFontFamily(String realName, String fallbackName){ |
|
257 |
FontFamily family = FontFamily.getFamily(realName); |
|
258 |
if (family != null) return family; |
|
259 |
||
260 |
family = FontFamily.getFamily(fallbackName); |
|
261 |
if (family != null){ |
|
262 |
System.err.println("Warning: the font \"" + realName + "\" is not available, so \"" + fallbackName + "\" has been substituted, but may have unexpected appearance or behavor. Re-enable the \""+ realName +"\" font to remove this warning."); |
|
263 |
return family; |
|
264 |
} |
|
265 |
||
266 |
return null; |
|
267 |
} |
|
268 |
||
269 |
protected boolean cloneStyledFont(FontFamily realFamily, String logicalFamilyName, int style) { |
|
270 |
if (realFamily == null) return false; |
|
271 |
||
272 |
Font2D realFont = realFamily.getFontWithExactStyleMatch(style); |
|
273 |
if (realFont == null || !(realFont instanceof CFont)) return false; |
|
274 |
||
275 |
CFont newFont = new CFont((CFont)realFont, logicalFamilyName); |
|
276 |
registerGenericFont(newFont, true); |
|
277 |
||
278 |
return true; |
|
279 |
} |
|
280 |
||
281 |
@Override |
|
282 |
public String getFontPath(boolean noType1Fonts) { |
|
21278 | 283 |
// In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts |
13767
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
284 |
Toolkit tk = Toolkit.getDefaultToolkit(); |
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
285 |
if (tk instanceof HeadlessToolkit) { |
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
286 |
tk = ((HeadlessToolkit)tk).getUnderlyingToolkit(); |
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
287 |
} |
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
288 |
if (tk instanceof LWCToolkit) { |
12047 | 289 |
return ""; |
290 |
} |
|
13767
5ea857776c3f
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
bae
parents:
12047
diff
changeset
|
291 |
|
12047 | 292 |
// X11 case |
293 |
return "/Library/Fonts"; |
|
294 |
} |
|
295 |
||
296 |
@Override |
|
297 |
protected FontUIResource getFontConfigFUIR( |
|
298 |
String family, int style, int size) |
|
299 |
{ |
|
300 |
String mappedName = FontUtilities.mapFcName(family); |
|
301 |
if (mappedName == null) { |
|
302 |
mappedName = "sansserif"; |
|
303 |
} |
|
304 |
return new FontUIResource(mappedName, style, size); |
|
305 |
} |
|
306 |
||
307 |
// Only implemented on Windows |
|
308 |
@Override |
|
309 |
protected void populateFontFileNameMap(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, |
|
310 |
HashMap<String, ArrayList<String>> familyToFontListMap, Locale locale) {} |
|
311 |
} |