Class GenericFontIcon

    • Constructor Detail

      • GenericFontIcon

        public GenericFontIcon​(String fontFamily,
                               int codepoint)
        Creates a new instance of GenericFontIcon with given font family and codepoint.
        Parameters:
        fontFamily - Name of the type face that is used to display icons
        codepoint - Numerical code point in the font
    • Method Detail

      • getFontFamily

        public String getFontFamily()
        Description copied from interface: FontIcon
        Returns the name (font family) of the font from which this icon comes. The name is used to apply the correct font where the icon is used.
        Specified by:
        getFontFamily in interface FontIcon
        Returns:
      • getMIMEType

        public String getMIMEType()
        Description copied from interface: Resource
        Gets the MIME type of the resource.
        Specified by:
        getMIMEType in interface Resource
        Returns:
        the MIME type of the resource.
      • getCodepoint

        public int getCodepoint()
        Description copied from interface: FontIcon
        Returns the unicode codepoint (character location) for this icon within the font given in FontIcon.getFontFamily().

        For example, 0x0021 would in a regular font be the codepoint for the exclamation-point character.
        When constructing icon fonts, it might be a good idea to use the codepoints in the "Private use area", from 0xE000 0xF8FF.

        Specified by:
        getCodepoint in interface FontIcon
        Returns:
      • getHtml

        public String getHtml()
        Description copied from interface: FontIcon
        Returns HTML that can be used to display the icon in places where HTML can be used, such as a Label with ContentMode.HTML.
        Specified by:
        getHtml in interface FontIcon
        Returns:
        HTML needed to display icon
      • getHtml

        public static String getHtml​(String fontFamily,
                                     int codePoint)
        Utility method for generating HTML that displays an icon from specific fontFamiliy with a given codePoint in the font.
        Parameters:
        fontFamily - Name of the font family
        codePoint - Icon's character code point in the font
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object