Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
subugoe
emo
TIDO
Commits
cb1c97f3
Commit
cb1c97f3
authored
Sep 17, 2021
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/content.vue
View file @
cb1c97f3
...
...
@@ -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
);
...
...
src/css/global.scss
View file @
cb1c97f3
...
...
@@ -19,8 +19,3 @@
outline
:
none
;
width
:
100%
;
}
.custom-font
,
.custom-font
*
{
font-family
:
'tido'
;
}
src/index.template.html
View file @
cb1c97f3
...
...
@@ -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
"
:
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment