Font Directory Schema
s.fontdir(dir, options?)
A directory of fonts that is the whole module. It is an s.filedir() whose accept defaults to the web font formats - font/woff2, font/woff, font/ttf and font/otf - so it stores the same content and is checked and fixed the same way.
What it adds is the default accept, and a check that accept names only font types. The font previews in Val Studio - each font set in itself, in the gallery and wherever a font is picked - come from the file's font mimeType, so fonts in a plain s.filedir() are previewed too. A field picks a font with s.font(fontsModule), which stores only the path and refuses a module that is not a font directory.
Upgrading? s.fontdir() replaces s.fontset({ dir, ...options }), which still works but is deprecated.
Options:
Required. Where the fonts are stored. Must start with /public. Two collections may not claim the same directory.
Which font types may be uploaded. Defaults to every web font format. Narrow it to font/woff2 to keep to the one format every current browser reads and that is smallest on the wire. Anything that is not a font type is refused - use s.filedir() for other files.
Methods:
Store the fonts on Val's remote server instead of in your git repository. See the remote files guide.