6954424: Support OpenType/CFF fonts in JDK 7
authorprr
Thu, 27 May 2010 08:53:45 -0700
changeset 5578 c25ebb5bc2d6
parent 5505 e0e46c6054b3
child 5579 1a5e995a710b
6954424: Support OpenType/CFF fonts in JDK 7 Reviewed-by: bae, igor
jdk/src/share/classes/java/awt/Font.java
jdk/src/share/classes/sun/font/SunFontManager.java
--- a/jdk/src/share/classes/java/awt/Font.java	Thu May 20 16:00:25 2010 -0700
+++ b/jdk/src/share/classes/java/awt/Font.java	Thu May 27 08:53:45 2010 -0700
@@ -343,6 +343,10 @@
      * Identify a font resource of type TRUETYPE.
      * Used to specify a TrueType font resource to the
      * {@link #createFont} method.
+     * The TrueType format was extended to become the OpenType
+     * format, which adds support for fonts with Postscript outlines,
+     * this tag therefore references these fonts, as well as those
+     * with TrueType outlines.
      * @since 1.3
      */
 
--- a/jdk/src/share/classes/sun/font/SunFontManager.java	Thu May 20 16:00:25 2010 -0700
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java	Thu May 27 08:53:45 2010 -0700
@@ -73,7 +73,9 @@
                 return(name.startsWith(".ttf", offset) ||
                        name.startsWith(".TTF", offset) ||
                        name.startsWith(".ttc", offset) ||
-                       name.startsWith(".TTC", offset));
+                       name.startsWith(".TTC", offset) ||
+                       name.startsWith(".otf", offset) ||
+                       name.startsWith(".OTF", offset));
             }
         }
     }
@@ -108,7 +110,9 @@
                     name.startsWith(".ttf", offset) ||
                     name.startsWith(".TTF", offset) ||
                     name.startsWith(".ttc", offset) ||
-                    name.startsWith(".TTC", offset);
+                    name.startsWith(".TTC", offset) ||
+                    name.startsWith(".otf", offset) ||
+                    name.startsWith(".OTF", offset);
                 if (isTT) {
                     return true;
                 } else if (noType1Font) {