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

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


  90 
  91     /* Create a family for created fonts which aren't listed in the
  92      * main map.
  93      */
  94     FontFamily(String name) {
  95         logicalFont = false;
  96         familyName = name;
  97         familyRank = Font2D.DEFAULT_RANK;
  98     }
  99 
 100     public String getFamilyName() {
 101         return familyName;
 102     }
 103 
 104     public int getRank() {
 105         return familyRank;
 106     }
 107 
 108     public void setFont(Font2D font, int style) {
 109         if (font.getRank() > familyRank) {
 110             if (FontManager.logging) {
 111                 FontManager.logger.warning("Rejecting adding " + font +

 112                                            " of lower rank " + font.getRank() +
 113                                            " to family " + this +
 114                                            " of rank " + familyRank);
 115             }
 116             return;
 117         }
 118 
 119         switch (style) {
 120 
 121         case Font.PLAIN:
 122             plain = font;
 123             break;
 124 
 125         case Font.BOLD:
 126             bold = font;
 127             break;
 128 
 129         case Font.ITALIC:
 130             italic = font;
 131             break;




  90 
  91     /* Create a family for created fonts which aren't listed in the
  92      * main map.
  93      */
  94     FontFamily(String name) {
  95         logicalFont = false;
  96         familyName = name;
  97         familyRank = Font2D.DEFAULT_RANK;
  98     }
  99 
 100     public String getFamilyName() {
 101         return familyName;
 102     }
 103 
 104     public int getRank() {
 105         return familyRank;
 106     }
 107 
 108     public void setFont(Font2D font, int style) {
 109         if (font.getRank() > familyRank) {
 110             if (FontUtilities.isLogging()) {
 111                 FontUtilities.getLogger()
 112                                   .warning("Rejecting adding " + font +
 113                                            " of lower rank " + font.getRank() +
 114                                            " to family " + this +
 115                                            " of rank " + familyRank);
 116             }
 117             return;
 118         }
 119 
 120         switch (style) {
 121 
 122         case Font.PLAIN:
 123             plain = font;
 124             break;
 125 
 126         case Font.BOLD:
 127             bold = font;
 128             break;
 129 
 130         case Font.ITALIC:
 131             italic = font;
 132             break;