View Full Version : ePub custom Fonts on all Sonys


Pages : [1] 2

Xenophon
01-14-2009, 12:23 PM
In some earlier post in one of the many fora here on MobileRead, somebody posted instructions on how to use a custom non-embedded(!) font with ePub files on the 500 and 505. Has anyone done this successfully on the 700?

The posted directions were:
Just put the following script:
@font-face {
font-family: "Freestyle Script";
src:url(res:///Data/FONT/FREESCPT.TTF);
}
in the CSS and put your font at FONT/FREESCPT.TTF of internal storage.
And actually it supports *any* unicode locale. (Fonts on MS is also possible.)

I'm trying to do this on my 700, but I can't find a Data directory in which to place my font. Suggestions, anyone?

Xenophon

EDIT : scroll down to post 9 (http://www.mobileread.com/forums/showpost.php?p=339933&postcount=9) of this thread for all the css code you will need, and in post 18 (http://www.mobileread.com/forums/showpost.php?p=389066&postcount=18) i've added some screen caps and a step-by-step guide for people who are less experienced with using css.
--zelda pinwheel

kovidgoyal
01-14-2009, 12:25 PM
I haven't tried this, but you should be able to put the font in any directory

llasram
01-14-2009, 12:37 PM
I'm trying to do this on my 700, but I can't find a Data directory in which to place my font. Suggestions, anyone?

The '/Data' directory is where the externally-mountable Reader-internal flash partition is mounted from the Reader's perspective. So if you create a file 'foobar.otf' just in the root directory of the Reader-internal memory, the Reader (and the CSS you need to write) sees it at '/Data/foobar.otf'.

wallcraft
01-14-2009, 12:38 PM
II'm trying to do this on my 700, but I can't find a Data directory in which to place my font. My reading of the original posts is that res:///Data/ is the URL of the root of the Reader-internal memory, so you should create the FONT directory (or whatever) there.

Xenophon
01-14-2009, 12:57 PM
The '/Data' directory is where the externally-mountable Reader-internal flash partition is mounted from the Reader's perspective. So if you create a file 'foobar.otf' just in the root directory of the Reader-internal memory, the Reader (and the CSS you need to write) sees it at '/Data/foobar.otf'.

Should I take your use of the '.otf' extension to mean that open type fonts are supported? If so, TrueType style only, or do PS-style opentype fonts work too?

And thanks to all the previous posters for their answers to my question! :thanks:

Xenophon

llasram
01-14-2009, 01:42 PM
Should I take your use of the '.otf' extension to mean that open type fonts are supported? If so, TrueType style only, or do PS-style opentype fonts work too?

You know, I'm not sure. If you figured it out and reported back I know that I would be grateful :).

Xenophon
01-16-2009, 11:35 AM
I spent several hours last night experimenting with this feature. I was unable to get it to work. I tried every combination I could of the following:

Truetype font, Mac-style or PC-style...
In files named xxx.ttf, or XXX.TTF...
In a FONT sub-directory or directly in the Data directory...
Named in the CSS by their Mac name, their PC name or their "Unique name"...


I also attempted using Opentype fonts, both truetype and PS style. I was not able to construct a working example, no matter the combination.

At this point, I'd really appreciate it if someone who's gotten this to work on their 700 (or 505!) would be willing to send me both a zip of the actual font file they used AND the css they used to invoke it.

Xenophon

Xenophon
01-20-2009, 01:23 PM
Bump...

llasram
01-30-2009, 10:13 PM
I meant to answer this in more detail earlier...

You need three basic ingredients to do this:


Your font files somewhere on your Reader's internal memory partition.
Some CSS telling AdobeDE where those font files are.
Some CSS telling AdobeDE to actually use those fonts.

I'm guessing that you were missing the last one, but I'll go into detail on all of them, just to be safe.

You can put the font-files anywhere on the Reader's internal memory partition, but let's keep it simple and put them all in a folder named 'fonts' at the root of the partition. So when you open the Reader's internal memory you should see all the normal stuff plus the 'fonts' folder you created. Just put all the font files you want to use in there.

The CSS needs to have '@font-face' rules describing the font-family and pointing at the font files, including all combination of variant font properties. Here's an example using the open source font "TeX Gyre Cursor":

@font-face {
font-family: "TeX Gyre Cursor";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/texgyrecursor-regular.otf);
}

@font-face {
font-family: "TeX Gyre Cursor";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/texgyrecursor-bold.otf);
}

@font-face {
font-family: "TeX Gyre Cursor";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/texgyrecursor-italic.otf);
}

@font-face {
font-family: "TeX Gyre Cursor";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/texgyrecursor-bolditalic.otf);
}

The value of the 'font-family' property can be anything, but needs to be the same for every font-file in the same family you are referencing, and for simplicity should be the actual name of the typeface included in the font-files. The 'src' properties should point to the individual font-font files: prefix the files with 'res:///Data/', then the path to the font file, using forward slashes ('/') to separate directories. Case matters, so make sure you are using the same case as for the files themselves. Linux (which is what the Reader is running) has options which change how it handles ALLCAPS filenames on FAT-32 filesystems, so I would suggest avoiding them.

Next you need some CSS which actually tells AdobeDE to use the typeface you've configured. The simplest way to do that is with a rule like:

body {
font-family: "TeX Gyre Cursor", serif;
}

Which tells it to use "TeX Gyre Cursor" for everything within a <body/> tag (i.e., all the book text) which doesn't explicitly specify a different font-family, and fall back to the built-in 'serif' typeface for any characters missing from "TeX Gyre Cursor."

If you're using the Calibre GUI, you can just put all the text in the textbox for override CSS. If you're using the command-line tools, you can create a file with all the CSS in it and pass the filename as the argument to the '--override-css' option.

For an example, I created the attached book from the attached sources with the attached fonts using the attached CSS file[1] (whew!) using the command:

any2epub --override-css fonts.css.txt TBsrc/content.opf -o TestBook.epub

I hope that gets you sorted out!

[1] The file is named "fonts.css.txt" instead of just "fonts.css" due only to the MR uploaded filename rules.

Xenophon
01-31-2009, 02:29 PM
Thanks!! I'll try it out this weekend. When you wrote:
You need three basic ingredients to do this:

Your font files somewhere on your Reader's internal memory partition.
Some CSS telling AdobeDE where those font files are.
Some CSS telling AdobeDE to actually use those fonts.

I'm guessing that you were missing the last one, but I'll go into detail on all of them, just to be safe.

I'll bet that the last one is exactly what I was missing.

Xenophon

Xenophon
02-03-2009, 09:55 PM
:thanks:

llasram's post gave me all the information I needed. It's really nice reading books in Adobe Garamond Pro, complete with real italics instead of the Sony Reader's crappy synthesized italics.

And, indeed, the CSS telling AdobeDE to actually use the fonts was exactly the part I was missing. :smack::smack::smack:


Xenophon

Beth loves books
02-14-2009, 09:59 PM
Does this only work for PDF's or does it also work to change fonts in sony content?

Xenophon
02-15-2009, 12:25 PM
I don't think it works for PDFs, and it certainly does not work for LRF or LRX files. But it works wonderfully well for EPUB files. Note that you have to be able to either edit the EPUB or create it yourself. I create mine using Calibre, starting from Microsoft Reader (.lit) files.

Xenophon

Beth loves books
02-16-2009, 04:26 AM
Thanks, I'm learning more about calibre every day and will give that a try for EPUB files.

What a bummer though about the LRF/LRX files. I figured as much.

deadringer
02-26-2009, 05:25 PM
It would be nice if someone wrote a windows program to change fonts for us dummies!!!
hint....hint. Since I'm totally lost about what your talking about.

John

zelda_pinwheel
03-07-2009, 10:14 AM
this method works on the 505 as well (tested by JSWolf) so i'm moving it to the epub forum where it seems more appropriate.

deadringer
03-10-2009, 04:56 PM
I can't seem to make this work. My epub files , which I make from .lit files using Calibre, never change fonts. I put the font files in a fonts dir which I made in the Sony Reader directory. Also in there are directories called sync,database,books etc. Is this the correct place?

Thanks

John

zelda_pinwheel
03-11-2009, 12:21 PM
since i've had a few questions about this procedure i decided to add some screen caps to make the process clearer to people who are less experienced. detailed instructions (including all the css code needed) are in post 9 (http://www.mobileread.com/forums/showpost.php?p=339933&postcount=9) of this thread (thanks llasram !!).

(click three times in a row on the image to see it at full size)
1. connect the 505 / 700, and open the folder
25429

2. create a new folder called "fonts"
25430

3. put the font files inside this folder
25431

4. add the css rules indicating where the fonts are, and to use them
25432

5. (very important) output in epub format.

TUTORIAL


here is a step-by-step guide :

1. install calibre.
2. choose the font you want to use for your files. i use "Fontin" family (it has a regular, a bold, an italic, and a small-caps version).
3. create a new folder at the top level of your 700 called "fonts" (case is important : it can be called "Fonts", but you'll have to name it that way everywhere you refer to it).
4. put your chosen font files into that folder (there should be more than one, since usually there will be regular, italic, bold, and maybe some others. also, some font families come with serif and sans serif versions).
5. launch calibre, click on the little arrow next to "convert ebooks", then "set defaults for conversion".
6. on the left side of the dialogue box, click on "look & feel".
7. in the "override css" box in the bottom right quarter of the dialogue box, paste the script from the other thread, making sure to follow the renaming instructions. since i'm using Fontin, the script for me looks like this :
@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Regular.ttf);
}

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

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

body {
font-family: "Fontin", serif;
}

notice i named the "font-family" Fontin for clarity, and in the "source" line (src) i specified the exact name of each file, inside the "fonts" folder i created on my 700.

click ok to save these defaults.

all books you convert with calibre should now use the font of your choice.

HOW TO CREATE THE FONTS FOLDER :
connect your 700 to your computer using the usb cable. wait for it to be recognized. if you are using a pc, you should get a prompt asking you what you want windows to do with this new disk ; ask to view it in explorer (or something like that ; i'm translating from french, from memory here. but in windows XP, the icon for the choice you want is an open folder). you'll see a new file explorer window, with some folders already in it. i believe you should have "database" "digital editions" etc. on the side of that window, you'll have options, including "create new folder". click on that, and rename the folder "fonts".

zelda_pinwheel
03-11-2009, 12:30 PM
I can't seem to make this work. My epub files , which I make from .lit files using Calibre, never change fonts. I put the font files in a fonts dir which I made in the Sony Reader directory. Also in there are directories called sync,database,books etc. Is this the correct place?

Thanks

John

i thought it was working for you ? are you having trouble again ?

deadringer
03-11-2009, 11:49 PM
Hello Zelda

I couldn't get Fontin to work but I did just get georgia.ttf to work. I must have a typing error in the css or something. Thanks for all the help!

John

JSWolf
03-14-2009, 10:07 AM
Fontin is actually a nice readable font at small sizes because of the weight. I've also used the sans-serif version to make the headers. That looks good too.

zelda_pinwheel
03-14-2009, 10:10 AM
Hello Zelda

I couldn't get Fontin to work but I did just get georgia.ttf to work. I must have a typing error in the css or something. Thanks for all the help!

John

ha okay. well don't forget the filepath of the font must be exactly as it is in the font folder (file name and directory name are case sensitive) ; to get the file name i did a copy-paste directly from the font file.

that said, i have had a couple of failed attempts, which i've not been able to figure out. and when i tried to embed a couple of decorative fonts in a file which i had already put into fontin, one of them worked, but not the other (don't know why).

perhaps not all fonts are created equal... (for info, i've had success both with otf and ttf fonts).

glad you managed to get one of them to work though !

pepak
03-14-2009, 11:01 AM
After I have defined the external font-faces:

@font-face { font-family: "Times"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/times.ttf); }
@font-face { font-family: "Times bold"; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/timesbd.ttf); }
@font-face { font-family: "Times italic"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/timesi.ttf); }
@font-face { font-family: "Times bold italic"; font-weight: bold; font-style: italic; src: url(res:///Data/fonts/timesbi.ttf); }

and told body to use the basic font:

body { font-family: "Times CE", serif; }

do I need to add definitions to use the italic/bold variants as well, or will ADE use them automatically?

strong, b { font-family: "Times CE bold", serif; }
em, i { font-family: "Times CE italic", serif; }
...


And a second question: I am using "generic" font-families everywhere:

code { font-family: monospace; }

Is it possible to instruct ADE that my custom font "Courier CE" should be used as a default monospace font, or do I need to update all definitions to:

code { font-family: "Courier CE", monospace; }

?

pepak
03-14-2009, 11:12 AM
Well, answer to question 1 is "apparently yes", since italic sections of a book I tried I rendered using the default font, not my custom font (I did not use the extra definitions for em, i, strong, b, etc.).

zelda_pinwheel
03-14-2009, 11:20 AM
first question : be careful with your code : for "font family", you should use the name of the font family, not the specific font type, so "Times" instead of "Times bold" (etc.) and it should be the same name for all variants of the font (regular, bold, italic). then you have to give this same font family name in the "body" rule. then, the italic and bold variants should be used automatically when you specify "em" and "strong" in the markup.

second question : i think you need to make new rules for all additional fonts, and define them the same way you did for times, and then try creating a css class (like ".mono" or ".code") which says to use the font ; then use a "span class" selector to specify when you want to use the monospace fonts.

pepak
03-14-2009, 11:32 AM
#1: You are correct, my mistake. Fixed it and it works now.
#2: That's not so good, but I guess there is little else to do.

Interesting observation: The new font gets used for regular, bold and italic text, but it does not get used for font-variant: small-caps;. But that is probably an error in ADE, since it renders such sections as font-variant: normal; anyway.

zelda_pinwheel
03-14-2009, 11:34 AM
#1: You are correct, my mistake. Fixed it and it works now.
#2: That's not so good, but I guess there is little else to do.
glad the first one worked. sorry about the second one. :o that's the only way i see. but maybe you can find a simpler one ; if you do, please share it here !

Interesting observation: The new font gets used for regular, bold and italic text, but it does not get used for font-variant: small-caps;. But that is probably an error in ADE, since it renders such sections as font-variant: normal; anyway.
well, some fonts actually have a specific "small caps" variant which is a separate font file (Fontin does) ; so if it's not defined, maybe it goes back to the default. you could define "small caps" in your css though.

richardigp
03-14-2009, 11:58 AM
Xenophon,

We have embedded fonts working on the 505 and use it to test commercial ePubs with embedded fonts nearly every day. The spec says use OTF preferrably, but it is up to the device what it handles. Devices do not have to handle fonts, or any fonts in particular. The mandatory points for embedded fonts if supported are: Font is in the manifest, must use the CSS2 descriptors, font must not map outside Unicode characters, must honor embedding properties.

The idea of the ePub package, if it is going to use embedded fonts, is that the fonts are in the ePub package itself. It is optional that a reader device can then choose to have the ability to use them or not.

Check it out here
You can see an example in the Hound of the Baskervilles downloadable from here (https://igpecms-distribution.s3.amazonaws.com/the_hound_of_the_baskervilles-AAH812.epub). Its on the title page and part separator page after the introduction. Crack it open and have a look. This will work in AZARDI, ADE and the 505. Just a simple decorative effect to set the tone of the book. (the font credit is on the copyright page).

Nervously critical...
I am unsure about the technique of putting the fonts in the ///data/ directory and referring from the ePub stylesheet statement. It's not wrong insofar as there is no prohibition to referencing a font outside the ePub package, but obviously this is then not an embedded font. This effectively hardcodes the font to a device and has the potential of not working in the future, or across new and emerging devices.

It should be as simple as this...
The following example is from a commercial ePub book and has two fonts and the fonts are in a directory in the opf directory fonts/ (it didn't have to be called fonts, but that is moderately sensible). Note that the path is relative from where the stylesheet is in the base book directory along with the pages, etc. We don't really need to worry about anything else:

@font-face {
font-family: "Futura";
font-style: normal;
font-weight: normal;
src:url(fonts/TT0202M_.TTF);
}
@font-face {
font-family: "PizzaDude Pointers";
font-style: normal;
font-weight: normal;
src:url(fonts/PIZZADUDEPOINTERS.ttf);
}
The other font rule that ADE ignores (therefore maybe the 505), unless it has changed, is that fonts must be registered in the OPF manifest. That should look something like:

<item id="font21" href="fonts/PIZZADUDEPOINTERS.ttf" media-type="application/x-font-truetype" />

One manifest statement for each font. Fonts are pretty special in any OS. They have to be running to be used. In a desktop system a reader can pick up fonts through the OS if available. ADE uses Adobe Flash and it starts up the fonts from the CSS statement, which is OK for it, but is only half the answer.

Problems in Reader implementation...
Our AZARDI reference reader is programmed in PyQT and WebKit. It will not find fonts and start them from the CSS statement without programmatic involvement. AZARDI looks in the manifest; If fonts are there, they are started for the reading session. We could program it to look for fonts in the CSS, but that is off-specification and we have the "nasty strict" reference ePub Reader.

In its present version Qt only supports TTF, so that is what we use. It doesn't currently support OTF, but if fallback fonts were used, the bases would be covered - all fallback fonts have to be in the manifest. (ADE/505 support OTF fine because they are clever font people).

Internally, when a book is loaded a Reader supporting fonts should do something like read the manifest specifically looking for fonts it understands. If it finds them it starts them up for the book Reading session, and they are automatically available for the CSS, just like Operating System fonts. When the book is closed so are the internal fonts.

This way reading devices don't have to interprete CSS to know if a font is available, or if they have to start-up a font; reading devices dont have to be loaded up with fonts; and ePubs with embedded fonts are portable across devices that support embedded fonts.

And the rules are....!
So in summary there are just two simple rules for embedding fonts:

1. The font must be in the manifest and the package
2. The CSS reference must point to the font location in the package.

The rest is up to the Reading device or application.

ePub is in early days of development, and with this font issue ADE has not helped by loading fonts from the CSS without being in the manifest. This will get worse as more titles try to utilize in-line and out-of-line XML Islands.

Beware the fonts...
And a final word of caution, there are fonts and fonts. Most fonts from a reputable foundary will work fine; older fonts and free fonts (like we use in our demo products) need to be tested. Suspect the font if some work and one doesn't. To know a font is being handled correctly by a device make sure it is NOT installed on the operating system of your work station.

Maybe that was a bit technical, hope it helps.

pepak
03-15-2009, 04:19 AM
I am using "generic" font-families everywhere:

code { font-family: monospace; }

Is it possible to instruct ADE that my custom font "Courier CE" should be used as a default monospace font?
Turns out the solution is extremely simple. All you need to do is to add the generic family to your @font-face:

@font-face { font-family: "Courier CE", monospace; font-weight: normal; font-style: normal; font-variant: all; src: url(res:///Data/fonts/cour.ttf); }


I still haven't solved the problem with font-variant: small-caps, though - font-variant: all should take care of that as per CSS3 specs, but it does not - Calibre complains that such a value is not allowed, but duly puts it in the EPUB, where it is then completely ignored by ADE (on Sony Reader).

kovidgoyal
03-15-2009, 12:35 PM
IIRC ADE only supports CSS2

Valloric
03-15-2009, 02:18 PM
IIRC ADE only supports CSS2

Which is the only thing it needs to support, since the OPS spec only supports CSS2 (and not even all of that).

FizzyWater
04-06-2009, 01:50 AM
So if I use the originally listed technique - save the fonts to my Reader and put them in the CSS - what happens if I give a copy of the eBook to a friend whose Reader doesn't have the fonts saved? Bricked Reader? Crash/reset? Defaults to system fonts?

I looked at the Hounds of the Baskerville file, and it did display in my Reader as intended (pretty cool, actually). But I could imagine this could lead to much larger files...and is there any issue with using system fonts from my computer on eBooks distributed to others?

zelda_pinwheel
04-06-2009, 08:42 AM
So if I use the originally listed technique - save the fonts to my Reader and put them in the CSS - what happens if I give a copy of the eBook to a friend whose Reader doesn't have the fonts saved? Bricked Reader? Crash/reset? Defaults to system fonts?

I looked at the Hounds of the Baskerville file, and it did display in my Reader as intended (pretty cool, actually). But I could imagine this could lead to much larger files...and is there any issue with using system fonts from my computer on eBooks distributed to others?

if the fonts specified in the css are not present on your liseuse, then logically it would default to the system fonts. i have not tried it, however i did try to use a second decorative font in one book ; the decorative font turned out not to work (i think it was just an incompatible font file ; not all fonts are created equal ;)), so the text was displayed in the regular font instead. i don't think it's possible to brick anything using css, and i'd be pretty surprised if it even caused a crash ; at the very worst you might have trouble reading the book or displaying it correctly, but i doubt even that would happen.

also, since you are not adding the fonts to every book, but only a few lines of code, it won't lead to much larger files ; that is actually one of the benefits of this method ; you just move the font files *once*, but you can use them on every book formatted to use them, whereas when you embed fonts you must embed all the fonts in each file, and that *does* lead to larger files.

as for the question of using system fonts from your computer for sharing books, don't forget that if the person you share with wants to use the same font, they must also have a sony 505 / 700, and they must install the fonts in the correct folder (otherwise, it will just use the default fonts). there are many fonts available which are free and can be distributed with no problem ; anyone using the same system as you (windows ?) would have access to the same ones.

alternatively, you can choose one of the many many quality free fonts available (many discussed here). some fonts are not free to be distributed (this is true of many commercial font foundries like adobe and linotype), but it's easy enough to find good free fonts that this shouldn't be a problem.

All4Fun
04-12-2009, 11:30 AM
Let me preface that I'm completely new to CSS but know enough to copy/paste and do basic editing of someone else's code. :) I have read this thread with great interest. Thank you for the contributions that have been provided.

I do have a question which I believe will be very easy for someone comfortable with CSS. How can I change the chapter headings so that they don't look like regular text and is larger? My guess is that it's a "heading" tag of some sort.

In brief, what would be the correct syntax to include a particular font family to "heading" text?

pepak
04-12-2009, 11:38 AM
It's not CSS you want to modify, but your HTML file. Instead of <p>CHAPTER 10</p>
<p>Blablabla...</p>
you want to use:
<h2>Chapter 10</h2>
<p>Blablabla...</p>
(The number in H2 can be anything from 1 to 6, 1 being the largest and most important.)
If you then want to enlarge the heading even more, you can use CSS:
h2 { font-size: 200%; }

zelda_pinwheel
04-12-2009, 11:39 AM
the correct html tag for headings are the h series tags ; so, the largest header (i use it for the title) would be <h1>title</h1>, next largest is h2, etc.

usually i use h3 for chapters but that's a question of choice. in the css code, you can modify the font used, whether it's bold or not, italic, etc.

edit : or see pepak's much better answer just before me. ;)

All4Fun
04-12-2009, 04:22 PM
Thank you pepak and zelda-pinwheel for your informative replies. I understand now.

atu1303
05-02-2009, 10:17 AM
Big thanks to zelda-pinwheel, i was able to read vietnamese on PRS 700 now

zelda_pinwheel
05-02-2009, 10:25 AM
Big thanks to zelda-pinwheel, i was able to read vietnamese on PRS 700 now

congratulations ! i'm glad you got it working. :)

All4Fun
05-09-2009, 02:23 PM
If I purchase an epub, say of LOTR, and I want to use custom fonts as described earlier, will I be affecting my original epub source when Calibre copies it to my device so that I can get the custom fonts?

netseeker
05-09-2009, 03:04 PM
If I purchase an epub, say of LOTR, and I want to use custom fonts as described earlier, will I be affecting my original epub source when Calibre copies it to my device so that I can get the custom fonts?
When you add the epub to Calibres library, then Calibre will create a copy and leave the original as it is.

gregcd
06-05-2009, 03:09 AM
Hi I've finally got this going :)
It looks awesome; variety of font makes a big difference.

I'm using droid serif (a google font)
http://damieng.com/blog/2007/11/14/droid-font-family-courtesy-of-google-ascender

Ankh
06-05-2009, 09:08 PM
I'm using droid serif (a google font)
http://damieng.com/blog/2007/11/14/droid-font-family-courtesy-of-google-ascender

Why, thank you very much for the pointer to these fonts. Finally a decent serif font for 505.

JSWolf
06-05-2009, 11:40 PM
Why, thank you very much for the pointer to these fonts. Finally a decent serif font for 505.
It does look pretty good on my 505 at the default base size used by Calibre's ePub conversion.

gregcd
06-07-2009, 05:02 AM
Glad other people like it.
This line will space out the text if it looks too dense:
p { line-height: 150%;}
Paste it at the end of the custom CSS in Calibre.

dpierron
06-08-2009, 09:31 AM
Just for the record, I'm using the PMN Caecilia font suggested by Valloric in his excellent guide (http://www.mobileread.com/forums/showthread.php?t=28447) (at 0.9em) and, from the extensive testing I've made (I tried out about 30 different fonts, both serif and sans-serif), it's the best...

Yes I know I'm biased, but who isn't ?

;-)

Cheers,
David.

gregcd
06-08-2009, 07:10 PM
Im getting all kinds of ideas like matching the actual book/magazine font to the ebook font..

Caecilia sounds nice but expensive (above $100?!)

Perpetua and book antiquita are nice for a change (most people have it already installed).

Maybe the process of typing up the CSS could be replaced by a calibre GUI?

JSWolf
06-08-2009, 08:08 PM
Glad other people like it.
This line will space out the text if it looks too dense:

Paste it at the end of the custom CSS in Calibre.
Actually, it depends if the paragraphs are using <p> or <div>. Best check the source and then fix the CSS after that.

Ankh
06-08-2009, 09:21 PM
Actually, it depends if the paragraphs are using <p> or <div>. Best check the source and then fix the CSS after that.

body {font-family: "Droid Serif"; line-height: 1.3 em;}

JSWolf
06-08-2009, 09:29 PM
body {font-family: "Droid Serif"; line-height: 1.3 em;}
Doesn't always work there.

dpierron
06-09-2009, 04:25 AM
Im getting all kinds of ideas like matching the actual book/magazine font to the ebook font..

Caecilia sounds nice but expensive (above $100?!)


True, it's quite expensive (not $100, 24) ; myself, I happened to have it already on an Adobe fonts CD...


Perpetua and book antiquita are nice for a change (most people have it already installed).

Maybe the process of typing up the CSS could be replaced by a calibre GUI?

If you input the needed CSS in the default conversion options (Set default for conversion / Look & Feel), then you won't need to type it more than once...

However, I happened to have books already in ePub format, which I didn't want Calibre to mess with (I didn't want to loose whatever special formatting the editor used) ; in this case there is no easy way but to edit the ePub file directly, inserting the code into a CSS file.

FWIW, here is the code I use (the font files are stored in a /fonts directory on my PRS-505) :


@font-face {font-family: "Caecilia";font-weight: normal;font-style: normal;src: url(res:///Data/fonts/CaeciliaLTStd-Roman.otf);}
@font-face {font-family: "Caecilia";font-weight: bold;font-style: normal;src: url(res:///Data/fonts/CaeciliaLTStd-Bold.otf);}
@font-face {font-family: "Caecilia";font-weight: bold;font-style: italic;src: url(res:///Data/fonts/CaeciliaLTStd-BoldItalic.otf);}
@font-face {font-family: "Caecilia";font-weight: normal;font-style: italic;src: url(res:///Data/fonts/CaeciliaLTStd-Italic.otf);}

body {
font-family: "Caecilia", serif;
font-size:0.9em;
}

nas_matko
06-15-2009, 06:37 AM
I tried above mentioned guide but I could't managed to get fonts right on Sony PRS-505.

I am able to get a different font up on the screen, but non english characters are still being encoded wrongly.

Is there anything I am missing?

zelda_pinwheel
06-15-2009, 06:39 AM
I tried above mentioned guide but I could't managed to get fonts right on Sony PRS-505.

I used ttf, could that be a problem?

not necessarily ; some ttf fonts should work. however it's true that not all fonts are created equal ;) so using a font which is not built properly might cause problems. maybe try it again using one of the fonts specifically mentioned in this thread which are sure to work.

also, don't forget that this method requires you to output epub format ; it won't work for lrf.

let us know how you get on.

Ankh
06-15-2009, 09:03 AM
not necessarily ; some ttf fonts should work.

Adobe ePub implementation on Sony works with OpenType (http://en.wikipedia.org/wiki/OpenType) fonts.

The extension "ttf" is misleading, as it is used for not only for "old" TrueType fonts, but also for for fonts in "new", OpenType format. All fonts that are distributed with extension "otf" should work on Sony.

zelda_pinwheel
06-15-2009, 09:04 AM
Adobe ePub implementation on Sony works with OpenType (http://en.wikipedia.org/wiki/OpenType) fonts.

The extension "ttf" is misleading, as it is used for not only for "old" TrueType fonts, but also for for fonts in "new", OpenType format. All fonts that are distributed with extension "otf" should work on Sony.
right, that is the technical explanation. ;) thanks.

JSWolf
06-15-2009, 09:15 AM
Yes, ADE on the 505 & 700 do with with both TrueType and OpenType fonts. I have used both and they work fine.

nas_matko
06-15-2009, 10:30 AM
I managed to get font on the screen, but encoding of noneglish charcter is still wrong.

I don't care as much about particular font, as long as encoding is correct.

Is there anything about encoding that needs to be set up?

JSWolf
06-15-2009, 10:31 AM
Is this ePub one that you can attach here for someone to have a look at?

nas_matko
06-15-2009, 11:23 AM
I think I have solved the problem. I saved TXT as UTF-8 (originally it was ANSI) and I set manually encoding as UTF-8 and now chaarcters are encoded properly.

However I have increased base font size to 22pt and now I am experiencing another problem - page count is e.g. 379 but I have to turn 3 or 4 pages before counter actually moves one page forward. Moreover page breakes are sometime in the middle of page. How to fix this?

JSWolf
06-15-2009, 09:40 PM
I think I have solved the problem. I saved TXT as UTF-8 (originally it was ANSI) and I set manually encoding as UTF-8 and now characters are encoded properly.

However I have increased base font size to 22pt and now I am experiencing another problem - page count is e.g. 379 but I have to turn 3 or 4 pages before counter actually moves one page forward. Moreover page breaks are sometime in the middle of page. How to fix this?
Page breaks are sometimes based on the amount of text between pages. So nothing is wrong with the page numbering. It's not the same as it is for LRF.

As for page breaks in the middle of the page, this is Mobile ADE and each flow has to be 300k or less. So if your document is one document without chapters or sections, you will end up with breaks in strange places.

leebok21
06-16-2009, 05:07 PM
Hello nas_matko,

How could you manage to convert ePub with UTF-8 encoding? I presume you have converted from a Japanese txt. Would you please give me recipe and font name please?


I think I have solved the problem. I saved TXT as UTF-8 (originally it was ANSI) and I set manually encoding as UTF-8 and now chaarcters are encoded properly.

However I have increased base font size to 22pt and now I am experiencing another problem - page count is e.g. 379 but I have to turn 3 or 4 pages before counter actually moves one page forward. Moreover page breakes are sometime in the middle of page. How to fix this?

JSWolf
06-16-2009, 09:48 PM
We are getting off topic. Can we please start another thread on encoding and converting since it doesn't have to do with fonts?

dpierron
06-17-2009, 05:25 AM
I agree that this is a bit off-topic.

To get back on (the topic) I found out that the Droid font family (used in the Google Android operating system) is now freely available (although quite a bit hard to find). It's a nice, very legible font, looks a bit like the lovely (but expensive) PMN Caecilia.

I prepared a tiny package that I share here with you, my fellow e-readers ; it contains the fonts that must be uploaded to the device (in a /fonts directory), and a droid.css file which content must be copy/pasted in Calibre settings (Set conversion defaults / Look and Feel / Override CSS).

Should anyone need help, please contact me...

Cheers,
David.

zelda_pinwheel
06-17-2009, 06:20 AM
thank you for that david ! i think you'll make a lot of people very happy. ;)

dpierron
06-17-2009, 11:11 AM
Ooops, looks like I posted too fast...

I made a crucial mistake when I copied the CSS code in the droid.css file : the line specifying the text justification is missing a trailing column ! As a result, the following lines are not even evaluated, and thus the droid font is never even used by ADE...

So, I thought that this package worked when it didn't : the font I saw was the default serif font of ADE.

I'll try and post an updated package ASAP, but for the moment I can't make it work and I think that maybe the font files are FUBAR (so much acronyms in so small a sentence, you're gonna think I'm military ;) )

Cheers,
David.

JSWolf
06-17-2009, 11:27 AM
I have the Droid fonts. If you need some help, let me know.

dpierron
06-17-2009, 11:36 AM
Yes, I'd like to try with your fonts files, please. My email is dpierron (at) gmail.com !

Whatever I do which works for the Caecilia font, stops working as soon as I try with my Droid TTF files. Thay are most probably in a form incompatible with the PRS-505, although they show up nicely on the computer screen...

dpierron
06-17-2009, 11:48 AM
Well, no need to worry, the font files worked after patching the CSS just a bit.

Here is the promised package, and I can guarantee that it works : I tried it myself...

30889

I think the Droid Serif font looks nice, but is a bit densely packed for my taste. I'll try and use the Droid Sans just in case it's more spaced. In the meantime, I'll stick to Caecilia.

Cheers, and thanks for the help !
David.

JSWolf
06-17-2009, 11:50 AM
Well, no need to worry, the font files worked after patching the CSS just a bit.

Here is the promised package, and I can guarantee that it works : I tried it myself...

30889

I think the Droid Serif font looks nice, but is a bit densely packed for my taste. I'll try and use the Droid Sans just in case it's more spaced. In the meantime, I'll stick to Caecilia.

Cheers, and thanks for the help !
David.
You can use the line height CSS command to space the lines better. I'm using 115% for when I do use Droid Serif.

dpierron
06-17-2009, 11:53 AM
That's a good idea, although I was talking about the horizontal spacing of the letters (isn't it called kerning?). AFAIK, there is no way (in CSS) to change this spacing, is it ?

netseeker
06-17-2009, 12:10 PM
That's a good idea, although I was talking about the horizontal spacing of the letters (isn't it called kerning?). AFAIK, there is no way (in CSS) to change this spacing, is it ?
Basically there exists such a way via the CSS attribute "letter-spacing":letter-spacing:0.3em

Unfortunately ADE doesn't support it. :angry:

Update: Hm, seems as it isn't ADEs fault. letter-spacing is just not in the supported CSS subset according to the OPS specification.

gregcd
06-22-2009, 07:40 PM
Custom fonts work nicely with fetched news from calibre, but interestingly not with reconverted epubs from feedbooks.com - "invalid page" is displayed on the sony.

There's probably some way of putting the CSS in the calibre recipie; I've just been reconverting the fetched epub until I figure that out.

For people having trouble with getting custom fonts working at all, I've had some success pasting the book in to: http://tinymce.moxiecode.com/examples/full.php then copying it to word and saving as RTF. Also if the conversions were slow, doing this speeds them up. You'll loose links but keep your formatting.

Dahak
06-24-2009, 12:05 AM
I think the Droid Serif font looks nice, but is a bit densely packed for my taste. I'll try and use the Droid Sans just in case it's more spaced. In the meantime, I'll stick to Caecilia.

Cheers, and thanks for the help !
David.

Thanks for the file.

I have been having zero luck getting fonts to work with the LRF conversion in Calibre.

I based my own font selections (Trebucet, of all things) on your Droid file.

The font selection seems to be working in the ePub conversion on my squeaky-new 505, but I do wonder about those little page numbers I'm seeing on the conversions. Can they be suppressed in the conversion process?

Also, my source files started out life as HTML with JUSTIFIED DIVs. The ePub is displaying ragged-right, regardless if I keep the TEXT-ALIGN attribute in the override CSS.

Any thoughts on that?

Anyone?

(If this is something obvious, write it off to a 505 Noob. :D )

Thanks.

-Joe

netseeker
06-24-2009, 01:51 AM
The font selection seems to be working in the ePub conversion on my squeaky-new 505, but I do wonder about those little page numbers I'm seeing on the conversions. Can they be suppressed in the conversion process?
No, you can't suppress those page numbers. They are shown automatically by the mobile edition of Adobe Digital Editions on the PRS-505.

Also, my source files started out life as HTML with JUSTIFIED DIVs. The ePub is displaying ragged-right, regardless if I keep the TEXT-ALIGN attribute in the override CSS.
The ADE version used on the PRS-505 doesn't support full justification. Newer versions would be able to do that but Sony hasn't published a firmware update yet.

Dahak
06-24-2009, 09:22 AM
No, you can't suppress those page numbers. They are shown automatically by the mobile edition of Adobe Digital Editions on the PRS-505.

Hmm... that's a decidedly odd feature to have. Especially when it isn't switchable.

The ADE version used on the PRS-505 doesn't support full justification. Newer versions would be able to do that but Sony hasn't published a firmware update yet.

If I'm reading the device properly, my firmware is 1.1.01.25200.


So... the ePub-formatted files are using a separate rendering engine?

Crud... after getting the fonts to actually work, too. I am experiencing an Epic Fail in getting fonts recognized with LRF.


I guess I'll go back to trying to get the fonts to work in the LRF files.

Thanks for the quick reply.

-Joe

netseeker
06-24-2009, 09:57 AM
Hmm... that's a decidedly odd feature to have. Especially when it isn't switchable.
Oh yes! Hopefully Sony will publish a firmware update soon.

So... the ePub-formatted files are using a separate rendering engine?
Yes. LRF, ePub, PDF and Txt/RTF are using different rendering engines on the Sony.

Thanks for the quick reply.
You are welcome. :)

Valloric
06-24-2009, 02:53 PM
Hmm... that's a decidedly odd feature to have. Especially when it isn't switchable.

It is, isn't it? It really, really, REALLY is.

JSWolf
06-24-2009, 03:40 PM
I guess I'll go back to trying to get the fonts to work in the LRF files.
To be honest, font embedding with LRF is not all that wonderful. It's very very slow and doesn't work all that well. ePub works well and is very easy to embed fonts.

pepak
06-25-2009, 12:29 AM
To be honest, font embedding with LRF is not all that wonderful. It's very very slow and doesn't work all that well.
On the other hand, you can update the default fonts used for LRF rendering. That updates all books at a time, without having to actually modify any of them, and the rendering speed is excellent.

Dahak
06-25-2009, 09:55 AM
To be honest, font embedding with LRF is not all that wonderful. It's very very slow and doesn't work all that well. ePub works well and is very easy to embed fonts.

I'd rather not embed the fonts, given what it'd do for file sizes.

I may be conflating work between LRF and ePub formatting, but I had the impression that a font could be referenced in an LRF the same way as in ePub (i.e. font file loaded on the reader once in a fonts folder and referenced through CSS overriding) using Calibre.

That was what I was originally trying to do before I tried the ePub route.

My issue with ePub is the lack of fully-justified paragraphs.

That's a deal-breaker in my book (so to speak:))

-JPB

Dahak
06-25-2009, 09:56 AM
On the other hand, you can update the default fonts used for LRF rendering. That updates all books at a time, without having to actually modify any of them, and the rendering speed is excellent.

That would probably be something to consider... I hadn't planned on doing a global change like that, though.


It may be an avenue of last resort, though.

-JPB

JSWolf
06-25-2009, 11:23 AM
But, if you do change the default LRF fonts, you will need to remove every LRF eBook off of the reader and put them back on using either eBook Library or Calibre. And if you do choose to use eBook Library, you'll need to change the fonts in the fonts directory of eBook Library to the fonts you changed on the Reader so it'll know how to paginate.

JSWolf
06-25-2009, 11:27 AM
I'd rather not embed the fonts, given what it'd do for file sizes.

I may be conflating work between LRF and ePub formatting, but I had the impression that a font could be referenced in an LRF the same way as in ePub (i.e. font file loaded on the reader once in a fonts folder and referenced through CSS overriding) using Calibre.

That was what I was originally trying to do before I tried the ePub route.

My issue with ePub is the lack of fully-justified paragraphs.

That's a deal-breaker in my book (so to speak:))

-JPB
I do not know if you can reference external fonts in LRF. But embedded fonts in LRF tend to be slow (on a 505).

With ePub, you can use external fonts loaded on the Reader via the CSS and they work fine and are not slow at all.

pepak
06-25-2009, 12:33 PM
But, if you do change the default LRF fonts, you will need to remove every LRF eBook off of the reader and put them back on using either eBook Library or Calibre.
You can also delete the cache.xml/media.xml file by hand and let the Reader regenerate it.

Dahak
06-25-2009, 04:07 PM
But, if you do change the default LRF fonts, you will need to remove every LRF eBook off of the reader and put them back on using either eBook Library or Calibre. And if you do choose to use eBook Library, you'll need to change the fonts in the fonts directory of eBook Library to the fonts you changed on the Reader so it'll know how to paginate.

Yep, I'd already picked up on that detail from my other browsing.

That's part of why I don't want to bother with changing the reader's global default font.


Thanks for the reminder. It never hurts to be sure someone knows all the sordid little details, especially a 505-newbie like me.


-JPB

Ankh
06-25-2009, 05:26 PM
I'd rather not embed the fonts, given what it'd do for file sizes.

And why are you concerned about the file size, if I may ask? SD sticks are dirt cheap these days...

Dahak
06-26-2009, 12:11 AM
And why are you concerned about the file size, if I may ask? SD sticks are dirt cheap these days...

Storing the same font on my reader 50 or 100 times offends every programmers' bone in my body.

-JPB

Ankh
06-26-2009, 01:54 AM
Storing the same font on my reader 50 or 100 times offends every programmers' bone in my body.

-JPB

:)

With the price of hardware these days, maybe it is time to re-evaluate static linking. Ugly as hell, but bulletproof solution for packaging self-contained binaries.

Back to the size of flash on our readers, I immediately bought SD card to go with my 505. A few weeks later, the conclusion was that the number of books is bigger concern than their size. At least it is for me, with the current software.

Bookshelf/library implementation is decent, but lack of hierarchical (folder) structure makes it cumbersome to list, sort and search more than 50 or so books on the device. Now my SD card acts as backup device for the books that I already read, and stays away from the slot (faster start). Internal memory, even with "fat" ePubs holds sufficient amount of reading material to keep me busy for a long time.

Dahak
06-26-2009, 10:14 AM
:)With the price of hardware these days, maybe it is time to re-evaluate static linking. Ugly as hell, but bulletproof solution for packaging self-contained binaries.

Back to the size of flash on our readers, I immediately bought SD card to go with my 505. A few weeks later, the conclusion was that the number of books is bigger concern than their size. At least it is for me, with the current software.

While I didn't start programming at the very start of the 'home computer era,' I did start moderately early.

I remember writing self-modifying code to save a few bytes that I could then allocate to needed working buffers within limited - and fixed - memory constraints.

The current attitude (which has been around for well over a decade) of 'memory is cheap' strikes me as slightly offensive and more specifically as lazy.

Yes. You can just go out and buy a bigger flash card, but that doesn't mean that you should.

-JPB

JSWolf
06-26-2009, 07:48 PM
Storing the same font on my reader 50 or 100 times offends every programmers' bone in my body.

-JPB
But if you use ePub, you can store the fonts once and just access them with every ePub you create.

Dahak
06-26-2009, 08:24 PM
But if you use ePub, you can store the fonts once and just access them with every ePub you create.

Yes, you are correct.

And when a firmware update allows ePub to support full justification (and to suppress those page numbers), I may just do that.

-JPB

gregcd
06-27-2009, 02:57 AM
Hi i've started a wiki page on fonts confirmed working with EPUB Embedded Fonts on Sony Devices: http://wiki.mobileread.com/wiki/Sony/EPUB_Embedded_Fonts

It can save a bit of trial and error :)

Feel free to update it.

JSWolf
06-27-2009, 08:28 AM
Hi i've started a wiki page on fonts confirmed working with EPUB Embedded Fonts on Sony Devices: http://wiki.mobileread.com/wiki/Sony/EPUB_Embedded_Fonts

It can save a bit of trial and error :)

Feel free to update it.
Can you also provide links to these fonts please? I would like to try out the ones said not to work. But I want to make sure I have the correct versions. Thanks.

When you say that a font does not work, do you mean embedded directly into the ePub file or loaded onto the Reader?

I just added Fontin and Fontin Sans to the list of working fonts with links.

yekim54
06-27-2009, 02:23 PM
Hi i've started a wiki page on fonts confirmed working with EPUB Embedded Fonts on Sony Devices: http://wiki.mobileread.com/wiki/Sony/EPUB_Embedded_Fonts
Thanks gregcd. I am about to begin experimenting with embedding fonts into ePub, so this should come in handy.

gregcd
06-29-2009, 07:03 PM
Wiki updated.

http://wiki.mobileread.com/wiki/Sony/EPUB_Embedded_Fonts

ht1948
06-30-2009, 01:21 AM
Guys, can you tell me what I'm doing wrong? My 505 doesn't display the embedded font at all. I used Fontin in this case. I copied and pasted zelda_pinwheel's code into the CCS box. I put the Fontin font files in the "fonts" folder on my reader. I used calibre to convert my ebook to epub (I'm using the beta 0.6 btw) After 3 hours of trying, nothing worked for me. Pls advise. Thanks.

dpierron
06-30-2009, 06:12 AM
I made a collection of font test ebook files.

Hopefully, this will help you and other fellow e-readers to test which font they like more, and eventually use it in their own ePub ebooks.

Here it is : 31402

There are two ways of using it, with a major exception : PMN Caecilia is not a free font, and thus is not included in this collection. The files I made that reference it are included, in order to help people who have actually bought the font.

The book used to test the different fonts is a free book by Jeffrey A. Carver, titled Battlestar Galactica. I use this opportunity to both thank Jeffrey for his great books (most of which he gives for free) and to make a bit of advertisement for his site : http://www.starrigger.net/

Anyway, here are the explanations :

1. First way: embedded fonts
In each of the font directories (except PMN Caecilia for the reason I already explained above), you'll find a subfolder named "embedded". The file stored here is autonomous, and contains the font it means to test.
One cannot make this easier...

2. Second way: copying the font files
You need to create a /fonts folder in the root of your Sony Reader device file system.
In each if the font directories (except PMN Caecilia for the reason I already explained above), you'll find a subfolder named "fonts". Copy the files found here into your new /fonts folder.
The .epub files found in each of the font directories reference the fonts in the /fonts folder.

[edit: corrected the spelling of the fonts folder]

And a final note : the content of the .css files can be used to configure Calibre (in the conversion configuration dialog) or manually edit the .css files in other .epub ebooks...

[edit: I added screenshots !]

Default font
31477
PMN Caecilia
31474
Droid
31473
Fontin
31475
Fontin Sans
31476
Liberation Sans
31472



I hope that my work will help you, please contact me if you need more help...

David.

JSWolf
06-30-2009, 11:53 AM
Guys, can you tell me what I'm doing wrong? My 505 doesn't display the embedded font at all. I used Fontin in this case. I copied and pasted zelda_pinwheel's code into the CCS box. I put the Fontin font files in the "fonts" folder on my reader. I used calibre to convert my ebook to epub (I'm using the beta 0.6 btw) After 3 hours of trying, nothing worked for me. Pls advise. Thanks.
He code will not always work. You have to dig into the ePub and see where in the CSS you'll need to put the font-family CSS style. To figure this out, look at some of the chapters of the book and you'll see what styles are used. Not all work with just the font-family in the body CSS style.

gregcd
06-30-2009, 05:27 PM
I bet this would work with your book, its a bit easier than the above also:

For people having trouble with getting custom fonts working at all, I've had some success pasting the book in to: http://tinymce.moxiecode.com/examples/full.php then copying it to word and saving as RTF. You'll loose hyperlinks but keep your formatting.

also remember the capitalisation of the "fonts" folder - this is not the same as "Fonts" in the CSS.

AiBo
07-10-2009, 01:46 AM
In my case I am trying to read a PDF that has Chinese. The PDF was created not by me, but a third-party. How do I add the fonts in order to read this PDF?

dpierron
07-10-2009, 03:39 AM
I'm not a PDF guru, but I'm pretty sure that this format is font-independent... in extenso, you don't need the original font files to read a PDF file, because it contains the raster pre-rendered (is is Postscript?) as well as the text...

Cheers,
David.

JSWolf
07-10-2009, 08:54 AM
This is a thread about ePub. PDF font embedding is off topic. Thanks.

Abecedary
07-10-2009, 11:55 AM
Just a suggestion for the 'which fonts work' wiki -- maybe turn it into a table that includes OTF and TTF checkbox columns. Since commercial fonts (of which a few seem to be listed) generally can come in both different flavors, it wouldn't be a bad idea to distinguish between the two. If someone likes the looks of a certain typeface, they can be sure they're getting the version that is known to work properly.

As for the OT PDF dicussion, most PDFs contain embedded fonts (or subsets of the used glyphs) and render using those--no rasterization involved (well, not until display time at least). The Chinese PDF probably doesn't have the font embedded. Cmd/Ctrl-D in Acrobat will give you a list of what fonts are referenced in it and whether they're embedded or not. If you have questions, you can PM me. I'll try to help if I can.

gregcd
07-21-2009, 09:59 PM
Other candidate fonts for epubs: times new roman, constantina and cambria (last two are in office 07/ vista). These should look quite nice.

Also this free one: Linux Libertine
http://www.fontsquirrel.com/fonts/Linux-Libertine

radius
07-29-2009, 10:21 AM
Other candidate fonts for epubs: times new roman, constantina and cambria (last two are in office 07/ vista). These should look quite nice.

I like the look of Cambria, but can you actually use it in an ePub on the Sony Reader? I've never been able to make that particular font work...

dpierron
07-29-2009, 11:15 AM
I tried to make a version of my font-tester eBook with the embedded Cambria font, but when I did this I noticed that the version of Cambria that I had (it came with Powerpoint viewer) only sports a cambria.ttc file (not .ttf).
Maybe that's why it didn't work ? Because it didn't :(
Has anyone got a TTF or OTF version of Cambria so I can try ?

JSWolf
07-29-2009, 12:09 PM
I do have Cambria in .ttf. It came from MS with maybe the Office 2007 viewer. Not 100% sure.

dpierron
07-29-2009, 12:30 PM
In fact the .ttc file is a "true type font collection" ; it can be broken up using breakttc (http://cg.scs.carleton.ca/~luc/ttsoftware.html), and using this I generated a valid .ttf file.

The attached font-text ebook show up the Cambria font, and I'm pretty sure it works : I uploaded it to my 505, and judging by the 'y' and 'j' letter shapes I think it shows up the proper font.

Hope this helps,
David.

JSWolf
07-29-2009, 01:34 PM
The italics look like the normal font slanted.

Abecedary
07-29-2009, 01:55 PM
JSWolf is right--the italics aren't coming through. When I unzipped the package, all the fonts but the main one were named in all caps. So it's probably a case-sensitivity issue. Either rename the font files to use the same cases as referenced in the stylesheet, or change the cases of the font files referenced in the stylesheet.

It's harder to tell if it's actually using the bold font or just fattening up the roman. I suspect the latter.

JSWolf
07-29-2009, 02:28 PM
I have fixed it to use the correct fonts. Also, I have removed the font size declaration which made the text too small. So this is now correct.

After seeing this, I have decided that Cambria is not a good for for a book.

gregcd
07-30-2009, 09:36 PM
Linux Libertine works well and looks good on the sony. Its a very professional font.

http://www.fontsquirrel.com/fonts/Linux-Libertine

Are you sure you want to post a copyright book here JSWolf?

Another cool epub feature: if the font size is set to be read in "medium zoom" on the sony in portrait, the font appears at exactly the same size at "small zoom" in landscape mode.

Reflow FTW!

(btw this is not the case with LRF files)

JSWolf
07-30-2009, 10:00 PM
Can you take a screen show using Linux Libertine please? Thanks.

I'll get a screen shot of Fontin for those that have not yet seen it.

gregcd
07-30-2009, 11:19 PM
My camera does have a macro mode, but thinking about it i reckon putting my reader on a flatbed scanner will have a better result!

Ill try it out

dpierron
07-31-2009, 05:42 AM
For the record, Battlestar Galactica is a (great) book by MobileRead's own Jeffrey A. Carver, which is available on his site, for free.

I'm pretty sure he will not mind me using his work for font testing, but just in case : Jeffrey if you're reading this and it bothers you, can you please jump in ?

In the meanwhile, here is a perfectly random book sporting the Liux Libertine font : 33331

Hope this helps,
David.

JSWolf
07-31-2009, 07:19 AM
My camera does have a macro mode, but thinking about it i reckon putting my reader on a flatbed scanner will have a better result!

Ill try it out
That is an interesting idea. I'll give it a go here and see how it scans. If it does not work well, then I'll just get out the camera.

JSWolf
07-31-2009, 07:23 AM
For the record, Battlestar Galactica is a (great) book by MobileRead's own Jeffrey A. Carver, which is available on his site, for free.

I'm pretty sure he will not mind me using his work for font testing, but just in case : Jeffrey if you're reading this and it bothers you, can you please jump in ?

In the meanwhile, here is a perfectly random book sporting the Liux Libertine font : 33331

Hope this helps,
David.
Is there a test book that uses italics?

dpierron
08-02-2009, 06:27 AM
Here you are : corrected font tester manually edited to include italic, bold, bold-italic, and small caps...

Hope this helps,
David.

gregcd
08-03-2009, 03:42 AM
First scan is in of linux libertine:

The grey spidery mark near the middle top of the screen is permanent damage from where the slider from my jacket zip hit the screen :(

Also note the next page decal has been rubbed off! Its from about 7 months use.

Its 9pt at medium zoom.

JSWolf
08-03-2009, 03:48 AM
First scan is in of linux libertine:

The grey spidery mark near the middle top of the screen is permanent damage from where the slider from my jacket zip hit the screen :(

Also note the next page decal has been rubbed off! Its from about 7 months use.

Its 9pt at medium zoom.
That is a lot better looking scan then I expected. Linux Libertine looks better then I thought it would.

gregcd
08-03-2009, 08:56 PM
Gentium book basic

I use this font often.

Abecedary
08-03-2009, 09:41 PM
Gentium book basic

I use this font often.

Yeeps! Straight quotes are tools of the devil!

gregcd
08-03-2009, 10:06 PM
Lol yes that is The Guardian (UK) for you.

Would be nice if ADE defaulted to hyperlinks in black instead of grey.

dpierron
08-04-2009, 04:37 AM
This font looks nice and wide, I like this ; it reminds me of Caecilia, although it is simpler (simplier?)

Thanks for the tip !

JSWolf
08-04-2009, 10:30 AM
Gentium book basic

I use this font often.
That does look good.

gregcd
08-05-2009, 08:10 PM
I'm pleased to announce i got grandesign neue serif working last night.
It seems the sony cant handle either long font filenames, or filenames with spaces in them. All that is required is renaming the font to a short simple name.

Grandesign neue serif is a slab serif font, similar in some ways to the commercial font caecilia.

see screenshot

dpierron
08-06-2009, 04:20 AM
It look really great, that's (IMHO) the best looking font since Caecilia.
Great find, gregcd !

JSWolf
08-06-2009, 05:57 AM
I'm pleased to announce i got grandesign neue serif working last night.
It seems the sony cant handle either long font filenames, or filenames with spaces in them. All that is required is renaming the font to a short simple name.

Grandesign neue serif is a slab serif font, similar in some ways to the commercial font caecilia.

see screenshot
Nice font. Too wide margins.

dpierron
08-06-2009, 06:01 AM
Actually, a kinda-wide left margin is useful when reading at night with the Sony cover-with-light ; the plastic block they use for lighting the screen generates a shadow that is more or less 15 pixels wide, at the left of the screen...
And a right margin is useful because of ADE's page numbers...
Anyway, this is a matter of personal preferences, but I format my ebooks almost like this.

JSWolf
08-06-2009, 06:09 AM
Actually, a kinda-wide left margin is useful when reading at night with the Sony cover-with-light ; the plastic block they use for lighting the screen generates a shadow that is more or less 15 pixels wide, at the left of the screen...
And a right margin is useful because of ADE's page numbers...
Anyway, this is a matter of personal preferences, but I format my ebooks almost like this.
I find the page number on the right to be a non-issue. I can easily read the word that the page number is on. Plus, I do not mind an occasional shadow on the left (depending on the light source). Also, I like to have as much text on screen as possible.

slantybard
08-08-2009, 11:50 PM
I am currently using the following:

Caecilia Bold = Standard
Caecilia Heavy = Bold
Caecilia Bold Italic = Italic
Caecilia Heavy Italic = Bold Italic

This makes a very readable font for the small zoom on standard calibre conversion and also makes for excellent reading in lower light conditions with the sony reader light.

@font-face {
font-family: "Caecilia";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/CaeciliaLTStd-Bold.otf);
}

@font-face {
font-family: "Caecilia";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/CaeciliaLTStd-Heavy.otf);
}

@font-face {
font-family: "Caecilia";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/CaeciliaLTStd-BoldItalic.otf);
}

@font-face {
font-family: "Caecilia";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/CaeciliaLTStd-HeavyItalic.otf);
}

p {
margin-top: 0pt; margin-bottom:0pt;padding:0pt; text-indent:20pt
}

body {
font-family: "Caecilia", serif;
}

slantybard
08-09-2009, 04:12 PM
Sorry, forgot to add a screenshot.

JSWolf
08-11-2009, 10:07 AM
Looks good. But I do think the indent is a bit large. With ePub, I use an indent of 1.1em.

gregcd
08-13-2009, 12:01 AM
Ive loaded caecilia on to my sony at last; it looks great.
I was surprised to find it was released way back in 1992. Some things age well.

This is the standard version.

radius
08-14-2009, 10:08 AM
Hmmm... In previous surveys here at Mobileread, most respondents indicated that they are generally satisfied with the second generation e-ink screens and almost nobody felt they needed higher resolution.

However, the majority of font sample screenshots from this thread show that people like robust letterforms with uniform stroke width and slab serifs (and possibly large font sizes, its unclear if people are showing their normal reading size or are showing larger sizes for easier comparison on-line).

I bet this means that the pixel density and the contrast of the screen aren't yet high enough to be very satisfactory at all or else we could choose more delicate fonts.

slantybard
08-14-2009, 10:19 AM
It depends on what zoom size combined with which baseline font size chosen in the source material. For example, in my setting I use a base font size of 11 or 12 but read it using the smallest zoom size on my reader. I also read in conditions I could never read a paperback book in - lower light stuff. When using a diffuse light like the sony glass shield led light, you need a crisper bolder font for your eyes, thus, I use the bold caecilia. If I used the medium zoom, then I wouldn't change from a standard font since it looks beautiful. I just like to not change pages as much as I would reading a PB or HC.

Abecedary
08-14-2009, 10:49 AM
Hmmm... In previous surveys here at Mobileread, most respondents indicated that they are generally satisfied with the second generation e-ink screens and almost nobody felt they needed higher resolution.

However, the majority of font sample screenshots from this thread show that people like robust letterforms with uniform stroke width and slab serifs (and possibly large font sizes, its unclear if people are showing their normal reading size or are showing larger sizes for easier comparison on-line).

I bet this means that the pixel density and the contrast of the screen aren't yet high enough to be very satisfactory at all or else we could choose more delicate fonts.

Oh, I absolutely agree that the pixel density limits the choices of fonts that look good on e-ink screens. I've gone through about twenty fonts that look great in print, but only a handful work okay on my 505's screen. And it's almost entirely due to the amount of modulation in stroke width (I can't even imagine what a Bodoni would look like on here, nor will I even waste the time attempting it).

I also think it's interesting to see the number of people that seem to love Caecilia for a body font (no doubt due to Amazon's choice of it for the Kindle). Don't get me wrong, it's a nice typeface, but book bodies are not a place I would tend to use it. I think it's more suited towards magazine articles and other shorter form texts. OTOH, Amazon chose it because it is a fairly neutral typeface (tending towards cold, IMHO) that has very little stroke modulation, so it does render pretty well at multiple sizes on low pixel-density e-ink screens.

Ea
08-19-2009, 02:53 AM
...
However, the majority of font sample screenshots from this thread show that people like robust letterforms with uniform stroke width and slab serifs (and possibly large font sizes, its unclear if people are showing their normal reading size or are showing larger sizes for easier comparison on-line).

I bet this means that the pixel density and the contrast of the screen aren't yet high enough to be very satisfactory at all or else we could choose more delicate fonts.
I don't think we disagree on this, but I have found that a base size 13 in Georgia works really well for me - and I'm not sure that it's because of lower quality/resolution. I noticed that when reading paperbacks with small print, I'd sit and hold the book closer to my eyes. With the ebook reader, I can hold it in my lap as well, and not feel like I'm squinting slightly. And yes, I did have my eyes tested (thought I needed new glasses), but apparently I have the correct prescription. Even with higher contrast and resolution, I doubt I'd like to go lower than font size 12.

...
I also think it's interesting to see the number of people that seem to love Caecilia for a body font (no doubt due to Amazon's choice of it for the Kindle). Don't get me wrong, it's a nice typeface, but book bodies are not a place I would tend to use it. I think it's more suited towards magazine articles and other shorter form texts....
I find Caecilia a bit 'cold' and 'hard' looking as well. It might be nicer for contrast, but it doesn't feel right.

hari
08-25-2009, 06:51 PM
I have created an e pub that uses font's that I have locally installed on the PRS 505 in fonts folder. My epub file has sanskirt text in it and works fine calling my fonts from the font folder. However I was experimenting with embedding the fonts in the epub file, and even when I got it to load properly in Azardi it wouldn't work on Adobe Digital Editions, and also wouldn't work on my 505. Am I to conclude that ADE and the 505 can't use embedded fonts? My method of coding was to use classes and style the classes in my CSS file. I have seen an e pub that worked with ADE that set the fon't in the p tag and that worked. Anyways was just wondering if I am doing something wrong, or if ADE and the 505 don't really support embedded fonts?

Abecedary
08-25-2009, 07:43 PM
Embedded fonts work fine in both ADE and the 505. In your stylesheet be sure you reference your fonts by their relative path to the stylesheet. For instance, if I have my stylesheet in my OEBPS directory, and my fonts in OEBPS/fonts, the @font-face src line would be 'src: url(fonts/fontname.otf);'

hari
08-28-2009, 06:35 PM
Embedded fonts work fine in both ADE and the 505. In your stylesheet be sure you reference your fonts by their relative path to the stylesheet. For instance, if I have my stylesheet in my OEBPS directory, and my fonts in OEBPS/fonts, the @font-face src line would be 'src: url(fonts/fontname.otf);'

Thank you Abecedary, I will try that.

Hari

rasbadar
09-16-2009, 11:26 AM
Hello fellers,

does this operation of creating a /font folder in the 505 in any way change the behaviour of the "normal" default fonts for LRFs? Because I have (thanks to the Valorians VERY useful manual) changed my default font to Caecilia (niiiice) and don't want to mess with this...

regards!

ras

Abecedary
09-16-2009, 11:37 AM
Hello fellers,

does this operation of creating a /font folder in the 505 in any way change the behaviour of the "normal" default fonts for LRFs? Because I have (thanks to the Valorians VERY useful manual) changed my default font to Caecilia (niiiice) and don't want to mess with this...

regards!

ras

Nope, the fonts in the /fonts folder are only used when explicitly called by a stylesheet or html page. Otherwise, they don't even get touched.

rasbadar
09-18-2009, 04:48 AM
Nope, the fonts in the /fonts folder are only used when explicitly called by a stylesheet or html page. Otherwise, they don't even get touched.

Thank you!

wallcraft
09-22-2009, 02:29 PM
Where does the /Data in: src: url(res:///Data/fonts/texgyrecursor-bold.otf); come from? Is /Data the standard filename for the root of the user-accessible internal storage, or is this a softlink from an Adobe-specific location in the system filespace?

I ask because this would also be useful on other devices, but they may need to use a location other than /Data and perhaps an update by the vendor (or a hacker). See Can the Opus use fonts in ADE/ePub like the 300/505/600/700? (http://www.mobileread.com/forums/showthread.php?t=57121).

kovidgoyal
09-22-2009, 02:33 PM
/Data is the root of the user accessible file system

orion2001
09-29-2009, 09:43 PM
Thanks for a great thread and also all the folks who posted screenshots of the fonts on their Sony readers. Surprisingly (and I might be in the minority), I actually seem to prefer Sony's default Serif font over most of the popular ones. Caecilia while nice and readable seems way to 'wide' and a bit cartoony for my taste. I can see these fonts being a bit easier to read but I prefer the font to look more like the serif fonts you find in novels. I did like the linux-libertine font though.

Loose_Appeal
10-01-2009, 05:25 AM
Can sum1 change the topic title to include the PRS 300? Because it works for it too! And it's NICE!

orion2001
10-01-2009, 10:27 PM
Ok, I have made a complete change in my position on the default Sony font! Turns out the LRF file I had been reading had an embedded font and wasn't actually the default font. I tried an EPUB with no embedded fonts and disliked the default font quite a bit. It does display very nicely and darkly on the e-ink display but it is harder on the eyes and everything looks too "vertical" and parallel and closely spaced.

I tried Caecilia and I do like it in terms of readability but it still doesn't feel like a book worthy font ( a bit too cartoony). One font I really like is Berling Antiqua (it is the default font for MS Reader) although at smaller sizes it isn't as dark as the default font due to the thinner type.

gregcd
10-01-2009, 11:45 PM
Just for comparison, here is a screenshot of on LRF file using a reader that has been flashed with caecilia.

I've got over the quirks of LRF and enjoy the justification of text and speed that epub lacks on the 505.

Theres no ragged right here :)

orion2001
10-02-2009, 12:26 AM
Well, I decided to upload a pic of Berling Antiqua. I don't know how you guys are getting such crisp images with a scanner. The screen is a bit out of focus on mine as it is further away from the plate.

gregcd
10-04-2009, 08:04 PM
I get the same fuzzy screen scan on my home scanner. I use the big photocopier (can do A3 paper) at work to scan; it must have better optics.

orion2001
10-04-2009, 08:18 PM
Ah, thats good to know. I'll give it a shot at work then.

JSWolf
10-05-2009, 09:03 PM
One thing I can get from using ePub is that I can get true italics, true bold, true bold/italics, true smallcaps. From LRF, everything but the normal font is simulated. Oh and age turns with embedded fonts in ePub as a lot faster then with LRF.

Jellby
10-06-2009, 04:58 AM
Oh and age turns with embedded fonts in ePub as a lot faster then with LRF.

I'm not sure that's a good thing :D

JohnnyD
10-06-2009, 06:38 AM
/Data is the root of the user accessible file system

is this true for a BeBook (running standard firmware) as well? Or only for a Sony reader?

JSWolf
10-06-2009, 09:05 AM
is this true for a BeBook (running standard firmware) as well? Or only for a Sony reader?
The only way to find out is to try it.

JSWolf
10-06-2009, 09:06 AM
I'm not sure that's a good thing :D
Why would it not be a good thing?

wallcraft
10-06-2009, 09:16 AM
is this true for a BeBook (running standard firmware) as well? Or only for a Sony reader? This is only for the Sony Readers. I tried on my EZ Reader (Hanlin V3) and it does not accept fonts in /Data or /home. I think others have tried on the Cybook Opus without success.

Jellby
10-06-2009, 10:43 AM
Why would it not be a good thing?

You wrote "age" instead of "page", I was joking on that ;)

JohnnyD
10-09-2009, 07:56 AM
This is only for the Sony Readers. I tried on my EZ Reader (Hanlin V3) and it does not accept fonts in /Data or /home. I think others have tried on the Cybook Opus without success.

Mm, I'm browsing through the sources of the BeBook firmware, there's a tool called 'Fb2Linux', with a source file called 'fb2v.cpp'. In this source file something like

fontDir << "/fonts"

and

// init bitmap font manager
InitFontManager( fontDir );

occurs; could it be that the system font directory is simply called '/font'?

I'm going to try it out, but I'm afraid it has to wait until tonight :rolleyes:

(rats! To quick! The entire code block reads:

printf("home dir: %s\n", exedir);

lString8 fontDir(exedir);
fontDir << "/fonts";

meaning '/fonts' is a subdirectory below a certain home directory. Which can be anything. Bummer. :( )

ericshliao
10-11-2009, 07:07 PM
I have a problem of reading epub with ADE on Windows XP. I created an EPUB file with embedded font. It works. Then I want to remove the embedded font to save storage space, so, by imitating some post in this thread, I tried with the lines in "stylesheet.css":
src : url(res:///c:/WINDOWS/FONTS/MSJH.ttf) format("truetype");
src : url(file:///c:/WINDOWS/FONTS/MSJH.ttf) format("truetype");
The result is bad.

What am I missing?

dpierron
10-12-2009, 09:05 AM
You have to use this resource reference inside of a font-face instruction, as in my :

@font-face {font-family: "Caecilia", serif;font-weight: normal;font-style: normal;src: url(res:///Data/fonts/CaeciliaLTStd-Roman.otf);}
@font-face {font-family: "Caecilia", serif;font-weight: bold; font-style: normal;src: url(res:///Data/fonts/CaeciliaLTStd-Bold.otf);}
@font-face {font-family: "Caecilia", serif;font-weight: bold; font-style: italic; src: url(res:///Data/fonts/CaeciliaLTStd-BoldItalic.otf);}
@font-face {font-family: "Caecilia", serif;font-weight: normal;font-style: italic; src: url(res:///Data/fonts/CaeciliaLTStd-Italic.otf);}

@font-face {font-family: "FontinSans", sans-serif;font-weight: normal;font-style: normal;src: url(res:///Data/fonts/Fontin_Sans_R_45b.otf);}
@font-face {font-family: "FontinSans", sans-serif;font-weight: bold;font-style: normal;src: url(res:///Data/fonts/Fontin_Sans_B_45b.otf);}
@font-face {font-family: "FontinSans", sans-serif;font-weight: bold;font-style: italic;src: url(res:///Data/fonts/Fontin_Sans_BI_45b.otf);}
@font-face {font-family: "FontinSans", sans-serif;font-weight: normal;font-style: italic;src: url(res:///Data/fonts/Fontin_Sans_I_45b.otf);}

This code forces the use of the Caecilia font for all serif font declarations in the following and inherited CSS, and the use of FontinSans in lieu of all other sans-serif fonts.

Hope this helps,
Dave.

ericshliao
10-12-2009, 09:12 AM
You have to use this resource reference inside of a font-face instruction, as in my...

Thanx for your reply.
In fact, I have set @font-face{} in "stylesheet.css". I can create epub ebook with embedded font without any problem. In my previous post, I just cited the "src: url..." part because I thought it's the only relevant facor.

dpierron
10-12-2009, 09:54 AM
Ok, my mistake.
You'll have to check that the file path is correct, including any capitalization problem specific to Windows (which is known for not showing the file names with their proper capitalization).
Also, I didn't know about the format("truetype") part ; is it possible that this would cause a problem ? In fact I never needed it, ADE is fully capable of distinguishing between TT and OTF font types by itself...
This would require some trial and error ; I may be able to help if you want, feel free to send me a private message so we can arrange for a transfer of your example file.

Cheers,
Dave.

ericshliao
10-12-2009, 11:42 AM
I may be able to help if you want, feel free to send me a private message so we can arrange for a transfer of your example file.

Thank you so much.

This is the sample ebook. Please unpack the attached zip package. There are 3 files:
1. "sample_embed_font.epub" is the ebook with embedded font and it's ok in ADE.
2. "sample_without_font.epub" is the ebook without embedded font and I made it to look for font in the same directory where the epub file resides. In ADE, every glyph of the ebook is "?".
3. "WenQuanYiZenHei.ttf" is the font to be used by "sample_without_font.epub".
Please put all the three files in the same dir.
Both the ebook contents and font are freely distributeable.

dpierron
10-12-2009, 01:44 PM
Okay, I'll have a look !

Dave.

dpierron
10-12-2009, 01:49 PM
So, it's after hours, and I'm home in front of my iMac ; this means I don't have Windows at hand, so I'll finish testing tomorrow.

But, the first thing I can tell you is that your 'without font' file, with this code, works perfectly :

@font-face {
font-family : MyFont;
font-weight : normal;
font-style: normal;
src : url(res:///Users/david/Downloads/sample/WenQuanYiZenHei.ttf);
}


Of course, I expanded everything in /Users/david/Downloads/sample

Tomorrow, I'll test and confirm wether it's a Windows problem or something else...

Hope this helps,
David.

ericshliao
10-12-2009, 02:01 PM
I expanded everything in /Users/david/Downloads/sample

David,

Thanx for your help.

I want to investigate into how to set font path, both relative and absolute, in Windows XP. In "sample_without_font.epub", I use relative path because I don't know where you would like to put the font file.
In Windows XP, absolute path will start with a drive letter, such as C:. That makes it different from those unix family. How to set it properly bothers me very much.

wallcraft
10-12-2009, 02:31 PM
I tried on my EZ Reader (Hanlin V3) and it does not accept fonts in /Data or /home. Tamzilla worked out how to do this on Hanlins (use res:///abook for the root of the SD card), see Fonts and Epub - What works on Sony, Works for Pocket Pro too! (http://www.mobileread.com/forums/showthread.php?t=58901).

dpierron
10-13-2009, 05:41 AM
Well, I tested with Windows XP and ADE and it definitively comes from an ADE bug. Let me explain...
I expanded the ePub file into a folder, edited the CSS file, setting an absolute path for the font resource and then opened the HTML file with Firefox ; guess what, it worked out of the box.
When I did the exact same thing directly in the ePub file (same edit) and opened it with ADE, it didn't work (showing question marks instead of asiatic-looking thingies).
So, it has something to do with ADE ; either it's a bug, or it's an obscure point of the ePub standard that ADE enforces ? I can't tell...

Hope this helps,
David.

ericshliao
10-13-2009, 08:33 AM
David,
Thanx for your test and advice. I have tried various combination of url strings that I thought correct, but ADE just don't accept them. I've never thought it's fault of ADE. Now I know the problem may come from ADE, not from my url strings.

dpierron
10-13-2009, 09:50 AM
Not really from ADE itself, but from ADE in Windows ; the Mac version of ADE eats externalized font resources at every breakfast ;)

wallcraft
10-13-2009, 10:09 AM
Well, I tested with Windows XP and ADE and it definitively comes from an ADE bug. Let me explain...
I expanded the ePub file into a folder, edited the CSS file, setting an absolute path for the font resource and then opened the HTML file with Firefox ; guess what, it worked out of the box.
When I did the exact same thing directly in the ePub file (same edit) and opened it with ADE, it didn't work (showing question marks instead of asiatic-looking thingies).
So, it has something to do with ADE ; either it's a bug, or it's an obscure point of the ePub standard that ADE enforces ? I can't tell. I don't think this is complicated. If ADE (or a web browser for that matter) fails to find the referenced font then it uses the default font, and hence the question marks. The "res://" is with respect to the app's root directory, but that does not have to be the system's root directory. So, the Mac ADE has the expected root but the Window's ADE has some other root - which we don't know (or I guess it could have no root at all, for "security" reasons).

There are a couple of examples of this with mobile ADE:

The Windows Sony ebook library reader has a root of C:\Program Files\Sony\Reader\Data\bin.

It isn't clear what the Hanlin's (V3 and V5) root is, but it isn't the root of the system filesystem because so far only the SD card appears to be visible (at res:///abook) and not the user-accessible internal memory.

Under Linux (or Unix, e.g. on the Mac), softlinks can probably be used to build whatever kind of access restrictions for "res://" the app developer wants. I don't think this is as easy under Windows, or on Windows-like filesystems.

dpierron
10-13-2009, 10:21 AM
Interesting !

ericshliao
10-13-2009, 11:04 AM
I don't think this is complicated. If ADE (or a web browser for that matter) fails to find the referenced font then it uses the default font, and hence the question marks. The "res://" is with respect to the app's root directory, but that does not have to be the system's root directory.

That's quite reasonable. I will have some test. Thanx for the tips.

yekim54
10-13-2009, 06:10 PM
The Windows Sony ebook library reader has a root of C:\Program Files\Sony\Reader\Data\bin.

Thank you so much for this bit of information. You've solved one of the problems that's been vexing me for weeks.

gregcd
10-13-2009, 06:30 PM
I've had a coulpe months with caecilia and felt its time for a change. This is a slab serif that has some modern flair:


{pic}

It's Museo 300. Three different weights are available free at http://new.myfonts.com/fonts/exljbris/museo/

Abecedary
10-13-2009, 07:31 PM
I've had a coulpe months with caecilia and felt its time for a change. This is a slab serif that has some modern flair:


{pic}

It's Museo 300. Three different weights are available free at http://new.myfonts.com/fonts/exljbris/museo/

There's hardly anything slabby about that serif (and it barely comes across as a serif, too). I could see it working pretty well as a display typeface in certain situations, but it'd drive me crazy to see it used as a body font. But to each his own...

JSWolf
10-15-2009, 09:36 AM
I've had a coulpe months with caecilia and felt its time for a change. This is a slab serif that has some modern flair:


{pic}

It's Museo 300. Three different weights are available free at http://new.myfonts.com/fonts/exljbris/museo/
Not bad, but what I see is an issue is that's not ePub you are showing and the font does not have italics or bold italics from the link you posted. So it really doesn't work as a true font family. The screen shot is LRF. And LRF simulates bold, italic, and bold/italic. In order to be useful for the main body text in an ePub eBook, it has to be a complete font family.

mikeywilliams25
10-20-2009, 10:56 AM
Some of the epubs in this thread (The Battlestar Galactica ones for example) do not resize either in ADE on my Windows machine or on my Sony505.
Three men in a boat however works fine.
What stops some epubs with embedded fonts from resizing (S M L)?

dpierron
10-20-2009, 11:18 AM
That's my fault, I just realized a few days ago that, when I used fixed point size for font definitions in the CSS files, the ePub book font was not resizeable anymore.
The solution is to use percentage, or ems, but the inconvenient is that it is a relative size definition... So whenever you want to change the global font size, instead of changing only the absolute font size (in points) in the body declaration, and leaving the relative definitions as is, you have to change _everything_... and this is a huge pain in the ***.
Luckily, there is a Calibre option for this, which is "font size key" ... Using this when converting a file to Epub, Calibre automatically replaces all the relative font sizes.

mikeywilliams25
10-20-2009, 12:24 PM
Thanks for the info.
Problem solved.

slm
10-21-2009, 08:42 PM
Does anyone know how to make this work automatically for newsfeeds on Calibre? The newsfeed conversion seems to ignore the additional css box in preferences.

Locheil
11-10-2009, 05:15 PM
I don't seem to be able to access the root dir of my 505 with explorer! can I put the fonts dir on my loaded SD card?
If so what do I need to alter in the CSS code?

:help:

...Alan


Eh!.... cancel that message found my problem, I can now see my 505's root dir. (brain fart!)

ModlrMike
11-16-2009, 10:01 PM
I'm interested in playing around with this on my 600. I have a couple of questions though:

a. what are the default font sizes on the 600?
b. if I add the CSS code (in addition to the other instructions) and specific font sizes in Calibre, will I see the difference on my 600?

Xenophon
11-17-2009, 11:20 AM
re: (a) I don't know. (b) yes, you should see differences on your 600. At least, I do on my 700. To make your testing easy, I suggest starting with a font that is wildly different from the built-in fonts on the reader. A script-style font or even (ick) comic sans (ick). This first font need not be particularly readable, just extremely different. The idea is to be able to tell at a glance whether the font change took effect. Then, once you have the basics down, switch over to the font (or fonts) you really intend to use.

Xenophon

ChristopherTD
11-27-2009, 11:06 AM
Actually, it depends if the paragraphs are using <p> or <div>. Best check the source and then fix the CSS after that.

This will be why it doesn't work in some of my ePub. What should I use when the html contains things like

div class="tx1"

and

div class="tx"

Do I need to reference tx1 and tx in the CSS that I get Calibre to add at the beginning?

Thanks
Christopher

JSWolf
11-27-2009, 12:45 PM
This will be why it doesn't work in some of my ePub. What should I use when the html contains things like

div class="tx1"

and

div class="tx"

Do I need to reference tx1 and tx in the CSS that I get Calibre to add at the beginning?

Thanks
Christopher
Yes, you will need to reference tx1 and tx in the CSS and have them set as you want for the corresponding paragraphs.

riverread
12-08-2009, 09:09 AM
I want to put my chinese fonts on a SD card (directory \fonts)
What's the correct Data-directory in the CSS, please?
(for internal fonts: src:url(res:///Data/FONT/UKAI.TTF)
Thank you very much for the help.

Ozric
12-13-2009, 05:40 PM
Hi,

I have a PRS-300. I followed the instructions outlined in post #18, and I'm even trying out the same font. When I exported my ePubs in Calibre and put them on my Reader, the new font worked for most of my books, but not all.

After digging around this thread some more, it sounded like I needed to use Sigil to manually edit the style section of each ePub that failed to use the new font. I replaced every "font-family" reference I could find, which made my books display Fontin in both Sigil and Calibre's internal viewer (I've installed the font on my PC), so I thought I did things properly.

But when I put these ePubs on my Reader, they still don't use Fontin. I've tried entering different permutations of Fontin for "font family:"

"Fontin"
Fontin
"Fontin", serif

But none of them work. Any ideas what I could be doing wrong?

Laurentiu
12-14-2009, 08:19 AM
Hello MobileRead members,

I am the proud owner of a Sony PRS600 and although I've had it for less than 24 hours, I cna say that I love it, but.... there is a but!
The problem that I have is that the unit does not display correctly Romanian characters. I tried everything, applying solutions found on this forum... without success. I found a couple of books in Romanian, converted by a fellow member and those appear fine, but, I cannot mamage to convert my files (mostly in RTF format).

I tried to embedd fonts, but, although the instructions are pretty straightforward, my Sony does not seem to change the fonts.
I have attached below a fragment from a book - this shows fine in Word, I even managed to make it appear fine in Calibre (I saved it as html, unicode UTF-8), but when I upload it to my Sony the special characters are either missing or appear a question marks.

Any help is much-much appreciated!
Thanks a lot and have a great day!

Laurentiu

jackie_w
12-14-2009, 01:39 PM
Hi Laurentiu,

I tried your rtf fragment - converted to epub using Calibre and transferred to my PRS-505. It seems to display fine (not that I can read Romanian, you understand!). So it's just a matter of figuring out what's going wrong.

Given you have posted in this thread I assume you have read it and correctly copied your desired fonts into a newly created fonts directory on the PRS-600.

These are the steps I followed. My example uses the Georgia font-family rather than the Bookman in your sample rtf because I don't have Bookman on my reader.

1. Load rtf into MSWord and File/Save-as Web-filtered format to get an HTML version.

2. Edit the HTML in a text editor and remove all the style info - everything between <style> ... </style>. This step may not be necessary but it simplifies the HTML for the purpose of troubleshooting.

3. Import the HTML into Calibre.

4. Convert to epub using the following CSS in the Look-and-Feel/Extra-CSS box:-

@font-face {
font-family: "Georgia";font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/georgia.ttf);
}
@font-face {
font-family: "Georgia";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/georgiai.ttf);
}
@font-face {
font-family: "Georgia";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/georgiab.ttf);
}
@font-face {
font-family: "Georgia";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/georgiaz.ttf);
}
body {font-family: "Georgia", serif; line-height:120%; }

5. Transfer epub to reader using Calibre and admire pretty results without understanding a word. :)

I've attached my zipped-up HTML file in case it's any use.

Good luck!

Laurentiu
12-14-2009, 02:11 PM
Hi Laurentiu,
[...]
5. Transfer epub to reader using Calibre and admire pretty results without understanding a word. :)


Hi Jackie,

Thanks a lot for your help :thanks:. I followed the steps and managed to convert the fragment properly. Now, c'mon.... are you serious when you said you can't understand Romanian? :D Well, you realize, of course, that I attached the fragment so that someone can compare the view from Word with that from the reader!

Thanks again for your valuable help. It's good to be part of this virtual community. Now I have some work to do: convert some of those books that did not go properly in the first place!

All the best,
Laurentiu

JSWolf
12-15-2009, 06:58 PM
Hi,

I have a PRS-300. I followed the instructions outlined in post #18, and I'm even trying out the same font. When I exported my ePubs in Calibre and put them on my Reader, the new font worked for most of my books, but not all.

After digging around this thread some more, it sounded like I needed to use Sigil to manually edit the style section of each ePub that failed to use the new font. I replaced every "font-family" reference I could find, which made my books display Fontin in both Sigil and Calibre's internal viewer (I've installed the font on my PC), so I thought I did things properly.

But when I put these ePubs on my Reader, they still don't use Fontin. I've tried entering different permutations of Fontin for "font family:"

"Fontin"
Fontin
"Fontin", serif

But none of them work. Any ideas what I could be doing wrong?

This is what I put in every ePub I convert using Calibre at the beginning of the CSS.

@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Regular.ttf);
}
@font-face {
font-family: "Fontin";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Bold.ttf);
}
@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin-Italic.ttf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_R_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_B_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin_Sans_I_45b.otf);
}
@font-face {
font-family: "Fontin_Sans" ;
font-weight: bold ;
font-style: italic ;
src: url(res:///Data/fonts/Fontin_Sans_BI_45b.otf) ;
}
body {
font-family: "Fontin", serif;
widows: 0;
orphans: 0
}

Not every case will it work as is to display the font. Sometimes you need to look at the html code to see what styles are used and ad the specific font family you want to the style(s) used.

Ozric
12-17-2009, 10:53 AM
Yeah, it's modifying the code where I run into problems. I have books that don't use the new font when I convert them in Calibre, whether I look at them on my Reader, Sigil, or Calibre's internal viewer. I use Sigil to edit the code by replacing any font-family reference I find with "Fontin," which causes the font to be used in Sigil and Calibre's internal viewer. But when I put the book on my Reader, it doesn't use Fontin for some reason.

I've been meaning to experiment some more, but I haven't had much time these days. I'm using an older version of Sigil, and maybe updating it would make a difference?

Ozric
12-21-2009, 11:02 PM
It turns out I was never able to fix my problem books by hand-editing the code. Luckily, I discovered that if I first converted the ZIP files to LRF, then converted the LRFs to ePubs, the books end up using the new font and I ended up not having to hand-edit them at all.

gregcd
12-22-2009, 03:34 PM
nice one

vietchovui
12-30-2009, 11:45 AM
Big thanks to zelda-pinwheel, i was able to read vietnamese on PRS 700 now
I have a PRS-600. I really want to know what you did with your 700 to make it able to read books in vietnamese!

JSWolf
12-30-2009, 07:39 PM
I have a PRS-600. I really want to know what you did with your 700 to make it able to read books in vietnamese!
Probably put Vietnamese fonts in the fonts directory off of the route directory and pointed the CSS of the ePub to those fonts (as outlined someplace in this thread).

vietchovui
12-31-2009, 01:54 AM
Probably put Vietnamese fonts in the fonts directory off of the route directory and pointed the CSS of the ePub to those fonts (as outlined someplace in this thread).
Thank you very much! One more question: How to embed customized font in fetched news epub file? for example for this RSS: http://rss.pcworld.com.vn/rss/default
Sorry for asking you so much. I don't know anything about CSS. Just copy and paste what you give me!

JSWolf
12-31-2009, 10:54 AM
Thank you very much! One more question: How to embed customized font in fetched news epub file? for example for this RSS: http://rss.pcworld.com.vn/rss/default
Sorry for asking you so much. I don't know anything about CSS. Just copy and paste what you give me!
What I do is open the ePub and edit the CSS to add in the code for the fonts. The fonts live in a directory called fonts in the root of my 505. And fonts is case specific.

@font-face {
font-family: "Fontin";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Bold.ttf);
}
@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin-Italic.ttf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_R_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_B_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin_Sans_I_45b.otf);
}
@font-face {
font-family: "Fontin_Sans" ;
font-weight: bold ;
font-style: italic ;
src: url(res:///Data/fonts/Fontin_Sans_BI_45b.otf) ;
}
body {
font-family: "Fontin", serif;
widows: 0;
orphans: 0
}

vietchovui
01-01-2010, 07:29 AM
What I do is open the ePub and edit the CSS to add in the code for the fonts. The fonts live in a directory called fonts in the root of my 505. And fonts is case specific....

Yep. I've tried but no chance. I think epub files fetched from different RSS sources that have different structures, depend on the HTML of the website. So that some words don't display correctly [?]. Please view the sceencap.

JSWolf
01-01-2010, 10:19 PM
Yep. I've tried but no chance. I think epub files fetched from different RSS sources that have different structures, depend on the HTML of the website. So that some words don't display correctly [?]. Please view the sceencap.
You'll just have to put the font family declaration into whatever CSS elements need it.

Cactusgod
01-03-2010, 09:40 AM
So here's a question for you pros. Suppose I didn't like the regular version of the font, and I wanted to trick calibre into thinking that the bold version of the font was actually the regular version of the font to be used throughout the body of the text. Is that possible?

Thanks

wallcraft
01-03-2010, 10:24 AM
Suppose I didn't like the regular version of the font, and I wanted to trick calibre into thinking that the bold version of the font was actually the regular version of the font to be used throughout the body of the text. Try the following additional CSS: body {
font-weight: bold;
} You can also try an intrinsically heavy font. I don't know if you can use a bold weight font file as the "normal" font or not.

latexsalesman
01-03-2010, 12:59 PM
You can make any font fit into any body text type. Here is an example:
@font-face {
font-family:"MinionPro";
font-weight: normal;
font-style: normal;
src:url(res:///Data/fonts/MinionPro-MediumDisp.otf);
}
@font-face {
font-family:"MinionPro";
font-weight: bold;
font-style: normal;
src:url(res:///Data/fonts/MinionPro-SemiboldDisp.otf);
}
@font-face {
font-family:"MinionPro";
font-weight: normal;
font-style: italic;
src:url(res:///Data/fonts/MinionPro-MediumItDisp.otf);
}
@font-face {
font-family:"MinionPro";
font-weight: bold;
font-style: italic;
src:url(res:///Data/fonts/MinionPro-SemiboldIt.otf);
}

Minionpro medium display is used as my body text and other versions of it are used for bold, italic... and more.

ePub+calibre makes font changing fun and easy, I probably have tried over 100 font combination s now. I use Grandesign Neue Serif now for most of my books.

Cheers!!

gregcd
01-05-2010, 10:23 PM
A heads up to followers of this thread:

Replace DEFAULT epub fonts! (PRS-505)
What it does
This hack for Sony Reader PRS-505 (possibly the newer models too, but you are on your own with them) allows you to use your custom fonts for all EPUB files without having to modify them - that is, it should work with any file you download, including protected EPUBs

Basically, you get all the benefits of ePub custom Fonts on 700, 505, 500, 300, 600 without having to modify each and every EPUB file.

http://www.mobileread.com/forums/showthread.php?t=66102

:D

daffy4u
01-06-2010, 07:19 PM
Zelda sent me here because I'm still having problems. I have PRSPlus installed my 505 if that makes a difference. Here's my stuff:


@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Regular.ttf);
}

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

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

@font-face {
font-family: "Fontin Sans";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/Fontin_Sans_BI.otf);
}

Edit: I realized I left the "body" part off the end but I added it and tried again with no luck.

body {
font-family: "Fontin", serif;
}

daffy4u
01-06-2010, 09:33 PM
Nevermind, I got it. When I added the body information, I left out a space.

I typed "body{" instead of "body {". :)

Direct Ebooks
02-19-2010, 10:36 AM
Hi all.

great thread. I tried to find the answer to my question in previous pages, but my eyes are worn out from all the different font examples!
What i want to know is - is there a consensus on the ideal margin size and font type or size for sony readers?

i'd appreciate anyones feedback, in particualr on margin size and font size

Xenophon
02-19-2010, 11:35 AM
No consensus that I've seen. Some folks (including me) like minimal margins -- no more than a pixel or two. Others prefer more. Similarly, there's a definite split between those who prefer serif fonts and those who prefer sans-serif fonts.

I'm sorry this isn't much help, but...

Xenophon

JSWolf
02-19-2010, 11:41 AM
I prefer a serif type font as the body font and I prefer no margin on my 505.

It's all subjective. So there really is no optimal settings that will please everyone.

diskotekno
02-28-2010, 09:33 PM
Never mind. I figured it out! there was an EPUB directory on the root that contained a style sheet that was overriding the css in the epub files.


Hi,

I have been trying to get this to work for a couple of days with no luck. I have followed all the steps listed and all I can ever seem to get is the first line of text to be the new font. I have checked and all the text seems to be within <body> tags. I am using a prs-300 with the russian modded firmware (for the clock).

If someone could point me in the direction of what I am doing wrong it would be appreciated!

Thanks!

Galina
03-09-2010, 08:03 AM
Would it be possible to specify a custom font for the display of the dictionary, also? This could prevent the dictionary from displaying sqaures instread of special characters.

If so, what could the command be and where to put it?

galina

JSWolf
03-09-2010, 05:37 PM
Would it be possible to specify a custom font for the display of the dictionary, also? This could prevent the dictionary from displaying sqaures instread of special characters.

If so, what could the command be and where to put it?

galina

off topic

C_J
05-22-2010, 03:35 AM
Hello. :)

Thanks for your help.

I changed the fonts (I used the Verdana), but I do not know how to change fonts in Chapter Titles and Table of Contents.

What should I write in css to change these Fonts?

(sorry for my English) :o

jackie_w
05-22-2010, 09:32 AM
I do not know how to change fonts in Chapter Titles and Table of Contents.

What should I write in css to change these Fonts?

I think it depends on how the Chapter Titles and Table of Contents are defined in your source ebook. I can't help with TOC as I don't use them but I include an example below of what you might use for Chapter Titles.

Add the following to the CSS you already have. It will only work if your ebook's Chapter Titles have been specified using standard HTML heading tags <h1>, <h2>, ... <h6>

The example below sets Headings levels 1-6 to font Georgia, but you could use any font of your choosing.

@font-face { font-family: "Georgia"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/georgia.ttf);}
@font-face { font-family: "Georgia"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/georgiai.ttf);}
@font-face { font-family: "Georgia"; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/georgiab.ttf);}
@font-face { font-family: "Georgia"; font-weight: bold; font-style: italic; src: url(res:///Data/fonts/georgiaz.ttf);}

h1, h2, h3, h4, h5, h6 {font-family: "Georgia";}


Similarly, if your source ebook tagged chapters something like this:
<p class="chapt">Chapter One</p>
rather than:
<h2>Chapter One</h2>

then I think you could achieve the same result by replacing the last line with:
p.chapt {font-family: "Georgia";}

Tazina
06-20-2010, 09:27 PM
I just wanted to quickly say Thank You to everyone. It took a couple tries but now I have a much more readable font and it's much more enjoyable to read my PRS 300. Thanks.

ps: I like Verdana in 15 point type.

sebasdoes
07-10-2010, 06:20 PM
Has anyone done this with a Japanese font? If yes, do you know what settings I would need in Calibre, what font should work and what CSS to use? I've tried it with Osaka.ttf from MacOS but all I got was question marks when in the book. I must've screwed up somewhere...

Edit: Most of my books were in some Aozora Bunko-like format; .txt with image files. The txt files had HTML-style links to the image files, it was really weird. Anyway, the program 青P in combination with the IPA Mona font got me a working PDF for my Sony. I had to use the Mona font because the default font used by 青P did not work (pages were blank when viewed on the PSR-600). I can recommend that you keep the default (non-working) font for the furigana though, since they don't show up correctly in the text, this way they won't show up at all. After converting you can add the metadata with Calibre and you're good to go.

If your original text files are in SJIS you must first convert them to UTF8. I used a small program called TextEncodingConverter for that.

arvinder
07-16-2010, 09:38 AM
Need a complete epub file having japanese or russian fonts in it that will really helpful.

Thanks

cgk
07-16-2010, 01:39 PM
Hi,

I want to use Linux Libertine and have download the font pack (which contains 5 fonts in .ttf format), what is the CSS code I need to put in Calibre?

Thanks in advance,

Charles

JSWolf
07-16-2010, 04:12 PM
Need a complete epub file having japanese or russian fonts in it that will really helpful.

Thanks

Do you have the Japanese or Russian font files?

cgk
07-16-2010, 05:05 PM
Ah-ha, I've worked it out, so no advice needed (well unless someone wants to recommend a font they think is better than Linux Libertine!).

arvinder
07-19-2010, 06:57 AM
I tried with japanese.ttf font but unable to display japanese characerte in sony library.

What would be the font family of japanese.ttf.

As explained in one the discussion to use below font can sombody attach ipagp-mona.ttf font package.

@font-face {
font-family: "ipagpmona";
src: url(res:///Data/fonts/ipagp-mona.ttf);
}

body {
font-family: "ipagpmona";
}

Lloyd Simcoe
09-03-2010, 03:20 PM
I don't think this is complicated. If ADE (or a web browser for that matter) fails to find the referenced font then it uses the default font, and hence the question marks. The "res://" is with respect to the app's root directory, but that does not have to be the system's root directory. So, the Mac ADE has the expected root but the Window's ADE has some other root - which we don't know (or I guess it could have no root at all, for "security" reasons).

There are a couple of examples of this with mobile ADE:

The Windows Sony ebook library reader has a root of C:\Program Files\Sony\Reader\Data\bin.


Apparently something has changed with the release of version 3.3 of Sony Reader Library, because it no longer recognizes my external fonts. Does anybody have a solution?

notsure
11-14-2010, 08:32 AM
Should this work on a Sony PRS-350?

I tried doing this on a book downloaded from MR (the most excellent The Count of Monte Cristo).

I added the fonts folder to my device and included the code in the Calibre extra css section then re-converted the book.

When I open the book it still appears to be using the same old font.

Thanks!

jackie_w
11-14-2010, 03:19 PM
@notsure,
I don't have a PRS-350 but I believe it should work. Is it possible to attach your converted epub for a closer look?

notsure
11-14-2010, 06:03 PM
Sure!

This is what I put into calibre's extra css section;

@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Regular.ttf);
}

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

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

body {
font-family: "Fontin", serif;
}

:thanks:

jackie_w
11-14-2010, 07:38 PM
@notsure

Try this:

Reimport the original epub, i.e. before you did any conversions.

Convert using all the ExtraCSS you had before, but replace

body {
font-family: "Fontin", serif;
}

with

body.calibre {
font-family: "Fontin", serif;
}

notsure
11-15-2010, 08:14 PM
:thanks::thanks::thanks:

That did the trick!

How did you know to do that? I didn't see it listed anywhere.

Thanks again.

jackie_w
11-15-2010, 09:30 PM
How did you know to do that? I didn't see it listed anywhere.


Unfortunately there is no one way which always works. You have to look at the HTML and CSS inside the epub to decide what needs to go in ExtraCSS.

In your source epub each piece of HTML started with:
<body text="#000000" class="calibre">
rather than just plain
<body>

And the relevant bit of CSS contained:

.calibre {
background-color: #fff;
display: block;
font-family: Times New Roman;
font-size: 1em;
font-weight: normal;
line-height: normal;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 13pt;
margin-top: 0;
page-break-before: always;
text-align: justify
}


i.e. the font-family you needed to override was at a lower level than <body>. Hence, to replace "Times New Roman" with "Fontin" in the converted epub CSS you needed the ExtraCSS to specify
body.calibre {font-family: "Fontin", serif;}

[By the way, I know you didn't create the source epub, but for info, there should have been double quotes around the Times New Roman because it contained spaces.]

notsure
11-16-2010, 07:18 AM
Ahhhh. That kind of makes sense to me.

I guess I will have to experiment some more on my own with different epubs.

These forums are an amazing resource thanks to people like you.

Cheers.

JSWolf
11-25-2010, 08:26 AM
Yes, this trick works on the 350, 650, & 950.

elanamig
01-02-2011, 03:59 PM
Yes, this trick works on the 350, 650, & 950.

I tried the steps to add Liberation fonts (for cyrillic support) to PRS-350, but it did not work... All cyrillic characters show up as ?...

What I did:

1. Added Liberation directory to fonts directory, with Liberation .ttf fonts inside.
2. Added the following refs into the CSS using Sigil:

@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url((res:///Data/fonts/Liberation/LiberationSerif-Italic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url((res:///Data/fonts/Liberation/LiberationSerif-Regular.ttf);
}
@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url((res:///Data/fonts/Liberation/LiberationSerif-BoldItalic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url((res:///Data/fonts/Liberation/LiberationSerif-Bold.ttf);
}

3. Added the following to css:
body.calibre {
font-family: "Liberation", sans-serif;
}

(Since body tag has class=calibre).

What else could I be missing???
Any help would be super-greatly appreciated! :help:

Thank you!

jackie_w
01-02-2011, 04:11 PM
@elanamig,
Can you post the whole css file contained in the epub which isn't working?

elanamig
01-02-2011, 05:46 PM
@elanamig,
Can you post the whole css file contained in the epub which isn't working?

Thank you for replying to my call for help!!

The css file was generated by calibre when I converted fb2 to epub. Here it is (Please, note, that since my last post I got rid of the "Liberation" directory in the fonts folder, since I thought that maybe sony does not load fonts recursively from dirs):

@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url(res:///Data/fonts/LiberationSerif-Italic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url(res:///Data/fonts/LiberationSerif-Regular.ttf);
}
@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url(res:///Data/fonts/LiberationSerif-BoldItalic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url(res:///Data/fonts/LiberationSerif-Bold.ttf);
}
@namespace h "http://www.w3.org/1999/xhtml";

body.calibre {
font-family: "Liberation", sans-serif;
}

.MsoNormal {
display: block;
font-family: "Times New Roman";
font-size: 1em;
margin-bottom: 0.0001pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
text-align: justify
}
.Section {
display: block;
page: Section1
}
.book {
display: block;
font-family: "Times New Roman";
font-size: 1em;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: justify
}
.calibre {
display: block;
font-size: 0.75em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
page-break-before: always
}
.calibre1 {
display: block;
font-family: "Times New Roman";
font-size: 1.33333em;
font-weight: bold;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: justify
}
.calibre10 {
color: blue;
cursor: pointer;
text-decoration: underline
}
.calibre2 {
font-family: Arial;
font-size: 1em
}
.calibre3 {
color: inherit;
cursor: inherit;
text-decoration: inherit
}
.calibre4 {
font-family: Arial;
font-size: 1.33333em
}
.calibre5 {
font-style: italic
}
.calibre6 {
font-weight: bolder
}
.calibre7 {
font-size: 0.77778em;
line-height: normal;
vertical-align: super
}
.calibre8 {
font-family: Arial;
font-size: 1.71429em
}
.calibre9 {
display: block;
font-family: "Times New Roman";
font-size: 1em;
font-weight: bold;
margin-bottom: 1.67em;
margin-left: 0;
margin-right: 0;
margin-top: 1.67em;
text-align: justify
}

Thanks!

jackie_w
01-02-2011, 06:24 PM
The problem you have with this file is that there are font-family statements at a "lower level" than body or body.calibre.

You should be able to correct the already-converted epub by amending the epub's css file in Sigil or with Tweak-epub in calibre (whatever you're comfortable with). Given the settings in your @font-face statements, there is more than one way to fix this but the following 2 steps should work:

1. Change all those instances of
font-family: "Times New Roman";
to
font-family: serif; (or font-family: "Liberation";)
and all those instances of
font-family: Arial;
to
font-family: sans-serif; (or font-family: serif; or font-family: "Liberation";)

I don't want to confuse you but I feel I should also add that the above could also have been achieved via the original Calibre conversion to EPUB if the Calibre ExtraCSS had matched your source file. I can't see the source file so I can't tell you what it should have been. If you want to pursue this for future info, send me a PM and we can take it from there.

2. You also need to make sure your actual font files are in exactly the correct directory as specified in your @font-face statements. e.g. you have referred to the Regular serif font as
res:///Data/fonts/LiberationSerif-Regular.ttf
which means that looking at your Sony in your PC's file browser you should have a directory
[Drive:]/fonts
containing the file
LiberationSerif-Regular.ttf

Everything is case-sensitive so directory names, filenames and extensions must match EXACTLY.

elanamig
01-02-2011, 06:42 PM
The problem you have with this file is that there are font-family statements at a "lower level" than body or body.calibre.

You should be able to correct the already-converted epub by amending the epub's css file in Sigil or with Tweak-epub in calibre (whatever you're comfortable with). Given the settings in your @font-face statements, there is more than one way to fix this but the following 2 steps should work:

1. Change all those instances of
font-family: "Times New Roman";
to
font-family: serif; (or font-family: "Liberation";)
and all those instances of
font-family: Arial;
to
font-family: sans-serif; (or font-family: serif; or font-family: "Liberation";)

I don't want to confuse you but I feel I should also add that the above could also have been achieved via the original Calibre conversion to EPUB if the Calibre ExtraCSS had matched your source file. I can't see the source file so I can't tell you what it should have been. If you want to pursue this for future info, send me a PM and we can take it from there.

2. You also need to make sure your actual font files are in exactly the correct directory as specified in your @font-face statements. e.g. you have referred to the Regular serif font as
res:///Data/fonts/LiberationSerif-Regular.ttf
which means that looking at your Sony in your PC's file browser you should have a directory
[Drive:]/fonts
containing the file
LiberationSerif-Regular.ttf

Everything is case-sensitive so directory names, filenames and extensions must match EXACTLY.

:thanks:

It seems so obvious now that you pointed it out. Changing all font-family refs to Liberation worked. I got rid of the fonts dir on the reader and added a fonts dir to the epub instead, just to make sure all references are good.

What confused me about this before is that Adobe Digital Editions reads the messed up css without problems. But Sony is pickier.

jackie_w
01-02-2011, 06:53 PM
Well I'm glad it worked for you but I'm slightly surprised as it sounds as if you've embedded the fonts in the epub. I was under the impression that if you do this you must also list the font files in the <manifest> section of the epub's .opf file. Did you do this? If not, perhaps the Sony isn't as picky as you thought. :)

elanamig
01-02-2011, 07:05 PM
I partied a bit too early...

The table of contents does not display (shows up as all squares), although the text itself is fine...

Is that a css/font issue, or would this require russification (i.e. firmware patch) for the reader?

Thanks!

elanamig
01-02-2011, 07:10 PM
Well I'm glad it worked for you but I'm slightly surprised as it sounds as if you've embedded the fonts in the epub. I was under the impression that if you do this you must also list the font files in the <manifest> section of the epub's .opf file. Did you do this? If not, perhaps the Sony isn't as picky as you thought. :)

I did embed the files in the epub, because I read some posts that claim that warranty will be invalidated if we do something to the default setup on the reader... So I reverted to the original Sony file structure, and decided to contain all of my font modifications to the epub itself.

As for the opf file - yes, I had to modify that as well. But I did that during the original conversion, so that wasn't a problem right now.

jackie_w
01-02-2011, 07:32 PM
I partied a bit too early...

The table of contents does not display (shows up as all squares), although the text itself is fine...

Is that a css/font issue, or would this require russification (i.e. firmware patch) for the reader?

Thanks!

It's not a CSS issue. I think it's the system fonts on the reader which need to contain all your Cyrillic characters but by default do not. I believe russification should fix it for you. I'm afraid I'm an English-only speaker so menus are never a problem.

I do have the Boroda russification firmware. It was very easy to install, but I can't answer your question. You may get some clarification if you ask in this thread (http://www.mobileread.com/forums/showthread.php?t=99361) in the Sony forum.

elanamig
01-02-2011, 07:37 PM
It's not a CSS issue. I think it's the system fonts on the reader which need to contain all your Cyrillic characters but by default do not. I believe russification should fix it for you. I'm afraid I'm an English-only speaker so menus are never a problem.

I do have the Boroda russification firmware. It was very easy to install, but I can't answer your question. You may get some clarification if you ask in this thread (http://www.mobileread.com/forums/showthread.php?t=99361) in the Sony forum.

Yes, I gathered that much already. I've seen the Boroda upgrade and a few others, but I might just use transliteration for the toc. I rarely use the toc anyway. Just wanted to display it nicely for perfectionist purposes :).

Thanks so much for your help!

jackie_w
01-02-2011, 07:43 PM
You're welcome. glad to help. :)

jimad
02-15-2011, 12:15 PM
I tried putting Gentium Plus (free) on my Sony Pocket Reader at:

/fonts/GentiumPlus/GentiumPlus-I.ttf
/fonts/GentiumPlus/GentiumPlus-R.ttf

and then put @font-face declarations in my html source -- I could just have well done it in the Calibre CSS overide section, I guess.

Gentium Plus supports European Languages -- including Eastern European and Russia, not Eastern Languages such as Chinese and Japanese.

Very happy result. See attached test of "all the world's languages."

(Works compiled to epub by Calibre default mode.)

PS: Don't know why this approach would invalidate anything -- since @font-face IS supported by IDPF -- so, my understanding is that this approach is "completely legal."

Hedaya
07-18-2011, 10:38 PM
I'm struggling with this.

I put:

@font-face { font-family: "Trado"; font-weight: normal; font-style: normal; src: url(res:///Data/font/trado.ttf);
}
@font-face { font-family: "Trado"; font-weight: bold; font-style: normal; src: url(res:///Data/font/tradbdo.ttf);
}
body { font-family: "Trado", serif;
}

But it didn't work. :(

JSWolf
07-19-2011, 05:43 PM
Did you make the fonts directory and put the font files there?

Hedaya
07-22-2011, 09:25 AM
yes I did. And this might be silly to say, but I put it on the main drive and on my sdcard and tried it with what's above, and with: res:///system/font instead and with res:///sdcard/ and with naming them as res:///nook and with res:///SummerReads and with res:///E and with res:///F. :(

JSWolf
07-23-2011, 09:23 PM
yes I did. And this might be silly to say, but I put it on the main drive and on my sdcard and tried it with what's above, and with: res:///system/font instead and with res:///sdcard/ and with naming them as res:///nook and with res:///SummerReads and with res:///E and with res:///F. :(

Since you are using a nook and not a Sony, it may not work for you. This thread is for Sony Readers.