Enum LengthUnit

java.lang.Object
java.lang.Enum<LengthUnit>
com.scroogexhtml.css.LengthUnit
All Implemented Interfaces:
Serializable, Comparable<LengthUnit>

public enum LengthUnit extends Enum<LengthUnit>
This enum defines available font size units.

see: EM, PX, PT, CM, IN… see: ... see: ... see: ...

  • Enum Constant Details

    • POINT

      public static final LengthUnit POINT
      Absolute unit 'point'.

      This unit should be considered obsolete. See EM, PX, PT, CM, IN… However, RTF specifies font sizes in (half-)points.

    • EM

      public static final LengthUnit EM
      Relative unit "em".
    • PX

      public static final LengthUnit PX
      Absolute unit 'pixel'.

      "The magic unit of CSS, the px, is often a good unit to use, especially if the style requires alignment of text to images" But for font sizes it is even better to use em. (...)" EM, PX, PT, CM, IN…

    • VW

      public static final LengthUnit VW
      Relative unit 'vw'.
    • PERCENT

      public static final LengthUnit PERCENT
      Relative unit 'percent'. Represents a percentage value, typically used to define sizes relative to another element or context.
  • Method Details

    • values

      public static LengthUnit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LengthUnit valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCssUnit

      public String getCssUnit()