load fonts into webview

This commit is contained in:
Satindar Dhillon 2022-03-20 21:54:46 -07:00
parent 65efb1ddf8
commit 4ef2f704be
12 changed files with 65 additions and 0 deletions

View file

@ -48,6 +48,9 @@ struct WebReaderContent {
<head>
<meta charset="utf-8" />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no' />
<style>
@import url("fonts.css");
</style>
</head>
<body>
<div id="root" style="\(styleString)">

View file

@ -0,0 +1,62 @@
@font-face {
font-family: 'Inter';
font-weight: 200;
font-style: normal;
src: url('Inter-ExtraLight-200.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 300;
font-style: normal;
src: url('Inter-Light-300.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 400;
font-style: normal;
src: url('Inter-Regular-400.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 500;
font-style: normal;
src: url('Inter-Medium-500.ttf');
}
@font-face {
font-family: 'SF Mono';
font-weight: 400;
font-style: normal;
src: url('SFMonoRegular.otf');
}
@font-face {
font-family: 'Inter';
font-weight: 600;
font-style: normal;
src: url('Inter-SemiBold-600.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 700;
font-style: normal;
src: url('Inter-Bold-700.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 800;
font-style: normal;
src: url('Inter-ExtraBold-800.ttf');
}
@font-face {
font-family: 'Inter';
font-weight: 900;
font-style: normal;
src: url('Inter-Black-900.ttf');
}