Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
subugoe
emo
TIDO
Commits
ee61e54a
Commit
ee61e54a
authored
Sep 16, 2021
by
dindigala
Committed by
pestov
Sep 17, 2021
Browse files
fix: refactor logic to display font styles
parent
8f954241
Pipeline
#229800
passed with stages
in 4 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/content.vue
View file @
ee61e54a
...
...
@@ -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 @
ee61e54a
...
...
@@ -19,8 +19,3 @@
outline
:
none
;
width
:
100%
;
}
.custom-font
,
.custom-font
*
{
font-family
:
'tido'
;
}
src/index.template.html
View file @
ee61e54a
...
...
@@ -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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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