public GVTFontFamily loadFont(InputStream in, FontFace ff) throws Exception { Font font = Font.createFont(Font.TRUETYPE_FONT, in); return new AWTFontFamily(ff, font); }
/** {@inheritDoc} */ public GVTFontFamily getFamilyThatCanDisplay(char c) { for (int i = 0; i < awtFontFamilies.size(); i++) { AWTFontFamily fontFamily = (AWTFontFamily)awtFontFamilies.get(i); AWTGVTFont font = (AWTGVTFont)awtFonts.get(i); if (font.canDisplay(c) && fontFamily.getFamilyName().indexOf("Song") == -1) { // the awt font for "MS Song" doesn't display chinese glyphs correctly return fontFamily; } } return null; }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
public GVTFontFamily loadFont(InputStream in, FontFace ff) throws Exception { Font font = Font.createFont(Font.TRUETYPE_FONT, in); return new AWTFontFamily(ff, font); }
/** {@inheritDoc} */ public GVTFontFamily getFamilyThatCanDisplay(char c) { for (int i = 0; i < awtFontFamilies.size(); i++) { AWTFontFamily fontFamily = (AWTFontFamily)awtFontFamilies.get(i); AWTGVTFont font = (AWTGVTFont)awtFonts.get(i); if (font.canDisplay(c) && fontFamily.getFamilyName().indexOf("Song") == -1) { // the awt font for "MS Song" doesn't display chinese glyphs correctly return fontFamily; } } return null; }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
public GVTFontFamily loadFont(InputStream in, FontFace ff) throws Exception { Font font = Font.createFont(Font.TRUETYPE_FONT, in); return new AWTFontFamily(ff, font); }
/** {@inheritDoc} */ public GVTFontFamily getFamilyThatCanDisplay(char c) { for (int i = 0; i < awtFontFamilies.size(); i++) { AWTFontFamily fontFamily = (AWTFontFamily)awtFontFamilies.get(i); AWTGVTFont font = (AWTGVTFont)awtFonts.get(i); if (font.canDisplay(c) && fontFamily.getFamilyName().indexOf("Song") == -1) { // the awt font for "MS Song" doesn't display chinese glyphs correctly return fontFamily; } } return null; }
/** {@inheritDoc} */ public GVTFontFamily resolve(String familyName) { familyName = familyName.toLowerCase(); // first see if this font family has already been resolved GVTFontFamily resolvedFF = (GVTFontFamily)resolvedFontFamilies.get(familyName); if (resolvedFF == null) { // hasn't been resolved yet // try to find a matching family name in the list of // available fonts String awtFamilyName = (String)fonts.get(familyName); if (awtFamilyName != null) { resolvedFF = new AWTFontFamily(awtFamilyName); } resolvedFontFamilies.put(familyName, resolvedFF); } // if (resolvedFF != null) { // System.out.println("resolved " + fontFamily.getFamilyName() + // " to " + resolvedFF.getFamilyName()); // } else { // System.out.println("could not resolve " + // fontFamily.getFamilyName()); // } return resolvedFF; }
/** {@inheritDoc} */ public GVTFontFamily resolve(String familyName) { familyName = familyName.toLowerCase(); // first see if this font family has already been resolved GVTFontFamily resolvedFF = (GVTFontFamily)resolvedFontFamilies.get(familyName); if (resolvedFF == null) { // hasn't been resolved yet // try to find a matching family name in the list of // available fonts String awtFamilyName = (String)fonts.get(familyName); if (awtFamilyName != null) { resolvedFF = new AWTFontFamily(awtFamilyName); } resolvedFontFamilies.put(familyName, resolvedFF); } // if (resolvedFF != null) { // System.out.println("resolved " + fontFamily.getFamilyName() + // " to " + resolvedFF.getFamilyName()); // } else { // System.out.println("could not resolve " + // fontFamily.getFamilyName()); // } return resolvedFF; }
/** {@inheritDoc} */ public GVTFontFamily resolve(String familyName) { familyName = familyName.toLowerCase(); // first see if this font family has already been resolved GVTFontFamily resolvedFF = (GVTFontFamily)resolvedFontFamilies.get(familyName); if (resolvedFF == null) { // hasn't been resolved yet // try to find a matching family name in the list of // available fonts String awtFamilyName = (String)fonts.get(familyName); if (awtFamilyName != null) { resolvedFF = new AWTFontFamily(awtFamilyName); } resolvedFontFamilies.put(familyName, resolvedFF); } // if (resolvedFF != null) { // System.out.println("resolved " + fontFamily.getFamilyName() + // " to " + resolvedFF.getFamilyName()); // } else { // System.out.println("could not resolve " + // fontFamily.getFamilyName()); // } return resolvedFF; }
public AWTFontFamily resolve(String familyName, FontFace fontFace) { String fontName = (String)fonts.get(fontFace.getFamilyName().toLowerCase()); if (fontName == null) { return null; } else { GVTFontFace face = FontFace.createFontFace(fontName, fontFace); return new AWTFontFamily(fontFace); } }
public AWTFontFamily resolve(String familyName, FontFace fontFace) { String fontName = (String)fonts.get(fontFace.getFamilyName().toLowerCase()); if (fontName == null) { return null; } else { GVTFontFace face = FontFace.createFontFace(fontName, fontFace); return new AWTFontFamily(fontFace); } }
public AWTFontFamily resolve(String familyName, FontFace fontFace) { String fontName = (String)fonts.get(fontFace.getFamilyName().toLowerCase()); if (fontName == null) { return null; } else { GVTFontFace face = FontFace.createFontFace(fontName, fontFace); return new AWTFontFamily(fontFace); } }