Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-17-2024, 04:36 PM   #1
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,181
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Variable fonts

I am attempting to embed the Quicksand font into an epub3 file, to use on headings and the title page.
https://fonts.google.com/specimen/Quicksand

I note that it is a "Variable" font which contains all the font styles in a single file.

When using it in the epub3 on a Libra2, the styling defaults to "Light" instead of the needed "Bold" and I cannot access any heavier modes.

Is this because the Libra2 does not handle variable fonts?
Surprisingly I couldn't find an answer here on the forum or the fonts wiki page.
Karellen is offline   Reply With Quote
Old 05-17-2024, 05:17 PM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,567
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Karellen View Post
I am attempting to embed the Quicksand font into an epub3 file, to use on headings and the title page.
https://fonts.google.com/specimen/Quicksand

I note that it is a "Variable" font which contains all the font styles in a single file.

When using it in the epub3 on a Libra2, the styling defaults to "Light" instead of the needed "Bold" and I cannot access any heavier modes.

Is this because the Libra2 does not handle variable fonts?
Surprisingly I couldn't find an answer here on the forum or the fonts wiki page.
Not all devices support variable fonts. But to set the bold style, try:

font-weight: 800;

If you want normal weight, try:

font-weight: 400;

And if you want to set a "light" weight, then try:

font-weight: 300;

Maybe there is a font definition that is overwritting your new style. If the above doesn't work, try adding the !important sufix.

Kobo Libra should support variable fonts; try with .kepub extension instead of .epub.

Last edited by RbnJrg; 05-17-2024 at 05:20 PM.
RbnJrg is offline   Reply With Quote
Old 05-17-2024, 06:59 PM   #3
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,181
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Thanks @RbnJrg
I have tried both the normal "Bold" and a weight number. While both work in the Editor viewer, they don't show in the Libra 2.

I noticed that when I added @font-face in the stylesheet, Calibre automatically defaulted to the "light" weight.

PHP Code:
@font-face {
  
srcurl(OEBPS/Quicksand-Light.otf);
  
font-family"Quicksand Light";
  
font-weight300;
  
font-stylenormal;
  
font-stretchnormal;
  } 
But if I try and edit the font-weight to "bold" or 800, then the checkers in Calibre have a fit and it still shows as Light in Libra 2.

I'll try the !important suffix.
Karellen is offline   Reply With Quote
Old 05-17-2024, 07:38 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,758
Karma: 131375596
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Karellen View Post
Thanks @RbnJrg
I have tried both the normal "Bold" and a weight number. While both work in the Editor viewer, they don't show in the Libra 2.

I noticed that when I added @font-face in the stylesheet, Calibre automatically defaulted to the "light" weight.

PHP Code:
@font-face {
  
srcurl(OEBPS/Quicksand-Light.otf);
  
font-family"Quicksand Light";
  
font-weight300;
  
font-stylenormal;
  
font-stretchnormal;
  } 
But if I try and edit the font-weight to "bold" or 800, then the checkers in Calibre have a fit and it still shows as Light in Libra 2.

I'll try the !important suffix.
There is a better solution that works. In the ZIP file for Quicksand from the link you posted is a directory titles static. It contains the following fonts...

Quicksand-Bold.ttf
Quicksand-Light.ttf
Quicksand-Medium.ttf
Quicksand-Regular.ttf
Quicksand-SemiBold.ttf

Just pick the ones you want to embed based ont he weight of the font.

This is how you do the CSS for the fonts.

Code:
@font-face {
  font-family: Quicksand;
  font-weight: bold;
  font-style: normal;
  src: url(../fonts/Quicksand-Bold.ttf);
}

Last edited by JSWolf; 05-17-2024 at 07:43 PM.
JSWolf is offline   Reply With Quote
Old 05-17-2024, 08:14 PM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,181
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by JSWolf View Post
There is a better solution that works. In the ZIP file for Quicksand from the link you posted is a directory titles static. It contains the following fonts...

Quicksand-Bold.ttf
Quicksand-Light.ttf
Quicksand-Medium.ttf
Quicksand-Regular.ttf
Quicksand-SemiBold.ttf

Just pick the ones you want to embed based ont he weight of the font.
Oh, geez. I feel like such an idiot. I just extracted the Quicksand_VariableFont_wght.ttf file. I didn't even look in the Static folder as I just thought it contained some publishers documents. Teach me to not be curious and not poke around!!

Issue solved. Thanks @JSWolf
Karellen is offline   Reply With Quote
Old 05-17-2024, 09:15 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,758
Karma: 131375596
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Karellen View Post
Oh, geez. I feel like such an idiot. I just extracted the Quicksand_VariableFont_wght.ttf file. I didn't even look in the Static folder as I just thought it contained some publishers documents. Teach me to not be curious and not poke around!!

Issue solved. Thanks @JSWolf
You are very welcome.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW2 Variable for Board ID filonstr Kindle Developer's Corner 2 12-14-2022 01:21 AM
"Variable Fonts" supported in epub? BKh ePub 2 10-17-2018 10:42 AM
Setting environment variable dator Server 2 09-08-2018 08:57 AM


All times are GMT -4. The time now is 01:58 PM.


MobileRead.com is a privately owned, operated and funded community.