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

Print this page
rev 1379 : [mq]: fontmanager.patch


 618         int pos1 = bb.position();
 619         while (bb.get() != ')');
 620         int pos2 = bb.position();
 621         byte[] nameBytes = new byte[pos2-pos1-1];
 622         bb.position(pos1);
 623         bb.get(nameBytes);
 624         try {
 625             return new String(nameBytes, "US-ASCII");
 626         } catch (UnsupportedEncodingException e) {
 627             return new String(nameBytes);
 628         }
 629     }
 630 
 631 
 632     public String getPostscriptName() {
 633         return psName;
 634     }
 635 
 636     protected synchronized FontScaler getScaler() {
 637         if (scaler == null) {
 638             scaler = FontManager.getScaler(this, 0, false, fileSize);
 639         }
 640 
 641         return scaler;
 642     }
 643 
 644     CharToGlyphMapper getMapper() {
 645         if (mapper == null) {
 646             mapper = new Type1GlyphMapper(this);
 647         }
 648         return mapper;
 649     }
 650 
 651     public int getNumGlyphs() {
 652         try {
 653             return getScaler().getNumGlyphs();
 654         } catch (FontScalerException e) {
 655             scaler = FontManager.getNullScaler();
 656             return getNumGlyphs();
 657         }
 658     }
 659 
 660     public int getMissingGlyphCode() {
 661         try {
 662             return getScaler().getMissingGlyphCode();
 663         } catch (FontScalerException e) {
 664             scaler = FontManager.getNullScaler();
 665             return getMissingGlyphCode();
 666         }
 667     }
 668 
 669     public int getGlyphCode(char charCode) {
 670         try {
 671             return getScaler().getGlyphCode(charCode);
 672         } catch (FontScalerException e) {
 673             scaler = FontManager.getNullScaler();
 674             return getGlyphCode(charCode);
 675         }
 676     }
 677 
 678     public String toString() {
 679         return "** Type1 Font: Family="+familyName+ " Name="+fullName+
 680             " style="+style+" fileName="+platName;
 681     }
 682 
 683 }


 618         int pos1 = bb.position();
 619         while (bb.get() != ')');
 620         int pos2 = bb.position();
 621         byte[] nameBytes = new byte[pos2-pos1-1];
 622         bb.position(pos1);
 623         bb.get(nameBytes);
 624         try {
 625             return new String(nameBytes, "US-ASCII");
 626         } catch (UnsupportedEncodingException e) {
 627             return new String(nameBytes);
 628         }
 629     }
 630 
 631 
 632     public String getPostscriptName() {
 633         return psName;
 634     }
 635 
 636     protected synchronized FontScaler getScaler() {
 637         if (scaler == null) {
 638             scaler = FontScaler.getScaler(this, 0, false, fileSize);
 639         }
 640 
 641         return scaler;
 642     }
 643 
 644     CharToGlyphMapper getMapper() {
 645         if (mapper == null) {
 646             mapper = new Type1GlyphMapper(this);
 647         }
 648         return mapper;
 649     }
 650 
 651     public int getNumGlyphs() {
 652         try {
 653             return getScaler().getNumGlyphs();
 654         } catch (FontScalerException e) {
 655             scaler = FontScaler.getNullScaler();
 656             return getNumGlyphs();
 657         }
 658     }
 659 
 660     public int getMissingGlyphCode() {
 661         try {
 662             return getScaler().getMissingGlyphCode();
 663         } catch (FontScalerException e) {
 664             scaler = FontScaler.getNullScaler();
 665             return getMissingGlyphCode();
 666         }
 667     }
 668 
 669     public int getGlyphCode(char charCode) {
 670         try {
 671             return getScaler().getGlyphCode(charCode);
 672         } catch (FontScalerException e) {
 673             scaler = FontScaler.getNullScaler();
 674             return getGlyphCode(charCode);
 675         }
 676     }
 677 
 678     public String toString() {
 679         return "** Type1 Font: Family="+familyName+ " Name="+fullName+
 680             " style="+style+" fileName="+platName;
 681     }

 682 }