2525 */
2626public class OpenTypeFont extends TrueTypeFont
2727{
28- private boolean isPostScript ;
28+ // indicates whether the version info identifies this font as PostScriptFont
29+ private boolean hasPostScriptTag ;
2930
3031 /**
3132 * Constructor. Clients should use the OTFParser to create a new OpenTypeFont object.
@@ -40,7 +41,7 @@ public class OpenTypeFont extends TrueTypeFont
4041 @ Override
4142 void setVersion (float versionValue )
4243 {
43- isPostScript = Float .floatToIntBits (versionValue ) == 0x469EA8A9 ; // OTTO
44+ hasPostScriptTag = Float .floatToIntBits (versionValue ) == 0x469EA8A9 ; // OTTO
4445 super .setVersion (versionValue );
4546 }
4647
@@ -54,7 +55,7 @@ void setVersion(float versionValue)
5455 */
5556 public CFFTable getCFF () throws IOException
5657 {
57- if (!isPostScript )
58+ if (!hasPostScriptTag )
5859 {
5960 throw new UnsupportedOperationException ("TTF fonts do not have a CFF table" );
6061 }
@@ -64,7 +65,7 @@ public CFFTable getCFF() throws IOException
6465 @ Override
6566 public GlyphTable getGlyph () throws IOException
6667 {
67- if (isPostScript )
68+ if (hasPostScriptTag )
6869 {
6970 throw new UnsupportedOperationException ("OTF fonts do not have a glyf table" );
7071 }
@@ -74,7 +75,7 @@ public GlyphTable getGlyph() throws IOException
7475 @ Override
7576 public GeneralPath getPath (String name ) throws IOException
7677 {
77- if (isPostScript && isSupportedOTF ())
78+ if (hasPostScriptTag && isSupportedOTF ())
7879 {
7980 int gid = nameToGID (name );
8081 return getCFF ().getFont ().getType2CharString (gid ).getPath ();
@@ -92,7 +93,7 @@ public GeneralPath getPath(String name) throws IOException
9293 */
9394 public boolean isPostScript ()
9495 {
95- return isPostScript || tables .containsKey (CFFTable .TAG ) || tables .containsKey ("CFF2" );
96+ return hasPostScriptTag || tables .containsKey (CFFTable .TAG ) || tables .containsKey ("CFF2" );
9697 }
9798
9899 /**
@@ -107,7 +108,7 @@ public boolean isPostScript()
107108 public boolean isSupportedOTF ()
108109 {
109110 // OTF using CFF2 based outlines aren't yet supported
110- return !(isPostScript //
111+ return !(hasPostScriptTag //
111112 && !tables .containsKey (CFFTable .TAG ) //
112113 && tables .containsKey ("CFF2" ) //
113114 );
0 commit comments