Enum Class FontStretch

java.lang.Object
java.lang.Enum<FontStretch>
com.oorian.css.FontStretch
All Implemented Interfaces:
Serializable, Comparable<FontStretch>, Constable

public enum FontStretch extends Enum<FontStretch>
CSS font-stretch property values for font width selection.

The font-stretch property selects a normal, condensed, or expanded face from a font family. Values range from ultra-condensed (50%) to ultra-expanded (200%) of normal width.

Width Scale:

  • ultra-condensed: 50% of normal width
  • extra-condensed: 62.5% of normal width
  • condensed: 75% of normal width
  • semi-condensed: 87.5% of normal width
  • normal: 100% width (default)
  • semi-expanded: 112.5% of normal width
  • expanded: 125% of normal width
  • extra-expanded: 150% of normal width
  • ultra-expanded: 200% of normal width

Usage:


 element.setFontStretch(FontStretch.CONDENSED);
 element.setFontStretch(FontStretch.EXPANDED);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • ULTRA_CONDENSED

      public static final FontStretch ULTRA_CONDENSED
      Narrowest width (50% of normal).
    • EXTRA_CONDENSED

      public static final FontStretch EXTRA_CONDENSED
      Very narrow width (62.5% of normal).
    • CONDENSED

      public static final FontStretch CONDENSED
      Narrow width (75% of normal).
    • SEMI_CONDENSED

      public static final FontStretch SEMI_CONDENSED
      Slightly narrow width (87.5% of normal).
    • NORMAL

      public static final FontStretch NORMAL
      Standard width (100%, default).
    • SEMI_EXPANDED

      public static final FontStretch SEMI_EXPANDED
      Slightly wide (112.5% of normal).
    • EXPANDED

      public static final FontStretch EXPANDED
      Wide width (125% of normal).
    • EXTRA_EXPANDED

      public static final FontStretch EXTRA_EXPANDED
      Very wide (150% of normal).
    • ULTRA_EXPANDED

      public static final FontStretch ULTRA_EXPANDED
      Widest width (200% of normal).
    • INITIAL

      public static final FontStretch INITIAL
      Sets to default value.
    • INHERIT

      public static final FontStretch INHERIT
      Inherits from parent element.
  • Method Details

    • values

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

      public static FontStretch valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the CSS value string.
      Returns:
      the CSS value
    • toString

      public String toString()
      Returns the CSS value string.
      Overrides:
      toString in class Enum<FontStretch>
      Returns:
      the CSS value