Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-14-2009, 01:23 PM   #1
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
Question ePub custom Fonts on all Sonys

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:
Quote:
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 of this thread for all the css code you will need, and in post 18 i've added some screen caps and a step-by-step guide for people who are less experienced with using css.
--zelda pinwheel

Last edited by zelda_pinwheel; 03-11-2009 at 01:36 PM. Reason: adding locations of important posts
Xenophon is offline   Reply With Quote
Old 01-14-2009, 01:25 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,530
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I haven't tried this, but you should be able to put the font in any directory
kovidgoyal is online now   Reply With Quote
Advert
Old 01-14-2009, 01:37 PM   #3
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Xenophon View Post
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'.
llasram is offline   Reply With Quote
Old 01-14-2009, 01:38 PM   #4
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
Quote:
Originally Posted by Xenophon View Post
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.
wallcraft is offline   Reply With Quote
Old 01-14-2009, 01:57 PM   #5
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
Quote:
Originally Posted by llasram View Post
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!

Xenophon
Xenophon is offline   Reply With Quote
Advert
Old 01-14-2009, 02:42 PM   #6
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Xenophon View Post
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 .
llasram is offline   Reply With Quote
Old 01-16-2009, 12:35 PM   #7
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
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 is offline   Reply With Quote
Old 01-20-2009, 02:23 PM   #8
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
Bump...
Xenophon is offline   Reply With Quote
Old 01-30-2009, 11:13 PM   #9
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
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":

Code:
@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:

Code:
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:

Code:
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.
Attached Files
File Type: epub TestBook.epub (9.1 KB, 3729 views)
File Type: zip TestBook.zip (2.2 KB, 3318 views)
File Type: zip fonts.zip (280.5 KB, 4010 views)
File Type: txt fonts.css.txt (653 Bytes, 3734 views)
llasram is offline   Reply With Quote
Old 01-31-2009, 03:29 PM   #10
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
Thanks!! I'll try it out this weekend. When you wrote:
Quote:
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 is offline   Reply With Quote
Old 02-03-2009, 10:55 PM   #11
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500


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.


Xenophon
Xenophon is offline   Reply With Quote
Old 02-14-2009, 10:59 PM   #12
Beth loves books
Junior Member
Beth loves books began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2009
Device: prs-700
Does this only work for PDF's or does it also work to change fonts in sony content?
Beth loves books is offline   Reply With Quote
Old 02-15-2009, 01:25 PM   #13
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
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
Xenophon is offline   Reply With Quote
Old 02-16-2009, 05:26 AM   #14
Beth loves books
Junior Member
Beth loves books began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2009
Device: prs-700
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.
Beth loves books is offline   Reply With Quote
Old 02-26-2009, 06:25 PM   #15
deadringer
Enthusiast
deadringer began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Feb 2009
Device: Sony PRS700BC
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
deadringer is offline   Reply With Quote
Reply

Tags
epub, fonts


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Reader With Custom Fonts and Full Justification? Loose_Appeal Which one should I buy? 2 07-16-2010 08:16 AM
ePub with custom .css on a 505 dicknskip Sony Reader Dev Corner 3 06-10-2010 12:34 AM
Custom TTF fonts in MOBI books? jpt Astak EZReader 21 11-21-2009 09:24 AM
Test for custom entities in ePUB Jellby ePub 9 05-27-2009 07:45 AM


All times are GMT -4. The time now is 05:31 AM.


MobileRead.com is a privately owned, operated and funded community.