Package org.lobobrowser.util.gui
Class FontFactory
java.lang.Object
org.lobobrowser.util.gui.FontFactory
- Author:
- J. H. S.
-
Method Summary
Modifier and TypeMethodDescriptiongetFont
(String fontFamily, String fontStyle, String fontVariant, String fontWeight, float fontSize, Set locales, Integer superscript) static final FontFactory
void
registerFont
(String fontName, int fontFormat, InputStream fontStream) Registers a font family.void
setDefaultFontName
(String defaultFontName) Sets the default font name to be used when a name is unrecognized or when a font is determined not to be capable of diplaying characters from a given language.static Font
superscriptFont
(Font baseFont, Integer newSuperscript) void
unregisterFont
(String fontName) Unregisters a font previously registered withregisterFont(String, int, java.io.InputStream)
.
-
Method Details
-
getInstance
-
registerFont
public void registerFont(String fontName, int fontFormat, InputStream fontStream) throws FontFormatException, IOException Registers a font family. It does not close the stream provided. Fonts should be registered before the renderer has a chance to cache document font specifications.- Parameters:
fontName
- The name of a font as it would appear in a font-family specification.fontFormat
- Should beFont.TRUETYPE_FONT
.- Throws:
FontFormatException
IOException
-
unregisterFont
Unregisters a font previously registered withregisterFont(String, int, java.io.InputStream)
.- Parameters:
fontName
- The font name to be removed.
-
getFont
-
getDefaultFontName
-
setDefaultFontName
Sets the default font name to be used when a name is unrecognized or when a font is determined not to be capable of diplaying characters from a given language. This should be the name of a font that can display unicode text across all or most languages.- Parameters:
defaultFontName
- The name of a font.
-
superscriptFont
-