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.