07-25-2017, 05:24 PM | #1 |
Lector minore
Posts: 649
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Samsung Galaxy Tab S5e, Google Pixel Slate
|
Custom on-board font help please
I've been trying to use some custom fonts without embedding them into the epubs and it doesn't seem to work for me. I think I must have made a typo somewhere so I'm hoping some fresh eyes can tell me what I'm doing wrong.
1) I copied some otf font files to my device in the folder: READER/Sony_Reader/fonts 2) I added some @font-face definitions to the top of my stylesheet and referenced the font files I added: Code:
@font-face {
font-family: "Literata", serif;
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-regular.otf);
}
@font-face {
font-family: "Literata", serif;
font-weight: bold;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-bold.otf);
}
@font-face {
font-family: "Literata", serif;
font-weight: normal;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-italic.otf);
}
@font-face {
font-family: "Literata", serif;
font-weight: bold;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-bold-italic.otf);
}
Code:
body {
font-family: "Literata", serif;
margin: 5px;
}
I can't see any effect. The text is still all displayed in Amasis. I've tried using ttf fonts instead of otf and it doesn't seem to make any difference. In case it matters, my firmware revision is 1.1.00.15210. What am I doing wrong? |
07-25-2017, 05:31 PM | #2 |
Resident Curmudgeon
Posts: 73,517
Karma: 126422064
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
get rid of the , serif.
Code:
@font-face {
font-family: "Literata";
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-regular.otf);
}
@font-face {
font-family: "Literata";
font-weight: bold;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-bold.otf);
}
@font-face {
font-family: "Literata";
font-weight: normal;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-italic.otf);
}
@font-face {
font-family: "Literata";
font-weight: bold;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/literata-bold-italic.otf);
}
Code:
body {
font-family: "Literata";
margin: 5px, 5px, 5px, 0
}
Last edited by JSWolf; 07-25-2017 at 05:33 PM. |
Advert | |
|
07-26-2017, 05:21 AM | #3 |
Fanatic
Posts: 563
Karma: 403106
Join Date: Aug 2014
Device: PRS-T1
|
If the reader goes to serif, which is the second choice is because it does not find the literata one.
I always embed the fonts in, as a matter of precaution, then subset them to gain space, it may one day that I have to port the epub to another reader and I do not want to start reworking 1000 of them Amasis on T3 is "castrated" as it has not all the characters found eg on T1. |
07-28-2017, 01:11 AM | #4 |
Lector minore
Posts: 649
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Samsung Galaxy Tab S5e, Google Pixel Slate
|
Ah thanks guys.
I was following Sony PRS-T3 Custom Fonts Tutorial and Korben Dallas has a mistake in his URL. The way that he laid out the folders, he needs a .../Sony_Reader/... inserted in the middle. I moved things around and it works for me. Now that I am trying different fonts, it reminds me of the limitations on Sony's T3. Because the user isn't allowed to adjust line height, and because different fonts have different x-height proportions, I have to keep futzing with the line height in CSS every time I try a new font. Argh. |
07-28-2017, 01:03 PM | #5 | |
Resident Curmudgeon
Posts: 73,517
Karma: 126422064
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aura HD Custom Font fails | miyata | Kobo Reader | 2 | 01-16-2014 06:21 AM |
Java custom font? | pepijndevos | Kindle Developer's Corner | 12 | 10-10-2012 07:15 PM |
Hacks Best custom font? | robollama | Amazon Kindle | 7 | 05-01-2011 07:33 PM |
Custom Font Hacking | Hrant | Kindle Developer's Corner | 5 | 07-26-2010 05:46 PM |
Custom Font Question | Blossom | Astak EZReader | 4 | 03-12-2010 11:04 PM |