< prev index next >

modules/graphics/src/test/java/test/com/sun/javafx/pgstub/StubFontLoader.java

Print this page




 150                     && weight.ordinal() >= FontWeight.BOLD.ordinal()) {
 151                 name = name + " Bold";
 152             }
 153         } else if ("amble ltcn".equals(fam)) {
 154             if (weight.ordinal() <= FontWeight.NORMAL.ordinal()) {
 155                 name = name + " Light";
 156             } else if (weight != null
 157                     && weight.ordinal() >= FontWeight.BOLD.ordinal()) {
 158                 name = name + " Bold";
 159             }
 160             name = name + " Condensed";
 161         }
 162         if (posture == FontPosture.ITALIC) {
 163             name = name + " Italic";
 164         }
 165         String fn = "Amble" + name;
 166         return new Font(fn, size);
 167     }
 168 
 169     @Override
 170     public Font loadFont(InputStream in, double size) {
 171         return new Font("not implemented", size);


 172     }
 173 
 174     @Override
 175     public Font loadFont(String urlPath, double size) {
 176         return new Font("not implemented", size);


 177     }
 178 
 179     @Override
 180     public FontMetrics getFontMetrics(Font font) {
 181         float size = (float) font.getSize();
 182         return new FontMetrics(size, size, size, size/2, size/2, size/5, font);
 183     }
 184 
 185     @Override
 186     public float getCharWidth(char ch, Font f) {
 187         // Assume that the font glyph size == font point size, mono-spaced
 188         // TODO needs to make sense given getFontMetrics implementation
 189         return (float) (f.getSize());
 190     }
 191 
 192     @Override
 193     public float getSystemFontSize() {
 194         return 12;
 195     }
 196 




 150                     && weight.ordinal() >= FontWeight.BOLD.ordinal()) {
 151                 name = name + " Bold";
 152             }
 153         } else if ("amble ltcn".equals(fam)) {
 154             if (weight.ordinal() <= FontWeight.NORMAL.ordinal()) {
 155                 name = name + " Light";
 156             } else if (weight != null
 157                     && weight.ordinal() >= FontWeight.BOLD.ordinal()) {
 158                 name = name + " Bold";
 159             }
 160             name = name + " Condensed";
 161         }
 162         if (posture == FontPosture.ITALIC) {
 163             name = name + " Italic";
 164         }
 165         String fn = "Amble" + name;
 166         return new Font(fn, size);
 167     }
 168 
 169     @Override
 170     public Font[] loadFont(InputStream in, double size, boolean all) {
 171         Font[] fonts = new Font[1];
 172         fonts[0] = new Font("not implemented", size);
 173         return fonts;
 174     }
 175 
 176     @Override
 177     public Font[] loadFont(String urlPath, double size, boolean all) {
 178         Font[] fonts = new Font[1];
 179         fonts[0] = new Font("not implemented", size);
 180         return fonts;
 181     }
 182 
 183     @Override
 184     public FontMetrics getFontMetrics(Font font) {
 185         float size = (float) font.getSize();
 186         return new FontMetrics(size, size, size, size/2, size/2, size/5, font);
 187     }
 188 
 189     @Override
 190     public float getCharWidth(char ch, Font f) {
 191         // Assume that the font glyph size == font point size, mono-spaced
 192         // TODO needs to make sense given getFontMetrics implementation
 193         return (float) (f.getSize());
 194     }
 195 
 196     @Override
 197     public float getSystemFontSize() {
 198         return 12;
 199     }
 200 


< prev index next >