Class CSS2FontHelper

java.lang.Object
org.eclipse.e4.ui.css.core.css2.CSS2FontHelper

public class CSS2FontHelper extends Object
CSS2 Font Helper.
Version:
1.0.0
Author:
Angelo ZERR
  • Field Details

    • FONT_WEIGHT_NORMAL

      public static final int FONT_WEIGHT_NORMAL
      CSS font-weight of a regular face.
      See Also:
    • FONT_WEIGHT_BOLD

      public static final int FONT_WEIGHT_BOLD
      CSS font-weight of a bold face.
      See Also:
  • Constructor Details

    • CSS2FontHelper

      public CSS2FontHelper()
  • Method Details

    • getFontFamily

      public static String getFontFamily(String family)
      Return CSS2 font-family. Escape font family with " if need.
    • getFontSize

      public static String getFontSize(int size)
      Return CSS2 font-size of int size.
    • getFontStyle

      public static String getFontStyle(boolean isItalic)
      Return CSS2 font-style.
    • getFontWeight

      public static String getFontWeight(boolean isBold)
      Return CSS2 font-weight.
    • getFontWeight

      public static OptionalInt getFontWeight(CssValues.CssPrimitive value, int inheritedWeight)
      Numeric font-weight of value, empty if it is not a weight. Relative keywords are resolved against inheritedWeight.
    • getCSSFontPropertyName

      public static String getCSSFontPropertyName(CssValues.CssPrimitive value)
      Return the CSS Font Property name (font-style, font-weight, font-size, font-family) for the given value, null if the value belongs to none of them.