Enum Class FontFamily

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

public enum FontFamily extends Enum<FontFamily>
CSS font-family property values for common web-safe fonts.

The FontFamily enum provides pre-defined values for commonly used web-safe fonts and generic font families. These fonts are widely available across operating systems and browsers.

Font Categories:

  • Sans-serif: ARIAL, HELVETICA, VERDANA, TAHOMA
  • Serif: TIMES_NEW_ROMAN, GEORGIA, PALATINO
  • Monospace: COURIER_NEW, LUCIDA_CONSOLE, MONACO
  • Generic: SERIF, SANS_SERIF, MONOSPACE, CURSIVE, FANTASY

Usage:


 element.setFontFamily(FontFamily.ARIAL);
 element.setFontFamily(FontFamily.SANS_SERIF);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • INHERIT

      public static final FontFamily INHERIT
      Inherits from parent element.
    • INITIAL

      public static final FontFamily INITIAL
      Sets to default value.
    • NONE

      public static final FontFamily NONE
      No font family specified.
    • ARIAL

      public static final FontFamily ARIAL
      Arial - widely available sans-serif font.
    • ARIAL_BLACK

      public static final FontFamily ARIAL_BLACK
      Arial Black - bold display sans-serif font.
    • CHARCOAL

      public static final FontFamily CHARCOAL
      Charcoal - Mac system sans-serif font.
    • COMIC_SANS_MS

      public static final FontFamily COMIC_SANS_MS
      Comic Sans MS - casual handwriting-style font.
    • COURIER

      public static final FontFamily COURIER
      Courier - classic monospace typewriter font.
    • COURIER_NEW

      public static final FontFamily COURIER_NEW
      Courier New - refined monospace font.
    • GEORGIA

      public static final FontFamily GEORGIA
      Georgia - elegant serif font designed for screens.
    • IMPACT

      public static final FontFamily IMPACT
      Impact - bold condensed display font.
    • LUCIDA_CONSOLE

      public static final FontFamily LUCIDA_CONSOLE
      Lucida Console - monospace font for code.
    • LUCIDA_GRANDE

      public static final FontFamily LUCIDA_GRANDE
      Lucida Grande - Mac system font.
    • LUCIDA_SANS_UNICODE

      public static final FontFamily LUCIDA_SANS_UNICODE
      Lucida Sans Unicode - humanist sans-serif font.
    • MONACO

      public static final FontFamily MONACO
      Monaco - Mac monospace font.
    • BOOK_ANTIQUA

      public static final FontFamily BOOK_ANTIQUA
      Book Antiqua - classic oldstyle serif font.
    • PALATINO

      public static final FontFamily PALATINO
      Palatino - elegant oldstyle serif font.
    • TAHOMA

      public static final FontFamily TAHOMA
      Tahoma - compact sans-serif font.
    • GENEVA

      public static final FontFamily GENEVA
      Geneva - Mac sans-serif font.
    • TIMES_NEW_ROMAN

      public static final FontFamily TIMES_NEW_ROMAN
      Times New Roman - classic serif font for body text.
    • TREBUCHET_MS

      public static final FontFamily TREBUCHET_MS
      Trebuchet MS - humanist sans-serif web font.
    • HELVETICA

      public static final FontFamily HELVETICA
      Helvetica - popular sans-serif font.
    • VERDANA

      public static final FontFamily VERDANA
      Verdana - highly readable sans-serif screen font.
    • SYMBOL

      public static final FontFamily SYMBOL
      Symbol - special characters and symbols font.
    • MS_SANS_SERIF

      public static final FontFamily MS_SANS_SERIF
      MS Sans Serif - Windows system sans-serif font.
    • MS_SERIF

      public static final FontFamily MS_SERIF
      MS Serif - Windows system serif font.
    • NEW_YORK

      public static final FontFamily NEW_YORK
      New York - Mac serif font.
    • CURSIVE

      public static final FontFamily CURSIVE
      Generic cursive/script font family.
    • FANTASY

      public static final FontFamily FANTASY
      Generic decorative/fantasy font family.
    • MONOSPACE

      public static final FontFamily MONOSPACE
      Generic monospace font family.
    • SANS_SERIF

      public static final FontFamily SANS_SERIF
      Generic sans-serif font family.
    • SERIF

      public static final FontFamily SERIF
      Generic serif font family.
  • Method Details

    • values

      public static FontFamily[] 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 FontFamily 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<FontFamily>
      Returns:
      the CSS value