Class StrictFontLoader


  • public class StrictFontLoader
    extends 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 Detail

      • StrictFontLoader

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

      • getFont

        public Font getFont​(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 Font getFont​(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.