05-17-2024, 05:36 PM | #1 |
Wizard
Posts: 1,354
Karma: 6794938
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. |
05-17-2024, 06:17 PM | #2 | |
Wizard
Posts: 1,610
Karma: 8399999
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 06:20 PM. |
|
Advert | |
|
05-17-2024, 07:59 PM | #3 |
Wizard
Posts: 1,354
Karma: 6794938
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. |
05-17-2024, 08:38 PM | #4 | |
Resident Curmudgeon
Posts: 76,381
Karma: 136466962
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 08:43 PM. |
|
05-17-2024, 09:14 PM | #5 | |
Wizard
Posts: 1,354
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Issue solved. Thanks @JSWolf |
|
Advert | |
|
05-17-2024, 10:15 PM | #6 | |
Resident Curmudgeon
Posts: 76,381
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PW2 Variable for Board ID | filonstr | Kindle Developer's Corner | 2 | 12-14-2022 02:21 AM |
"Variable Fonts" supported in epub? | BKh | ePub | 2 | 10-17-2018 11:42 AM |
Setting environment variable | dator | Server | 2 | 09-08-2018 09:57 AM |