FontFamily class final

A font family a site declares (a pubspec fonts: entry): text styles name it by family ("fontFamily": "Fraunces", whatever the files call themselves inside), and each weight and style draws from its file.

JSON, in site.json: "fonts": [{"family": "Fraunces", "fonts": [{"asset": "fonts/Fraunces-Regular.ttf"}, {"asset": "fonts/Fraunces-Bold.ttf", "weight": 700}, {"asset": "fonts/Fraunces-Italic.ttf", "style": "italic"}]}].

Annotations
  • @immutable

Constructors

FontFamily({required String family, List<FontAsset> fonts = const []})
const

Properties

family → String
final
fonts → List<FontAsset>
Its files, one per weight and style.
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → FontFamily?
Null for anything without a family.
listFromJson(Object? json) → List<FontFamily>

Constants

extensions → const Set<String>
The file extensions a font may have.
keys → const Set<String>