Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Font

[12:14] static extends: object

Wraps JavaFX Font, which specifies a text font by family, style, and size for use in text nodes and labeled controls. This static class provides methods to look up a font by name from the system font registry, or to load a custom font from a local file or a remote URL. All methods return a FxObj wrapping the underlying javafx.scene.text.Font instance.

Methods

  • get (string FontName, double FontSize)

    Gets a font with the provided font name and size.

    • @p FontName is a string with the local font to get.
    • @p FontSize is a double with the font size to use.
    • @r A FxObj object with the font resource.
  • load (string FileStr, double FontSize)

    Gets a font with the provided URL string and size.

    • @p FileStr is a string with the file name where to get the font.
    • @p FontSize is a double with the font size to use.
    • @r A FxObj object with the font resource.
  • loadUrl (string UrlStr, double FontSize)

    Gets a font with the provided URL string and size.

    • @p UrlStr is a string with the URL where to get the font.
    • @p FontSize is a double with the font size to use.
    • @r A FxObj object with the font resource.
  • getName (object FontObj)

    Returns the full font name (family plus style) for the given font.

    • @p FontObj is a FxObj wrapping a javafx.scene.text.Font.
    • @r A string with the font name.
  • getFamily (object FontObj)

    Returns the family name for the given font.

    • @p FontObj is a FxObj wrapping a javafx.scene.text.Font.
    • @r A string with the family name.
  • getStyle (object FontObj)

    Returns the style description (e.g. Regular, Bold, Italic) for the given font.

    • @p FontObj is a FxObj wrapping a javafx.scene.text.Font.
    • @r A string with the style description.
  • getSize (object FontObj)

    Returns the point size of the given font.

    • @p FontObj is a FxObj wrapping a javafx.scene.text.Font.
    • @r A double with the point size.
  • getDefault ()

    Returns the platform default font.

    • @r A FxObj wrapping the default javafx.scene.text.Font.
  • font (string Family, string Weight, string Posture, double FontSize)

    Gets a font by family name, weight, and posture at the given size.

    • @p Family is a string with the font family, for example "Arial".
    • @p Weight is a javafx.scene.text.FontWeight constant name, for example "NORMAL", "BOLD", or "LIGHT".
    • @p Posture is a javafx.scene.text.FontPosture constant name, either "REGULAR" or "ITALIC".
    • @p FontSize is a double with the font size to use.
    • @r A FxObj object with the font resource.
  • getFamilies ()

    Returns the list of font family names available on the system.

    • @r A list of strings with the family names.
  • getFontNames ()

    Returns the list of full font names available on the system.

    • @r A list of strings with the font names.
  • getFontNamesForFamily (string Family)

    Returns the list of full font names available for a given family.

    • @p Family is a string with the font family to list.
    • @r A list of strings with the font names in that family.
  • loadFonts (string FileStr, double FontSize)

    Loads every font contained in a local font file (for example a .ttc collection) at the given size.

    • @p FileStr is a string with the path to the font file.
    • @p FontSize is a double with the font size to use.
    • @r A list of FxObj objects, one per font loaded from the file.