@Override public FontInfo getFallbackFont(Graphics2D graphics, FontInfo fontInfo) { FontInfo fi = getFontWithFallback(graphics, Drawable.FONT_FALLBACK, fontInfo); if (fi == null) { fi = new DrawFontInfo(Font.SANS_SERIF); } return fi; }
private FontInfo getFontWithFallback(Graphics2D graphics, DrawableHint hint, FontInfo fontInfo) { @SuppressWarnings("unchecked") Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(hint); if (fontMap == null) { return fontInfo; } String f = (fontInfo != null) ? fontInfo.getTypeface() : null; String mappedTypeface = null; if (fontMap.containsKey(f)) { mappedTypeface = fontMap.get(f); } else if (fontMap.containsKey("*")) { mappedTypeface = fontMap.get("*"); } return (mappedTypeface != null) ? new DrawFontInfo(mappedTypeface) : fontInfo; } }
assert(fiFallback != null); if (fiMapped == null) { fiMapped = dfm.getMappedFont(graphics, new DrawFontInfo(paragraph.getDefaultFontFamily()));
FontInfo buFont = new DrawFontInfo(buFontStr);
@Override public FontInfo getFallbackFont(Graphics2D graphics, FontInfo fontInfo) { FontInfo fi = getFontWithFallback(graphics, Drawable.FONT_FALLBACK, fontInfo); if (fi == null) { fi = new DrawFontInfo(Font.SANS_SERIF); } return fi; }
private FontInfo getFontWithFallback(Graphics2D graphics, DrawableHint hint, FontInfo fontInfo) { @SuppressWarnings("unchecked") Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(hint); if (fontMap == null) { return fontInfo; } String f = (fontInfo != null) ? fontInfo.getTypeface() : null; String mappedTypeface = null; if (fontMap.containsKey(f)) { mappedTypeface = fontMap.get(f); } else if (fontMap.containsKey("*")) { mappedTypeface = fontMap.get("*"); } return (mappedTypeface != null) ? new DrawFontInfo(mappedTypeface) : fontInfo; } }
assert(fiFallback != null); if (fiMapped == null) { fiMapped = dfm.getMappedFont(graphics, new DrawFontInfo(paragraph.getDefaultFontFamily()));
FontInfo buFont = new DrawFontInfo(buFontStr);