Fountain

File methods

Custom file methods. Available on all files using Fountain templates.

getFontWeight()

The value of a font weight, eg. 400 for regular or 600 for semi-bold.

Returns string
Templates static-font, static-webfont

getFontName()

Returns string
Templates static-font, static-webfont, variable-font, variable-webfont

getFontFace( bool $familyName = false )

Returns string
Templates static-webfont, variable-webfont

getLinkRel( array $attr = [] )

A full <link rel=“”… for the font.

$file->getLinkRel( [ 'rel' => 'preload' ] );
Parameter Type Info
$attr Array An associative array with additional attributes for the tag.
Returns string
Templates static-webfont, variable-webfont

$file->getWebfont()
Return Kirby\Cms\File
The correct WOFF2 file. Works if it’s a OTF/TFF font as well.