Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FontWeight<T>

Provides a way to create a set of divisions that have nice aliases to access them:

example
A basic set of divisions ```ts const weight = new Weight({ base: 500 }); weight.light; // -> 400 weight.normal; // -> 500 weight.bold; // -> 700 ```
example
Customise scaling, reduces the range of the divisions ```ts const weight = new Weight({ base: 16, scale: Scale.PerfectFifth }); ```
example
Customise certain stops (or all of them `100` to `900`) ```ts const weight = new Weight({ base: { 500: 500, 600: 600, 700: 700 }}); ```

Type parameters

  • T

Hierarchy

Implements

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new FontWeight(__namedParameters?: object): FontWeight

Accessors

100

  • get 100(): T

200

  • get 200(): T

300

  • get 300(): T

400

  • get 400(): T

500

  • get 500(): T

600

  • get 600(): T

700

  • get 700(): T

800

  • get 800(): T

900

  • get 900(): T

bold

  • get bold(): T

light

  • get light(): T

normal

  • get normal(): T

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string