/** * Return a FontManager, either registered beforehand or a default implementation * * @param graphics the graphics context holding potentially a font manager * @return the font manager */ public DrawFontManager getFontManager(Graphics2D graphics) { DrawFontManager fontHandler = (DrawFontManager)graphics.getRenderingHint(Drawable.FONT_HANDLER); return (fontHandler != null) ? fontHandler : new DrawFontManagerDefault(); } }
@Override public FontInfo getMappedFont(Graphics2D graphics, FontInfo fontInfo) { return getFontWithFallback(graphics, Drawable.FONT_MAP, fontInfo); }
@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; }
/** * Return a FontManager, either registered beforehand or a default implementation * * @param graphics the graphics context holding potentially a font manager * @return the font manager */ public DrawFontManager getFontManager(Graphics2D graphics) { DrawFontManager fontHandler = (DrawFontManager)graphics.getRenderingHint(Drawable.FONT_HANDLER); return (fontHandler != null) ? fontHandler : new DrawFontManagerDefault(); } }
@Override public FontInfo getMappedFont(Graphics2D graphics, FontInfo fontInfo) { return getFontWithFallback(graphics, Drawable.FONT_MAP, fontInfo); }
@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; }