![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,289
Karma: 6700678
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. |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,289
Karma: 6700678
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:
I'll try the !important suffix. |
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,700
Karma: 134319572
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,289
Karma: 6700678
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Issue solved. Thanks @JSWolf |
|
![]() |
![]() |
![]() |
#6 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,700
Karma: 134319572
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |