Font
Date: 2019-10-22

org.jmol.util

## Class Font

- java.lang.Object
- - org.jmol.util.Font

-     public final class Font
      extends java.lang.Object

  Provides font support using a byte fid (Font ID) as an index into font table.

  Supports standard font faces, font styles, and font sizes.

  Author:
    Miguel, miguel@jmol.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `ascent`
    `private int` | `descent`
    `byte` | `fid`
    `java.lang.Object` | `font`
    `private static int` | `FONT_ALLOCATION_UNIT`
    `static int` | `FONT_FACE_MONO`
    `static int` | `FONT_FACE_SANS`
    `static int` | `FONT_FACE_SERIF`
    `static int` | `FONT_STYLE_BOLD`
    `static int` | `FONT_STYLE_BOLDITALIC`
    `static int` | `FONT_STYLE_ITALIC`
    `static int` | `FONT_STYLE_PLAIN`
    `private static Font[]` | `font3ds`
    `java.lang.String` | `fontFace`
    `private static java.lang.String[]` | `fontFaces`
    `private static int` | `fontkeyCount`
    `private static int[]` | `fontkeys`
    `private java.lang.Object` | `fontMetrics`
    `float` | `fontSize`
    `float` | `fontSizeNominal`
    `java.lang.String` | `fontStyle`
    `private static java.lang.String[]` | `fontStyles`
    `int` | `idFontFace`
    `int` | `idFontStyle`
    `private boolean` | `isBold`
    `private boolean` | `isItalic`
    `private FontManager` | `manager`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `Font(FontManager manager, byte fid, int idFontFace, int idFontStyle, float fontSize, float fontSizeNominal, java.lang.Object graphics)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Font` | `createFont3D(int fontface, int fontstyle, float fontsize, float fontsizeNominal, FontManager manager, java.lang.Object graphicsForMetrics)`
    `int` | `getAscent()`
    `int` | `getDescent()`
    `static Font` | `getFont3D(byte fontID)`
    `static int` | `getFontFaceID(java.lang.String fontface)`
    `java.lang.Object` | `getFontMetrics()`
    `static int` | `getFontStyleID(java.lang.String fontstyle)`
    `int` | `getHeight()`
    `java.lang.String` | `getInfo()`
    `int` | `stringWidth(java.lang.String text)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### fid

          public final byte fid

    - #### fontFace

          public final java.lang.String fontFace

    - #### fontStyle

          public final java.lang.String fontStyle

    - #### fontSizeNominal

          public final float fontSizeNominal

    - #### idFontFace

          public final int idFontFace

    - #### idFontStyle

          public final int idFontStyle

    - #### fontSize

          public final float fontSize

    - #### font

          public final java.lang.Object font

    - #### fontMetrics

          private final java.lang.Object fontMetrics

    - #### manager

          private FontManager manager

    - #### ascent

          private int ascent

    - #### descent

          private int descent

    - #### isBold

          private boolean isBold

    - #### isItalic

          private boolean isItalic

    - #### FONT_ALLOCATION_UNIT

          private static final int FONT_ALLOCATION_UNIT

      See Also:
        Constant Field Values

    - #### fontkeyCount

          private static int fontkeyCount

    - #### fontkeys

          private static int[] fontkeys

    - #### font3ds

          private static Font[] font3ds

    - #### FONT_FACE_SANS

          public static final int FONT_FACE_SANS

      See Also:
        Constant Field Values

    - #### FONT_FACE_SERIF

          public static final int FONT_FACE_SERIF

      See Also:
        Constant Field Values

    - #### FONT_FACE_MONO

          public static final int FONT_FACE_MONO

      See Also:
        Constant Field Values

    - #### fontFaces

          private static final java.lang.String[] fontFaces

    - #### FONT_STYLE_PLAIN

          public static final int FONT_STYLE_PLAIN

      See Also:
        Constant Field Values

    - #### FONT_STYLE_BOLD

          public static final int FONT_STYLE_BOLD

      See Also:
        Constant Field Values

    - #### FONT_STYLE_ITALIC

          public static final int FONT_STYLE_ITALIC

      See Also:
        Constant Field Values

    - #### FONT_STYLE_BOLDITALIC

          public static final int FONT_STYLE_BOLDITALIC

      See Also:
        Constant Field Values

    - #### fontStyles

          private static final java.lang.String[] fontStyles

  - ### Constructor Detail

    - #### Font

          private Font(FontManager manager,
                       byte fid,
                       int idFontFace,
                       int idFontStyle,
                       float fontSize,
                       float fontSizeNominal,
                       java.lang.Object graphics)

  - ### Method Detail

    - #### getFont3D

          public static Font getFont3D(byte fontID)

    - #### createFont3D

          public static Font createFont3D(int fontface,
                                          int fontstyle,
                                          float fontsize,
                                          float fontsizeNominal,
                                          FontManager manager,
                                          java.lang.Object graphicsForMetrics)

    - #### getFontFaceID

          public static int getFontFaceID(java.lang.String fontface)

    - #### getFontStyleID

          public static int getFontStyleID(java.lang.String fontstyle)

    - #### getAscent

          public int getAscent()

    - #### getDescent

          public int getDescent()

    - #### getHeight

          public int getHeight()

    - #### getFontMetrics

          public java.lang.Object getFontMetrics()

    - #### stringWidth

          public int stringWidth(java.lang.String text)

    - #### getInfo

          public java.lang.String getInfo()