API Docs

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.

Properties

This type has no properties.

Methods

staticHSFont.body() -> HSFont

Body text style
HSFont.body() -> HSFont
HSFont
An HSFont object

staticHSFont.callout() -> HSFont

Callout text style
HSFont.callout() -> HSFont
HSFont
An HSFont object

staticHSFont.caption() -> HSFont

Caption text style
HSFont.caption() -> HSFont
HSFont
An HSFont object

staticHSFont.caption2() -> HSFont

Caption2 text style
HSFont.caption2() -> HSFont
HSFont
An HSFont object

staticHSFont.footnote() -> HSFont

Footnote text style
HSFont.footnote() -> HSFont
HSFont
An HSFont object

staticHSFont.headline() -> HSFont

Headline text style
HSFont.headline() -> HSFont
HSFont
An HSFont object

staticHSFont.largeTitle() -> HSFont

Large Title text style
HSFont.largeTitle() -> HSFont
HSFont
An HSFont object

staticHSFont.subheadline() -> HSFont

Sub-headline text style
HSFont.subheadline() -> HSFont
HSFont
An HSFont object

staticHSFont.title() -> HSFont

Title text style
HSFont.title() -> HSFont
HSFont
An HSFont object

staticHSFont.title2() -> HSFont

Title2 text style
HSFont.title2() -> HSFont
HSFont
An HSFont object

staticHSFont.title3() -> HSFont

Title3 text style
HSFont.title3() -> HSFont
HSFont
An HSFont object

staticHSFont.system(size) -> HSFont

The system font in a custom size
HSFont.system(size) -> HSFont
Name Type Description
size number The font size in points
HSFont
An HSFont object

staticHSFont.system(size, weight) -> HSFont

The system font in a custom size with a choice of weights
HSFont.system(size, weight) -> HSFont
Name Type Description
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")
HSFont
An HSFont object

staticHSFont.custom(name, size) -> HSFont

A font present on the system at a given size
HSFont.custom(name, size) -> HSFont
Name Type Description
name string A string containing the name of the font to instantiate
size number The font size in points
HSFont
An HSFont object