< prev index next >

src/java.desktop/share/classes/sun/font/Type1Font.java

Print this page




 144             styleNameTokes.add(styleTokens[i]);
 145         }
 146         }
 147 
 148 
 149     /**
 150      * Constructs a Type1 Font.
 151      * @param platname - Platform identifier of the font. Typically file name.
 152      * @param nativeNames - Native names - typically XLFDs on Unix.
 153      */
 154     public Type1Font(String platname, Object nativeNames)
 155         throws FontFormatException {
 156 
 157         this(platname, nativeNames, false);
 158     }
 159 
 160     /**
 161      * - does basic verification of the file
 162      * - reads the names (full, family).
 163      * - determines the style of the font.
 164      * @throws FontFormatException - if the font can't be opened
 165      * or fails verification,  or there's no usable cmap
 166      */
 167     public Type1Font(String platname, Object nativeNames, boolean createdCopy)
 168         throws FontFormatException {
 169         super(platname, nativeNames);
 170         fontRank = Font2D.TYPE1_RANK;
 171         checkedNatives = true;
 172         try {
 173             verify();
 174         } catch (Throwable t) {
 175             if (createdCopy) {
 176                 T1DisposerRecord ref = new T1DisposerRecord(platname);
 177                 Disposer.addObjectRecord(bufferRef, ref);
 178                 bufferRef = null;
 179             }
 180             if (t instanceof FontFormatException) {
 181                 throw (FontFormatException)t;
 182             } else {
 183                 throw new FontFormatException("Unexpected runtime exception.");
 184             }




 144             styleNameTokes.add(styleTokens[i]);
 145         }
 146         }
 147 
 148 
 149     /**
 150      * Constructs a Type1 Font.
 151      * @param platname - Platform identifier of the font. Typically file name.
 152      * @param nativeNames - Native names - typically XLFDs on Unix.
 153      */
 154     public Type1Font(String platname, Object nativeNames)
 155         throws FontFormatException {
 156 
 157         this(platname, nativeNames, false);
 158     }
 159 
 160     /**
 161      * - does basic verification of the file
 162      * - reads the names (full, family).
 163      * - determines the style of the font.
 164      * @throws FontFormatException if the font can't be opened
 165      * or fails verification,  or there's no usable cmap
 166      */
 167     public Type1Font(String platname, Object nativeNames, boolean createdCopy)
 168         throws FontFormatException {
 169         super(platname, nativeNames);
 170         fontRank = Font2D.TYPE1_RANK;
 171         checkedNatives = true;
 172         try {
 173             verify();
 174         } catch (Throwable t) {
 175             if (createdCopy) {
 176                 T1DisposerRecord ref = new T1DisposerRecord(platname);
 177                 Disposer.addObjectRecord(bufferRef, ref);
 178                 bufferRef = null;
 179             }
 180             if (t instanceof FontFormatException) {
 181                 throw (FontFormatException)t;
 182             } else {
 183                 throw new FontFormatException("Unexpected runtime exception.");
 184             }


< prev index next >