Class StrictFontLoader


  • public class StrictFontLoader
    extends java.lang.Object
    Returns the font which matches exactly the font parameters.

    A font matches if:

    • its descriptor starts with the requested family,
    • its height is the same as the height resolved using the requested size,
    • its style is the same as the requested style.
    • Constructor Summary

      Constructors 
      Constructor Description
      StrictFontLoader()
      Creates a strict font loader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ej.microui.display.Font getFont​(java.lang.String family, int size)
      Gets the MicroUI font matching the given parameters and with the plain style.
      ej.microui.display.Font getFont​(java.lang.String family, int size, int style)
      Gets the MicroUI font matching the given parameters.
      protected int getFontHeight​(int size)
      Gets the expected font height in pixels for the given size.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StrictFontLoader

        public StrictFontLoader()
        Creates a strict font loader.
    • Method Detail

      • getFont

        public ej.microui.display.Font getFont​(java.lang.String family,
                                               int size,
                                               int style)
        Gets the MicroUI font matching the given parameters.
        Parameters:
        family - the font family.
        size - the font size.
        style - the font style.
        Returns:
        the font matching the given parameters.
      • getFont

        public ej.microui.display.Font getFont​(java.lang.String family,
                                               int size)
        Gets the MicroUI font matching the given parameters and with the plain style.
        Parameters:
        family - the font family.
        size - the font size.
        Returns:
        the font matching the given parameters.
      • getFontHeight

        protected int getFontHeight​(int size)
        Gets the expected font height in pixels for the given size.

        This method may be overridden in order to interpret the size parameter in an other way.

        Parameters:
        size - the font size.
        Returns:
        the font height.