Mateja
(Mateja)
May 21, 2020, 10:04am
#104
I don’t get why this isn’t possible? Just get the family url from fonts.google.com and in the css file write this:
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@800&display=swap');`
I used Montserrat for this example.
And then if you want the font to be the same for the whole web page just do:
body {
font-family: 'Montserrat', sans-serif; /* font family */
font-weight: 800; /* font weight code /*
/* add other details here */
}
Edit: Please follow the generic structure of an HTML page
Summary
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
</body>
</html>
1 Like
rizu
(Rizu Barury)
May 21, 2020, 10:15am
#105
I know the HTML structure, I am familiar with HTML.
My app is offline, will it work when offline?
vknow360
(Sunny Gupta)
May 21, 2020, 10:17am
#106
I think yes if you will upload ttf in assets and use font from there (Correct me if I am wrong because I am still learning CSS)
rizu
(Rizu Barury)
May 21, 2020, 10:19am
#107
I have uploaded ttf file, i need to know how to integrate the font into HTML
vknow360
(Sunny Gupta)
May 21, 2020, 10:22am
#108
This should work for you:
@font-face {
font-family: Your_Font_Name;
src: url(file:///android_asset/Your_ttfFile_Name.ttf);
}
Is there anything wrong @Mateja ?
Mateja
(Mateja)
May 21, 2020, 10:28am
#109
Hm, @rizu give it a shot.
If it does not work try this:
@import url('file:///android_asset/filename.ttf')
body {
font-family: 'FONT-NAME';
font-weight: 400 /* three digit code */
}
1 Like
Mateja
(Mateja)
May 21, 2020, 10:34am
#112
I have no idea why it worked the first time.
1 Like
vknow360
(Sunny Gupta)
May 21, 2020, 10:35am
#113
Probably because of cache.
1 Like
rizu
(Rizu Barury)
May 21, 2020, 10:36am
#114
Thank you for the idea of @font-face rule
rizu
(Rizu Barury)
May 21, 2020, 11:02am
#115
Will this work?
@font-face {
font-family: Baloo_Da_2;
src: url(file:///android_asset/BalooDa2-Regular.ttf);
}
&
body {
font-family: 'Baloo Da 2', cursive;
font-weight: 400;
}
rizu
(Rizu Barury)
May 21, 2020, 11:14am
#117
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
vknow360
(Sunny Gupta)
May 21, 2020, 11:17am
#118
rizu:
Why?
Because you are not using CustomWebView so asking questions which are not related to it does not make sense.
I suggest you to open a new topic about your issue.
1 Like
Mateja
(Mateja)
May 21, 2020, 11:17am
#119
You are missing 's, try this:
1 Like
Can you add default browser to it without deep host extension
vknow360
(Sunny Gupta)
May 21, 2020, 3:51pm
#123
Click on my avtar and you will see an option for message.
1 Like
Mateja
(Mateja)
May 21, 2020, 3:54pm
#124
Sharing knowledge isn’t private. C’mon, I’d like to know too