Package com.inet.html

Class InetHtmlFactory.DefaultFontFactory

java.lang.Object
com.inet.html.InetHtmlFactory.DefaultFontFactory
All Implemented Interfaces:
InetHtmlFontFactory
Enclosing class:
InetHtmlFactory

public static class InetHtmlFactory.DefaultFontFactory extends Object implements InetHtmlFontFactory
default implementation: use normal Font constructor
  • Constructor Details

    • DefaultFontFactory

      public DefaultFontFactory()
  • Method Details

    • getFont

      public Font getFont(String name, int style, int size, String text)
      Returns the font object for a requested font. Please note that the returned font may differ in type, size or style depending on the properties of the targeted render context.
      Specified by:
      getFont in interface InetHtmlFontFactory
      Parameters:
      name - The name / family of the requested font
      style - the style constant(s)
      size - the size in pixel
      text - the text part which should be displayed by the requested font, can be null!
      Returns:
      the best match for the requested font
    • getFont

      public Font getFont(String name, int style, float size, String text)
      Returns the font object for a requested font with a fractional size. Please note that the returned font may differ in type, size or style depending on the properties of the targeted render context.
      However, the method will prioritize font name over character availability, so if a font with said name is available it will be returned even if not all characters can be displayed. A fallback can and will only be used if not font with the name is available.
      Specified by:
      getFont in interface InetHtmlFontFactory
      Parameters:
      name - The name / family of the requested font
      style - the style constant(s)
      size - the size in pixel
      text - the text part which should be displayed by the requested font, can be null!
      Returns:
      the best match for the requested font
    • requiresText

      public boolean requiresText()
      This method indicates whether the font factory requires the text part which will be displayed by a certain font instance. An factory, which requires to adopt the font according to it's displayable characters should return true here. Please note returning true here has a negative performance impact.
      Specified by:
      requiresText in interface InetHtmlFontFactory
      Returns:
      true if the text should be set when getFont is called, false if not