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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2017, 06:24 PM   #1
radius
Lector minore
radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.
 
radius's Avatar
 
Posts: 637
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, PRS-T3, PaperWhite 2, Nexus 9
Unhappy 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);
}
3) In my "body" style I use the added font:

Code:
body {
    font-family: "Literata", serif;
    margin: 5px;
}
Result:

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?
radius is offline   Reply With Quote
Old 07-25-2017, 06:31 PM   #2
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: 55,447
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
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);
}
3) In my "body" style I use the added font:

Code:
body {
    font-family: "Literata";
    margin: 5px, 5px, 5px, 0
}
Oh and you don't need a margin for the bottom of the screen.

Last edited by JSWolf; 07-25-2017 at 06:33 PM.
JSWolf is offline   Reply With Quote
Advert
Old 07-26-2017, 06:21 AM   #3
Ghitulescu
Evangelist
Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'Ghitulescu gives new meaning to the word 'superlative.'
 
Posts: 489
Karma: 150782
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.
Ghitulescu is offline   Reply With Quote
Old 07-28-2017, 02:11 AM   #4
radius
Lector minore
radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.
 
radius's Avatar
 
Posts: 637
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, PRS-T3, PaperWhite 2, Nexus 9
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.
radius is offline   Reply With Quote
Old 07-28-2017, 02:03 PM   #5
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: 55,447
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by radius View Post
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.
Get a Kobo. You can adjust the line-height and not need to add @font-face to use a font of your choice.
JSWolf is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Custom Font fails miyata Kobo Reader 2 01-16-2014 07:21 AM
Java custom font? pepijndevos Kindle Developer's Corner 12 10-10-2012 08:15 PM
Hacks Best custom font? robollama Amazon Kindle 7 05-01-2011 08:33 PM
Custom Font Hacking Hrant Kindle Developer's Corner 5 07-26-2010 06:46 PM
Custom Font Question Blossom Astak EZReader 4 03-13-2010 12:04 AM


All times are GMT -4. The time now is 04:42 PM.


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