Class FontFiles

    • Field Detail

      • UNDEFINED

        public static final java.lang.String UNDEFINED
        The undefined font family string.
        See Also:
        Constant Field Values
      • LOCAL

        public static final java.lang.String LOCAL
        The local name of the font, comma separated list.
        See Also:
        Constant Field Values
      • ADDITIONAL

        public static final java.lang.String ADDITIONAL
        Additional styles, e.g. font-variant, font-feature-settings.
        See Also:
        Constant Field Values
      • FONT_FACE_CSS

        public static final java.lang.String FONT_FACE_CSS
        Definition: @font-face CSS, i.e. the original imported font face declaration.
        See Also:
        Constant Field Values
      • STYLES

        public static final java.lang.String[] STYLES
        Possible values for font-style. Defines how the font should be styled. Default value is "normal".
      • WEIGHTS

        public static final java.lang.String[] WEIGHTS
        Possible values for font-weight. Defines the boldness of the font. Default value is "400" (normal).
      • WEIGHTS_DESCR

        public static final java.lang.String[] WEIGHTS_DESCR
        Possible values for font-weight with description, e.g. "100 - thin (hairline)".
      • WEIGHT_DEFAULT

        public static final int WEIGHT_DEFAULT
        Default (normal) WEIGHT index.
        See Also:
        Constant Field Values
      • STANDARD_FONTS

        public static final java.lang.String[] STANDARD_FONTS
        The list of standard fonts that are installed in the system by default.
    • Constructor Detail

      • FontFiles

        public FontFiles()
        Constructor.
      • FontFiles

        public FontFiles​(Atom atom)
        Constructor with name.
        Parameters:
        atom - The atom name.
    • Method Detail

      • isStandardFontFamily

        public static boolean isStandardFontFamily​(java.lang.String fontFamily)
        Verifies of the font name is a standard font.
        Parameters:
        fontFamily - The font family name.
        Returns:
        true if standard, false otherwise.
      • isPropPrivateAtCreation

        protected boolean isPropPrivateAtCreation()
        The font files container is private and not transported to the client.
        Overrides:
        isPropPrivateAtCreation in class GProp<GProp<?>[]>
        Returns:
        true if the property should be set to private at creation, false for default.
      • usesPropIndex

        public boolean usesPropIndex()
        Font files container uses property index because it's priority based.
        Specified by:
        usesPropIndex in interface IPropCnr
        Overrides:
        usesPropIndex in class PropCnr
        Returns:
        true if index is used, false for non-index based container.
      • getFontFiles

        public FontFile[] getFontFiles()
        Gets the font files.
      • getFontFile

        public FontFile getFontFile​(EnvProps env)
        Returns the font file that is used for the client session in question.
        Parameters:
        env - The environment for the client.
        Returns:
        The font file to use, or null if not found.
      • getFontFile

        public FontFile getFontFile​(BrowserFontFormat browserFontFormat)
        Returns the font file that is used for the client session in question.
        Parameters:
        browserFontFormat - The browser font format instance.
        Returns:
        The font file to use, or null if not found.
      • getCacheOperation

        public int getCacheOperation()
        Gets the cache value.
        Returns:
        The cache value: 0=no cache, 1=on-first-use (default), 2=preload.
      • isCachedOnClient

        public boolean isCachedOnClient()
        Returns if the resource (font, image, etc) is to be cached on the client side or not.
        Specified by:
        isCachedOnClient in interface IClientCacheResource
        Returns:
        true to cache font (default), or false for client session use only.
      • isCachePreloaded

        public boolean isCachePreloaded()
        Returns if the resource (font, image, etc) is to be cached on the client side when the application starts or not.
        Specified by:
        isCachePreloaded in interface IClientCacheResource
      • getFontFamily

        public java.lang.String getFontFamily()
        Gets the font family name to use.
      • getFontIdentification

        public java.lang.String getFontIdentification()
        Gets the font identification much like the "Font Variation Description" (FVD).
        Returns:
        The font identification in form of "font-family:font-style[index]:font-weight[index]" (where "font-*[index]" is the index value).
      • getLocalNames

        public java.lang.String getLocalNames()
        Gets the local name(s) specified.
        Returns:
        A potentially comma separated string with names, null for none.
      • getFontFaceBaseDeclaration

        public java.lang.String getFontFaceBaseDeclaration()
        Gets the font-face base declaration without the 'src' and 'font-family' definitions. These declarations are font-family, font-stretch, font-style, font-weight and unicode-range plus the additional styles.
        Returns:
        String formatted as e.g. "font-style: normal; font-weight: normal;", defaults to empty string meaning "font-style: normal; font-weight: normal; font-stretch: normal; unicode-range: U+0-10FFFF;".
      • getFontStyle

        public java.lang.String getFontStyle()
        Gets the font-style.
        Returns:
        The font-style declaration.
      • getFontStyleIndex

        public int getFontStyleIndex()
        Gets the font-style index value.
        Returns:
        The font-style declaration index value.
      • getFontWeight

        public java.lang.String getFontWeight()
        Gets the font-weight.
        Returns:
        The font-weight declaration.
      • getDescriptiveFontWeight

        public java.lang.String getDescriptiveFontWeight()
        Gets the descriptive font-weight as e.g. "100 - thin (hairline)".
        Returns:
        The descriptive font-weight declaration.
      • getFontWeightIndex

        public int getFontWeightIndex()
        Gets the font-weight index value.
        Returns:
        The font-weight declaration index value.