View Single Post
Old 12-01-2011, 02:05 AM   #3
ttsddu
Junior Member
ttsddu began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: PRS-T1
Quote:
Originally Posted by seabee View Post
I finally succeeded for references to any PRS-T1 integrated font !

for exemple:
@font-face {
font-family: MyFont1;
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/FrutigerNeueLTW1G-Regular.otf);
}

Don't need to include a copy of these fonts in each ePUB !
See my previous list of filenames for fonts you can directly reference.
And now that I found this, I know that references outside of the ebook content are possible, only have to find how to reference user-visible integrated and external flash.
I can also stop trying urls that don't begin with res:/// !

My sample reference 6 of the PRS-T1 fonts without embedding them (obviously in 2.3KB) plus a failed reference to a font added to internal flash.

FYI, I already tried res:///ebook/mnt/sdcard (in the sample) and res:///ebook/sdcard as READER root, both failed, will do more tests tomorrow.
Detailed steps:
1. Right click on the book you added in calibre, click "Tweak ePub".
2. Click "Explode ePub", locate and open the .css file by text editor. (e.g. ".\OPS\css\main.css")
3. Change the corresponding font-face block to below.
@font-face {
font-family:"the font family you found using in other blocks, e.g. cnepub, zw";
src:url(res:///ebook/fonts/DroidSansFallback.ttf);
}
4. Save the file, click "Rebuild ePub".
5. Select the book and click "Send to device", or right click on the book, click "Open containing folder" and copy the modified book to your desired location.

Thank you seabee for this exciting solution.
ttsddu is offline   Reply With Quote