PublishFont class final

A font a published layout uses. Fonts of one family register together, so text picks a file by its weight and style.

Annotations
  • @immutable

Constructors

PublishFont({required String id, required String family, int weight = 400, bool italic = false, String? url})
const

Properties

family → String
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
final
isSiteFile → bool
Whether url is a path relative to the published site (fonts/Inter.ttf), not a URL.
no setter
italic → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
url → String?
Where the font file is: an uploaded font's URL, or a path relative to the published site (a site's declared font, ofFamilies), read through the loader's files. Null for a font the runtime fetches by family (Google Fonts).
final
weight → int
100–900.
final

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.
override

Operators

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

Static Methods

fromJson(Object? json, {String? id}) → PublishFont?
idOf(String family, int weight, bool italic) → String
The id a family's face has in a publish model's fonts: Family/weight/italic.
ofFamilies(Iterable<FontFamily> families) → List<PublishFont>
The fonts a site declares (FontFamily, a site.json's fonts), one per file, each read from its path relative to the site.