View Single Post
Old 01-03-2011, 08:22 AM   #41
ander111
Member
ander111 began at the beginning.
 
ander111's Avatar
 
Posts: 14
Karma: 20
Join Date: Dec 2010
Device: Sony Reader PRS-650
Hi everybody,

Okay, I've successfully flashed my firmware, created font folders in my 'epub' folder, and uploaded the corresponding font sets to them. But I'm still confused about editing UserStyle.css.

I got the Droid font working with this UserStyle.css:

Code:
@font-face {
font-family: DroidSerif;
font-weight: normal;
font-style: normal;
src: url(res:///Data/epub/FONT/droid/DroidSerif-Regular.ttf);
}

@font-face {
font-family: DroidSerif;
font-weight: bold;
font-style: normal;
src: url(res:///Data/epub/FONT/droid/DroidSerif-Bold.ttf);
}

@font-face {
  font-family: DroidSerif;
  font-weight: normal;
  font-style: italic;
  src: url(res:///Data/epub/FONT/droid/DroidSerif-Italic.ttf);
}

@font-face {
  font-family: DroidSerif;
  font-weight: bold;
  font-style: italic;
  src: url(res:///Data/epub/FONT/droid/DroidSerif-BoldItalic.ttf);
}

@font-face {
  font-family: "sans-serif1";
  src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf);
}

h1 {
  font-family: sans-serif1, sans-serif;
}
body {
  font-family: DroidSerif;
}
But I'd rather use a different font—for example, Georgia. I've tried using the exact same CSS format, substituting "Georgia" for the font name, and case-sensitive "georgia" to match the folder name and filenames:

Code:
@font-face {
  font-family: Georgia;
  font-weight: normal;
  font-style: normal;
  src: url(res:///Data/epub/FONT/georgia/georgia.ttf);
}

@font-face {
  font-family: Georgia;
  font-weight: bold;
  font-style: normal;
  src: url(res:///Data/epub/FONT/georgia/georgiab.ttf);
}

@font-face {
  font-family: Georgia;
  font-weight: normal;
  font-style: italic;
  src: url(res:///Data/epub/FONT/georgia/georgiai.ttf);
}

@font-face {
  font-family: Georgia;
  font-weight: bold;
  font-style: italic;
  src: url(res:///Data/epub/FONT/georgia/georgiaz.ttf);
}

@font-face {
  font-family: "sans-serif1";
  src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf);
}

h1 {
  font-family: sans-serif1, sans-serif;
}
body {
  font-family: Georgia;
}
...and the Reader reverts to the lame Sony body font. Why?

Also, if the firmware flash adds a "userStyle.droid.css" file, don't we have to add a file like that for other fonts? Or does only Droid require it for some reason?

Finally, how do you change the font size? Since this is CSS, I imagined you could just add a "font-size" entry to the "body" section:

Code:
body {
  font-family: DroidSerif;
  font-size: 10pt;
}
But this has no effect.

Thanks for your help!

Last edited by ander111; 01-03-2011 at 09:21 AM.
ander111 is offline   Reply With Quote