hammerspoon2-docs
    Preparing search index...

    Class HSFont

    This is a JavaScript object used to represent macOS fonts. It includes a variety of static methods that can instantiate the various font sizes commonly used with UI elements, and also includes static methods for instantiating the system font at various sizes/weights, or any custom font available on the system.

    Index

    Constructors

    Methods

    • Body text style

      Returns HSFont

      An HSFont object

    • Callout text style

      Returns HSFont

      An HSFont object

    • Caption text style

      Returns HSFont

      An HSFont object

    • Caption2 text style

      Returns HSFont

      An HSFont object

    • A font present on the system at a given size

      Parameters

      • name: string

        A string containing the name of the font to instantiate

      • size: number

        The font size in points

      Returns HSFont

      An HSFont object

    • Footnote text style

      Returns HSFont

      An HSFont object

    • Headline text style

      Returns HSFont

      An HSFont object

    • Large Title text style

      Returns HSFont

      An HSFont object

    • Sub-headline text style

      Returns HSFont

      An HSFont object

    • The system font in a custom size

      Parameters

      • size: number

        The font size in points

      Returns HSFont

      An HSFont object

    • The system font in a custom size with a choice of weights

      Parameters

      • size: number

        The font size in points

      • weight: string

        The font weight as a string (e.g. "ultralight", "thin", "light", "regular", "medium", "semibold", "bold", "heavy", "black")

      Returns HSFont

      An HSFont object

    • Title text style

      Returns HSFont

      An HSFont object

    • Title2 text style

      Returns HSFont

      An HSFont object

    • Title3 text style

      Returns HSFont

      An HSFont object