View Single Post
Old 10-10-2009, 03:00 AM   #3
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
Great detective work tamzilla.

This does not work for DRMed ePubs, obviously, but it does allow much smaller files than using embedded fonts in DRM-free ePubs. Also, the fonts directory probably needs to be on the SD card (not the internal memory).

Note that the simplest approach of all is to redefine the default fonts (serif, sans-serif, monospace) in the font-face. That way you don't even need a body over-ride. Also, the default font if none is specified is serif, but the serif and san-serif font can be the same (both san-serif) if you want. So an example of using Arial Black as the default would be
Code:
@font-face {
  font-family: "Arial Black", serif, sans-serif;
  font-weight: normal;
  font-style:  normal;
  src: url(res:///abook/fonts/Arial-Black.ttf);
}
One issue with the standard font is that it does not have custom bold and italic versions (they are faked from the standard version). Using font-face allows you to provide more fully defined fonts, like the Liberation fonts. The attached TEST_defaultfonts.epub illustrates the standard fonts and there are screenshots from the Windows Sony eBook Library viewer here. The EZ Readers seem to be identical, i.e. they are using the standard Adobe default fonts.

The attached TEST_defaultnewfonts.epub illustrates using font-face to refer to the SD fonts directory. For this to work you need all 12 Liberation .ttf files in the fonts folder on your SD card. I got the fonts from https://fedorahosted.org/releases/l/...1.20090721.zip. For screenshots from a similar ePub (only the location of the fonts changed) and the Windows Sony eBook Library viewer see User Stylesheet for Adobe Digital Editions. This is how TEST_defaultfonts.epub should look on an EZ Reader.
Attached Files
File Type: epub TEST_defaultfonts.epub (2.5 KB, 453 views)
File Type: epub TEST_defaultnewfonts.epub (2.7 KB, 397 views)
wallcraft is offline   Reply With Quote