!> Fonts cannot be manipulated at all on Backtivisda. It is necessary to use the git project (see ticket #185).
Add a font
Download the font onto your computer.
Convert it into several formats, ideally .otf, .woff and .ttf. To do this, download this script and run :
python3 fonts-manipulator/cli.py -i myfont.ttf --otf --woff --ttf
Adds the various files to the static/fonts folder (they can be grouped into sub-folders)
Open the local/data/fonts.json file (here for version v1.0.11) and add a :
{
"version": "1.0.11",
"fonts": [
{
"css": {
"font-style": "normal",
"font-weight": "normal",
"font-display": null,
"unicode-range": null
},
"fontName": "< font name>", // used in css
"directory": "./<your font name>",
"formats": {
"otf": "<font name>.otf", // complete path static/fonts/<your font name>/<font name>.otf
"woff": "<font name>.woff",
"ttf": "<font name>.ttf"
},
"name": "<label font name>", // to display
"loaded": false,
"italic": false,
"bold": false,
"alwaysLoaded": true, // if your want is heavy and speacific (eg. chinese font), set alwaysLoaded: false
"default": true
},
...
]
}
To test, you need to recompile Aktivisda, either by using continuous integration or by running :
npm run serve:aktivisda
Don't forget to commit changes (files fonts and font.json)