Class FontFactory

java.lang.Object
org.lobobrowser.util.gui.FontFactory

public class FontFactory extends Object
Author:
J. H. S.
  • Method Details

    • getInstance

      public static final FontFactory 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 be Font.TRUETYPE_FONT.
      Throws:
      FontFormatException
      IOException
    • unregisterFont

      public void unregisterFont(String fontName)
      Unregisters a font previously registered with registerFont(String, int, java.io.InputStream).
      Parameters:
      fontName - The font name to be removed.
    • getFont

      public Font getFont(String fontFamily, String fontStyle, String fontVariant, String fontWeight, float fontSize, Set locales, Integer superscript)
    • getDefaultFontName

      public String getDefaultFontName()
    • setDefaultFontName

      public 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. 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

      public static Font superscriptFont(Font baseFont, Integer newSuperscript)