< prev index next >

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

Print this page
rev 59106 : imported patch client


 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             }
 185         }
 186     }
 187 
 188     private synchronized ByteBuffer getBuffer() throws FontFormatException {
 189         MappedByteBuffer mapBuf = (MappedByteBuffer)bufferRef.get();
 190         if (mapBuf == null) {
 191           //System.out.println("open T1 " + platName);




 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         try {
 172             verify();
 173         } catch (Throwable t) {
 174             if (createdCopy) {
 175                 T1DisposerRecord ref = new T1DisposerRecord(platname);
 176                 Disposer.addObjectRecord(bufferRef, ref);
 177                 bufferRef = null;
 178             }
 179             if (t instanceof FontFormatException) {
 180                 throw (FontFormatException)t;
 181             } else {
 182                 throw new FontFormatException("Unexpected runtime exception.");
 183             }
 184         }
 185     }
 186 
 187     private synchronized ByteBuffer getBuffer() throws FontFormatException {
 188         MappedByteBuffer mapBuf = (MappedByteBuffer)bufferRef.get();
 189         if (mapBuf == null) {
 190           //System.out.println("open T1 " + platName);


< prev index next >