10-09-2009, 09:48 PM | #1 |
Zealot
Posts: 112
Karma: 2781
Join Date: Sep 2009
Location: VA, USA
Device: nook, Ipod touch
|
Fonts and Epub - What works on Sony, Works for Pocket Pro too!
I saw the following thread which had directions on how to change the font in ePub files on the Sony readers and thought that this would have to work on the Pocket Pro too:
https://www.mobileread.com/forums/showthread.php?t=36361 Well, after much teeth gnashing, I finally got an ePub file to use one of the fonts I had put in my /fonts directory instead of the default Times New Roman. This may work for the 6" EZReader too, since I got the directory information from the documentation included in the SDK for the Hanlin V3. This will only work for unencrypted ePub files, since you have to edit the ePub's CSS file to make this work. Add the following to the ePub's CSS file: Code:
@font-face { font-family: "Constantia"; font-weight: normal; font-style: normal; src: url(res:///abook/fonts/CONSTAN.TTF); } @font-face { font-family: "Constantia"; font-weight: bold; font-style: normal; src: url(res:///abook/fonts/CONSTANBD.TTF); } @font-face { font-family: "Constantia"; font-weight: normal; font-style: italic; src: url(res:///abook/fonts/CONSTANI.TTF); } @font-face { font-family: "Constantia"; font-weight: bold; font-style: italic; src: url(res:///abook/fonts/CONSTANBI.TTF); } body { font-family: "Constantia", serif;} I noticed that one of the ePub files I did this to took longer than normal to load and took longer than normal to switch zoom sizes, but the page turn time was the same. I haven't read much in the ePub yet since I just got it working so I have no idea if it will make the file more susceptible to crashing. Try this at your own risk!!! |
10-09-2009, 10:46 PM | #2 |
Addict
Posts: 299
Karma: 300
Join Date: May 2009
Device: kindle, pocket pro
|
i will just wait for official epub book support.
|
Advert | |
|
10-10-2009, 02:00 AM | #3 |
reader
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
Great detective work tamzilla.
This does not work for DRMed ePubs, obviously, but it does allow much smaller files than using embedded fonts in DRM-free ePubs. Also, the fonts directory probably needs to be on the SD card (not the internal memory). Note that the simplest approach of all is to redefine the default fonts (serif, sans-serif, monospace) in the font-face. That way you don't even need a body over-ride. Also, the default font if none is specified is serif, but the serif and san-serif font can be the same (both san-serif) if you want. So an example of using Arial Black as the default would be Code:
@font-face { font-family: "Arial Black", serif, sans-serif; font-weight: normal; font-style: normal; src: url(res:///abook/fonts/Arial-Black.ttf); } The attached TEST_defaultnewfonts.epub illustrates using font-face to refer to the SD fonts directory. For this to work you need all 12 Liberation .ttf files in the fonts folder on your SD card. I got the fonts from https://fedorahosted.org/releases/l/...1.20090721.zip. For screenshots from a similar ePub (only the location of the fonts changed) and the Windows Sony eBook Library viewer see User Stylesheet for Adobe Digital Editions. This is how TEST_defaultfonts.epub should look on an EZ Reader. |
10-10-2009, 09:19 PM | #4 | ||
Zealot
Posts: 112
Karma: 2781
Join Date: Sep 2009
Location: VA, USA
Device: nook, Ipod touch
|
Thanks Wallcraft!
Quote:
Quote:
|
||
10-12-2009, 04:55 PM | #5 |
Connoisseur
Posts: 90
Karma: 100000
Join Date: Jan 2009
Location: New Zealand
Device: prs-t1, prs-650 to sell
|
Wow, so the hanlin is the only device that supports epub custom fonts and justification?
|
Advert | |
|
10-12-2009, 07:25 PM | #6 |
Resident Curmudgeon
Posts: 76,075
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The Opus supports ePub and custom fonts. My guess is that since they both are using the SDK from Adobe for ADE that /abook/ would be the root of the SD card as well. Only way to know is if an Opus user tries it.
I do know that the the Sony Daily Edition will support justification as we've seen in the photos. |
10-12-2009, 09:55 PM | #7 | |
Zealot
Posts: 112
Karma: 2781
Join Date: Sep 2009
Location: VA, USA
Device: nook, Ipod touch
|
Quote:
The Pocket Pro doesn't allow the user to change an ePub's justification. The default behavior seems to be full justification if no other is listed in the ePub's CSS. I you want to change that, you would have to modify the CSS file - which you can only do on non DRM'ed ePubs. |
|
11-01-2009, 02:32 PM | #8 |
Zealot
Posts: 105
Karma: 42644
Join Date: Feb 2009
Device: PW1 + PW2, NOOK HD
|
Quotes around font name?
Hi, I have absolutely no idea what code goes into a CSS but the short example for the Arial Black looks like something I should be able to handle in calibre. But I was wondering if the quotes go around the name of the font as in the example? I have tried simply experimenting with different codes using the example as a template but it is rather tedious to shut down calibre, safely remove hardware, check result on reader, open up calibre, reformat book, etc. etc. I done that 5 times and then my PC balked...
I tried to look up CSS codes on the Internet and I am not sure what's the right format for the PocketPro. Also, if I am specifying a bold font such as BOOKOSB.TTF, do I need to put "bold" into the font weight code as well? Thanks for any hints! booknut Last edited by booknut; 11-01-2009 at 02:36 PM. |
11-01-2009, 07:03 PM | #9 | ||
Zealot
Posts: 112
Karma: 2781
Join Date: Sep 2009
Location: VA, USA
Device: nook, Ipod touch
|
Quote:
When I was trying to get this to work, I used a SD Card reader and just moved the card between my computer and the reader. It was a lot easier than connecting the reader to the computer each time I wanted to test the revision. Quote:
You can put this code in the extra CSS box in Calibre and then do a conversion and Calibre will add this for you in the epub's CSS. You can only do this for non-DRM'ed files. I hope this helps! |
||
11-03-2009, 10:04 AM | #10 |
Zealot
Posts: 105
Karma: 42644
Join Date: Feb 2009
Device: PW1 + PW2, NOOK HD
|
Changing font for epub
What finally worked for me is this:
@font-face { font-family: "PMN Caecilia", serif, sans-serif; font-weight: normal; font-style: normal; src: url(res:///abook/fonts/lte50887.ttf); } BUT, after many tries, I finally figured out I had to change the name of the font on the SD card to all small letters and no spaces or underscores, etc. The font above was originally named LTe50887.ttf and that did not work. Now the font is just as dark on the Pocket Pro as on the Sony 505, as a matter of fact, I showed both to my husband and he actually preferred the Pocket Pro version (and so do I). |
11-04-2009, 10:05 AM | #11 |
Zealot
Posts: 112
Karma: 2781
Join Date: Sep 2009
Location: VA, USA
Device: nook, Ipod touch
|
I'm glad you got it working! I really don't like how the default Times font is displayed on the Pocket Pro - it doesn't have enough contrast for me.
I remember that in order to get custom fonts working for the mobi formats, the font names either had to be all in lowercase or all in caps. Looks like this may be true for all of the formats. |
12-04-2009, 09:25 AM | #12 |
Addict
Posts: 373
Karma: 452000
Join Date: Nov 2008
Location: Hamilton, On
Device: Kobo Aura HD
|
Where is this CSS file?
Can system fonts be removed/replaced. |
12-04-2009, 12:13 PM | #13 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
for ePUB the CSS file is inside the file so you can only change it on a per book basis. System fonts can be replaced but not removed. They are in the firmware flash and do not take up user memory. Hopefully at some point Jinke will add support for user fonts on ePUB but today you can change it by editing the ePUB file itself so long as it is not DRM'd.
Dale |
12-04-2009, 12:17 PM | #14 | |
Addict
Posts: 373
Karma: 452000
Join Date: Nov 2008
Location: Hamilton, On
Device: Kobo Aura HD
|
Quote:
|
|
12-04-2009, 12:28 PM | #15 |
Groupie
Posts: 199
Karma: 24918
Join Date: May 2009
Device: PRS-505,nook,Nook Color,Android
|
.ePub files are really .zip files.
If the ePub files are encrypted, the CSS may be in the clear (in ePub, files are encrypted individually) for you to edit. I'm not sure what most publishers do since I don't buy DRM ePub. Once you have access to the CSS, modifying the font is generally very easy (look for instructions on setting font-face with ePub on these forums). |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Classic Font and epub, what works on sony, now works on Nook too! | ctos | Barnes & Noble NOOK | 26 | 07-25-2011 09:24 AM |
Does the 550 unicode fonts hack works on 600/900? | siulayhumga | Sony Reader | 2 | 12-25-2009 02:36 AM |
What are the best fonts for the pocket pro? | yportne | Astak EZReader | 36 | 10-21-2009 02:45 AM |
pdf converted to epub file not working on my EZ Pocket Pro Pro | luvshihtzu | Astak EZReader | 2 | 10-20-2009 07:30 PM |
Validated Secure DE works on SONY (EPUB /PDF) | =X= | Sony Reader | 11 | 11-01-2008 07:43 PM |