Fountain

File methods

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

$file->getFontWeight()
Return String
The value of a font weight, eg. 400 for regular or 600 for semi-bold.

$file->fontName()
Return string
Name used @font-face.

$file->toFontFace()
Return string
CSS @font-face for font file. Use correct webfont if it’s not.

$file->toLinkRel( array $attr = [] )
Return string
Parameter $attr – An associative array with additional attributes for the tag.
A full <link rel=“”… for the font.

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

array(1) { ["uuid"]=> string(23) "page://R5NyHN74pSCI5W8r" } array(1) { ["uuid"]=> string(23) "page://g6Ng4EgaMZNYVKV3" } array(1) { ["uuid"]=> string(23) "page://g7BixMNZ35KM6Kef" } array(1) { ["uuid"]=> string(23) "page://QH0sZO0BQZm21F6s" } array(1) { ["uuid"]=> string(23) "page://ZKR1xCeAYZ4Bqz7u" } array(1) { ["uuid"]=> string(23) "page://NxbcFhKvwR0thJTz" } array(1) { ["uuid"]=> string(23) "page://BJqxqH7VQVw0m36c" } array(1) { ["uuid"]=> string(23) "page://krchDUnsOaxwxwMV" } array(1) { ["uuid"]=> string(23) "page://v7MNKuFZRkgghvvJ" } array(1) { ["uuid"]=> string(23) "page://dzsHqpyUq33qSDQm" } array(1) { ["uuid"]=> string(23) "page://rcnc2blzjqevosgw" } array(1) { ["uuid"]=> string(23) "page://kv9l1TfraZdk9xKJ" }