Commit cb1c97f3 authored by pestov's avatar pestov
Browse files

Merge branch 'bugfix/font-styles' into 'develop'

fix: refactor logic to display font styles

See merge request !222
parents 8f954241 ee61e54a
Pipeline #229811 passed with stages
in 3 minutes and 39 seconds
......@@ -279,15 +279,25 @@ export default {
async loadFont(url) {
let style = 'normal';
let weight = 'normal';
let fontFamily;
if (url.endsWith('italic.woff')) {
fontFamily = 'SertoJerusalemItalic';
style = 'italic';
}
if (url.endsWith('bold.woff')) {
fontFamily = 'SertoJerusalemBold';
weight = 700; // https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-weight
}
if (url.endsWith('syrcomedessa.woff')) {
fontFamily = 'Estrangelo Edessa';
}
if (url.endsWith('syrcomjerusalem.woff')) {
fontFamily = 'Serto Jerusalem';
}
const fontFace = new FontFace(fontFamily, `url(${url})`, { style, weight });
const fontFace = new FontFace('tido', `url(${url})`, { style, weight }); // 'tido' or any family name to represent fonts
const loadedFont = await fontFace.load();
document.fonts.add(loadedFont);
......
......@@ -19,8 +19,3 @@
outline: none;
width: 100%;
}
.custom-font,
.custom-font * {
font-family: 'tido';
}
......@@ -31,7 +31,7 @@
-->
<script id="tido-config" type="application/json">
{
"entrypoint": "",
"entrypoint": "https://ahikar-dev.sub.uni-goettingen.de/api/textapi/ahikar/syriac/collection.json",
"annotations": {
"show": true,
"types": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment