View Single Post
Old 07-25-2017, 05: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: 660
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Paperwhite Signature
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