Thread: PRS-T1 Modified Sony home screen
View Single Post
Old 07-15-2012, 12:11 PM   #361
pssquirrel
ebooknut
pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.pssquirrel ought to be getting tired of karma fortunes by now.
 
pssquirrel's Avatar
 
Posts: 205
Karma: 573170
Join Date: Oct 2011
Device: Sony T2 & T1 (previously PRS-350)
I'm sure jackie_w will provide a more complete explanation, but some quick examples in the meantime:

Sample code for using fonts already installed on your T1 (you'll find a list of the built-in fonts in the Wiki):

Spoiler:
@font-face {
font-family: serif;
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/AmasisMTW1G.otf);
}

@font-face {
font-family: serif;
font-weight: normal;
font-style: italic;
src: url(res:///ebook/fonts/AmasisMTW1G-Italic.otf);
}

@font-face {
font-family: serif;
font-weight: bold;
font-style: normal;
src: url(res:///ebook/fonts/AmasisMTW1G-Bold.otf);
}

@font-face {
font-family: serif;
font-weight: bold;
font-style: italic;
src: url(res:///ebook/fonts/AmasisMTW1G-BoldItalic.otf);
}

body {
font-family: serif;
line-height: 100%;
}

NOTE: You can change the line-height to whatever you like -- 100%, 120%, 150%, etc.



Sample code for using your own fonts (create a "fonts" folder in your "reader" folder, then copy your fonts into the "fonts" folder):

Spoiler:
@font-face {
font-family: serif;
font-weight: normal;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/MYFONT.ttf);
}

@font-face {
font-family: serif;
font-weight: normal;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/MYFONT-ITALIC.ttf);
}

@font-face {
font-family: serif;
font-weight: bold;
font-style: normal;
src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/MYFONT-BOLD.ttf);
}

@font-face {
font-family: serif;
font-weight: bold;
font-style: italic;
src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/MYFONT-BOLDITALIC.ttf);
}

body {
font-family: serif;
line-height: 100%;
}

NOTE: You can change the line-height to whatever you like -- 100%, 120%, 150%, etc.



Don't forget to update your reader.xml file with the proper font names and filenames:

Spoiler:
<styles default="/mnt/sdcard/reader/css/default.css">
<style name="FontNameA" file="/mnt/sdcard/reader/css/FontNameA.css" />
<style name="FontNameB" file="/mnt/sdcard/reader/css/FontNameB.css" />
<style name="FontNameC" file="/mnt/sdcard/reader/css/FontNameC.css" />
<style name="FontNameD" file="/mnt/sdcard/reader/css/FontNameD.css" />
<style name="FontNameE" file="/mnt/sdcard/reader/css/FontNameE.css" />
<style name="FontNameF" file="/mnt/sdcard/reader/css/FontNameF.css" />
</styles>


Note: CSS rules can be tricky. The above is bare-bones and just enough to get people started. It will work for many but not all epubs, depending on how they're formatted.

Last edited by pssquirrel; 07-15-2012 at 12:19 PM.
pssquirrel is offline   Reply With Quote