Key to referencing your custom fonts from within an ePub is the understanding how the reader device interprets paths:
When you connect your reader to your computer it shows up as two drives:
On the READER drive you will find a directory structure containing your Books:
As you may have guessed your books are located in
as seen from the windows point of view.
As seen from inside your Android T3 device this path translates to
(Remember that Android is after all just another linux flavor using slashes instead of backslashes. Also remember case sensitivity.)
Knowing this we can start our home run. Whatever directory structure you create on your device, it's always known to your T3 as prefixed with
Now we can create a directory under F:\ containing the fonts:
In the fonts directory create a file named mycustomfonts.css referencing your font files in myfonts:
Repeat the block above as necessary varying font-family: and src: accordingly.
Now we are done with the creation of the underlying font infrastructure. All that remains to do is make your newly installed fonts known to the reader application. Don't worrythat's easy.
All we have to do is referencing our mycustomfonts.css stylesheet from inside our ePubs. This we can do easily with Sigil or the calibre book editor:
Open your ePub with the Editor of your choice and insert one line at the top of the main stylesheet:
With this we can use every font-family in our ePubs that is listed in mycustomfonts.css.
Have fun.
When you connect your reader to your computer it shows up as two drives:
Code:
READER (F:)
SETUP (G:)
Code:
READER (F:)
+ Sony_Reader
+ database
+ Digital Editions
+ media
+ books
+ images
+ notepads
Code:
F:\Sony_Reader\media\books\
As seen from inside your Android T3 device this path translates to
Code:
/ebook/fonts/../../mnt/sdcard/Sony_Reader\media\books\
Knowing this we can start our home run. Whatever directory structure you create on your device, it's always known to your T3 as prefixed with
Code:
/ebook/fonts/../../mnt/sdcard/
Code:
READER (F:)
+ Sony_Reader
+ fonts
+ myfonts
Code:
/* Sans-Serif Fonts */
@font-face {
font-family: sans-serif;
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/myfonts/Candara.ttf);
}
@font-face {
font-family: sans-serif;
font-weight: bold;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/myfonts/Candarab.ttf);
}
@font-face {
font-family: sans-serif;
font-weight: normal;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/myfonts/Candarai.ttf);
}
@font-face {
font-family: sans-serif;
font-weight: bold;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/fonts/myfonts/Candaraz.ttf);
}
Now we are done with the creation of the underlying font infrastructure. All that remains to do is make your newly installed fonts known to the reader application. Don't worrythat's easy.
All we have to do is referencing our mycustomfonts.css stylesheet from inside our ePubs. This we can do easily with Sigil or the calibre book editor:
Open your ePub with the Editor of your choice and insert one line at the top of the main stylesheet:
Code:
@import url('res:///ebook/fonts/../../mnt/sdcard/fonts/mycustomfonts.css');
Have fun.