diff --git a/jdk/src/share/classes/sun/font/TrueTypeFont.java b/jdk/src/share/classes/sun/font/TrueTypeFont.java index 7a87e81a0e2..01893d655dd 100644 --- a/jdk/src/share/classes/sun/font/TrueTypeFont.java +++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java @@ -160,6 +160,13 @@ public class TrueTypeFont extends FileFont { private boolean supportsJA; private boolean supportsCJK; + /* These are for faster access to the name of the font as + * typically exposed via API to applications. + */ + private Locale nameLocale; + private String localeFamilyName; + private String localeFullName; + /** * - does basic verification of the file * - reads the header table for this font (within a collection) @@ -1092,6 +1099,10 @@ public class TrueTypeFont extends FileFont { * greater than 32767, so read and store those as ints */ int stringPtr = sbuffer.get() & 0xffff; + + nameLocale = sun.awt.SunToolkit.getStartupLocale(); + short nameLocaleID = FontManager.getLCIDFromLocale(nameLocale); + for (int i=0; i