Thread: Variable fonts
View Single Post
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: 79,960
Karma: 146918083
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