Thread: PRS-350 Changing Fonts in PRS+
View Single Post
Old 11-05-2011, 03:58 PM   #21
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
Simple solution for changing fonts (no altering size or line space)

I'm testing another 'kind' of CSS-file for changing fonts:

There is a CSS-file from PRS+ named 'FontsAsInLRF.css' with this code:

Code:
@font-face
{
	font-family: sans-serif;
	src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf);
}
@font-face
{
	font-family: serif;
	src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf);
}
@font-face
{
	font-family: monospace;
	src:url(res:///opt/sony/ebook/FONT/tt0419m_.ttf);
}
It forces to use the standard-fonts of Sony instead of the defined fonts of the ebook. Using the principle of this file I produce CSS-files like this for other fonts (like Caecilia in this case):


Code:
@font-face {
  font-family: serif; 
  font-weight: normal; 
  font-style: normal; 
  src: url(res:///Data/fonts/CaeciliaLTStd-Roman.ttf); 
}

@font-face {
  font-family: serif; 
  font-weight: bold; 
  font-style: normal; 
  src: url(res:///Data/fonts/CaeciliaLTStd-Bold.ttf); 
}

@font-face {
  font-family: serif; 
  font-weight: normal; 
  font-style: italic; 
  src: url(res:///Data/fonts/CaeciliaLTStd-Italic.ttf); 
}

@font-face {
  font-family: serif; 
  font-weight: bold; 
  font-style: italic; 
  src: url(res:///Data/fonts/CaeciliaLTStd-BoldItalic.ttf);
(complete code)

If there is just ONE font for normal, bold and italic, CSS-file looks like this:
Code:
@font-face {
  font-family: serif; 
  src: url(res:///Data/fonts/CaeciliaLTStd-Roman.ttf); 
}
That's the complete code inside the CSS-file. Very simple... and seems to work. Of course just fonts, not size nor line-space is altered.

Last edited by Analogus; 11-05-2011 at 04:00 PM.
Analogus is offline   Reply With Quote