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

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


  97 
  98         if (defaultFont.canDisplay(c)) {
  99             return 1;
 100         }
 101         for (int i=0; i < getAllFonts().length; i++) {
 102             if (allFonts[i].canDisplay(c)) {
 103                 return i+2;
 104             }
 105         }
 106         return 1;
 107     }
 108 
 109     private Font [] getAllSCFonts() {
 110 
 111         if (supplementaryFonts == null) {
 112             ArrayList<Font> fonts = new ArrayList<Font>();
 113             ArrayList<Integer> indices = new ArrayList<Integer>();
 114 
 115             for (int i=0; i<getAllFonts().length; i++) {
 116                 Font font = allFonts[i];
 117                 Font2D font2D = FontManager.getFont2D(font);
 118                 if (font2D.hasSupplementaryChars()) {
 119                     fonts.add(font);
 120                     indices.add(Integer.valueOf(i));
 121                 }
 122             }
 123 
 124             int len = fonts.size();
 125             supplementaryIndices = new int[len];
 126             for (int i=0; i<len; i++) {
 127                 supplementaryIndices[i] = indices.get(i);
 128             }
 129             supplementaryFonts = fonts.toArray(new Font[len]);
 130         }
 131         return supplementaryFonts;
 132     }
 133 
 134     /* This method is called only for character codes >= 0x10000 - which
 135      * are assumed to be legal supplementary characters.
 136      * It looks first at the default font (to avoid calling getAllFonts if at
 137      * all possible) and if that doesn't map the code point, it scans




  97 
  98         if (defaultFont.canDisplay(c)) {
  99             return 1;
 100         }
 101         for (int i=0; i < getAllFonts().length; i++) {
 102             if (allFonts[i].canDisplay(c)) {
 103                 return i+2;
 104             }
 105         }
 106         return 1;
 107     }
 108 
 109     private Font [] getAllSCFonts() {
 110 
 111         if (supplementaryFonts == null) {
 112             ArrayList<Font> fonts = new ArrayList<Font>();
 113             ArrayList<Integer> indices = new ArrayList<Integer>();
 114 
 115             for (int i=0; i<getAllFonts().length; i++) {
 116                 Font font = allFonts[i];
 117                 Font2D font2D = FontUtilities.getFont2D(font);
 118                 if (font2D.hasSupplementaryChars()) {
 119                     fonts.add(font);
 120                     indices.add(Integer.valueOf(i));
 121                 }
 122             }
 123 
 124             int len = fonts.size();
 125             supplementaryIndices = new int[len];
 126             for (int i=0; i<len; i++) {
 127                 supplementaryIndices[i] = indices.get(i);
 128             }
 129             supplementaryFonts = fonts.toArray(new Font[len]);
 130         }
 131         return supplementaryFonts;
 132     }
 133 
 134     /* This method is called only for character codes >= 0x10000 - which
 135      * are assumed to be legal supplementary characters.
 136      * It looks first at the default font (to avoid calling getAllFonts if at
 137      * all possible) and if that doesn't map the code point, it scans