03-14-2011, 02:56 PM | #1 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
Fonts with foreign language charachters
So I have read any number of threads here that describe how to change your fonts. And being a fiddling geek sort of person, I experimented with it.
I copied fonts to a /font directory on my reader. I exploded an epub in Calibre, and inserted pointers to the font files into stylesheet.css. I rebuilt the epubs. I deleted the book from my device and reloaded the new version. I have done this over and over again trying different fonts and different paths, and nothing ever changes. According to the other threads, you have to point to the font file in this directory: res:///Data/fonts/ Since that doesn't work, and I have no reason to think I need that "Data" in the path other than what people said here, I also tried: res:///fonts/ Since apparently some fonts work and some don't, I tried a dozen different fonts including fonts that were linked to by people who claim that they worked. No luck. Finally, since I didn't really have any complaints about the canned font that comes with the device, I gave up. It's not that important, and I love my reader regardless of whether I can change fonts, and I'd rather read than bang my head on the wall. But now I am reading a book, 1635:The Eastern Front by Eric Flint. They're invading Poland, and there are all these place names that my reader is rendering badly. For example, "Świebodzin" is rendering as "?wiebodzin" I'm thinking that if I can just get the darn font thing working right, and choose a unicode font, it should be able to render these place names correctly. So I've pulled all this font stuff out to mess with it again. To no avail. I still cannot change the fonts. What am I missing here? Last edited by elizilla; 03-14-2011 at 06:22 PM. |
03-14-2011, 04:50 PM | #2 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Also EVERYTHING is case-sensitive on the reader, i.e. fonts is NOT the same as Fonts. And if your font files have an extension of .TTF then the css file needs to also have .TTF not .ttf If the above common problems are not the source of your problem, can you post your epub's edited .css file? Last edited by jackie_w; 03-14-2011 at 04:53 PM. |
|
Advert | |
|
03-14-2011, 06:10 PM | #3 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
Yes, that is a typo. I spend too much time bouncing between windows and unix - apologies for any confusion due to my sloppiness.
My font files and my CSS file all have lower case extensions. I've attached a copy of one of the CSS files I tweaked, and a screenshot of my fonts folder on my reader. Hopefully I did the attaching correctly - I never used that forum function before! I guess if they don't work I will edit my post and try to fix them. The reader is a PRS-650. Thanks! |
03-14-2011, 06:26 PM | #4 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
OK, I've had a look at your stylesheet. This is not the way I've normally seen it done but that's not to say your method is "wrong". Usually the font specs are done with @font-face statements at the top of the css file.
What does look wrong is that you have a missing semi-colon at the end of each line before: Code:
src: url(res:///Data/fonts/somefontname.ttf); If you still have no joy then I'll attach an edited stylesheet in the way I would have done it. |
03-14-2011, 06:51 PM | #5 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
I took the semicolon off of the last line in every grouping, too. And it seems to have done the trick - I now have a different font. Yay!
But I still have "?wiebodzin". Do you think it's possible to fix this without doing that "Russification" thing? Also, if you have advice for how to more neatly edit these stylesheets, I'm interested! My html knowledge predates the whole CSS thing, so I was just trying to do this without breaking what was there - I don't really know what I'm doing. Thank you so much! |
Advert | |
|
03-14-2011, 07:43 PM | #6 |
PRS+ author
Posts: 1,637
Karma: 2446233
Join Date: Dec 2007
Device: Sony PRS-300, 505, 600, 650, 950
|
elizilla,
it sounds like you are trying to reinvent the wheel. Changing epub fonts is a well known procedure, you don't need to research anything. (randomly removing semicolons and parts of the path is a bid strange way, to be honest) There is nothing special about Polish characters, if the fonts that you are referencing contain them, they will be displayed. (provided, you correctly reference them). Custom firmwares (I wouldn't call PRS+ "russification", it doesn't focus on any particular locale) could help you in way that you won't need to edit every epub file. |
03-14-2011, 07:51 PM | #7 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
If you need free fonts which have the complete range of extended Latin characters to cover the accents, the Summer Institute of Linguistics has a few as special open source projects.
Gentium looks especially nice and comes with italic and bold as well. |
03-14-2011, 08:10 PM | #8 | ||||
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Quote:
Quote:
Quote:
Have a look at the @font-face statements at the top (reproduced here): Code:
@font-face { font-family: serif; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/times.ttf);} @font-face { font-family: serif; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/timesi.ttf);} @font-face { font-family: serif; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/timesbd.ttf);} @font-face { font-family: serif; font-weight: bold; font-style: italic; src: url(res:///Data/fonts/timesbi.ttf);} @font-face {font-family: sans-serif; font-weight: all; font-style: all; src: url(res:///Data/fonts/Sans_Regular.ttf);} Code:
font-family: serif; font-style: italic; The fifth one specifies to use res:///Data/fonts/Sans_Regular.ttf wherever Code:
font-family: sans-serif; If you get adventurous you can do the same with monospaced fonts with a set of Code:
@font-face {font-family: monospace; ... } The only thing which will change by epub is where you put all the Code:
font-family: serif; font-family: sans-serif; font-family: monospace; It could be as simple as a one-liner (after the @font-faces) saying Code:
body {font-family: serif} |
||||
03-14-2011, 08:42 PM | #9 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
... follow-up, I see I took so long to reply that others have chipped in
I can quite understand that you may not be comfortable putting customised firmware on your reader e.g. 'Russifying' or PRSPlus, but just for completeness I thought I'd add a bit more info about them as regards epub font customisation. Both of them allow you to set up a specially named .css file on your reader which contains all the @font-face statements you've decided you like. This has the benefit that you may not need to edit the .css file inside each epub at all. Where they are really beneficial is:
|
03-14-2011, 09:37 PM | #10 | |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
Quote:
If you've never changed epubs before, it's not a well-known procedure. You have to research to find some instructions, and then you have to try to understand them. We're not all born knowing all about epubs without ever having to learn anything, like you were. I'm not doing things "randomly". I tried to follow the instructions. I rechecked my work. Several times. I sought out other sets of instructions to double check. I thought I'd done it right, but it still didn't work. Perhaps the instructions are wrong? It sure wouldn't be the first time that someone on the internet was wrong. So I tried some other things. It's good to try other things before you start screaming for help - that's how you learn. I didn't know (and still don't know) where the /Data part of the path comes from, and that whole path came from the instructions that I thought might be wrong; it's not something that already existed in the CSS file. So I tried leaving it out. It didn't help, but I figured it was worth a shot, and it's easy to put back. And Jackie pointed out my syntax error with the semicolons, which I fixed by adding the suggested semicolon, and taking out the one at the end which, based on how the file looked before I edited it, I had misplaced. I got the term "Russification" from this forum, people have used it to describe the custom firmware. I haven't installed custom firmware and since I don't know how to recover if it doesn't work, I'm not going to do it at this time. Maybe later. I apologize if my vocabulary usage fails to meet your exacting standards. It's because I'm stupid, you see. Please forgive me for failing to be born with the epub spec already in my head. Now, back to the font thing. I will get this, I will... |
|
03-14-2011, 09:42 PM | #11 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
ATDrake,
I have downloaded this font and will try it. Do you know why the font file is so large? Just curious why it is 1588K vs the Times New Roman's 400K. It makes me worry that I have not got the right file for one or the other of them. But maybe it's bigger because it has more characters? I fear fonts are a bit of a black box to me. Thanks! |
03-14-2011, 09:45 PM | #12 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
The Gentium fonts are that big because they contain not only Roman (and accented Roman) characters, but also Greek and Cyrillic and IPA and maybe a few more sets, all designed to look nice together in the same typeface for multilingual usage.
The full Gentium font might possibly be overkill for your book, and I think there's a "light" version that only has the Roman+accented characters if you're worried about the space they take up. ETA: Here it is: Gentium Basic. Just the accented Latin characters and a few others. Last edited by ATDrake; 03-14-2011 at 09:47 PM. |
03-14-2011, 10:10 PM | #13 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
jackie_w,
I tried your CSS file exactly as you uploaded it, and it works! The Polish names are now rendering correctly! Yay! So I went on and tried dropping some other fonts in there using your CSS file as a starter, and some of them look really nasty. Like Georgia - it loses all the space between the words, on about 3/4 of the lines, and it can't render the place names properly either. Fonts are weird. But since I now have the place names I was looking for, I think I will just stop here. Thank you so much for your help! |
03-14-2011, 10:16 PM | #14 |
Addict
Posts: 266
Karma: 610286
Join Date: Nov 2010
Location: Michigan, USA
Device: Kobo Elipsa, Kobo Aura One, Sony PRS 650, Sony PRS 350
|
ATDrake,
That makes sense. Thank you! |
03-15-2011, 04:26 AM | #15 |
秋子 permanently lurking
Posts: 839
Karma: 6587575
Join Date: Dec 2010
Location: Europe
Device: Oasis 3, Pocketbook Era
|
I'm sitting here and taking notes. You see because ... that's my mother language and I before wouldn't buy a 650 because it would not read my letters. So it means if I have a Sony I can copy paste this css sheet (with kind permission of jackie) somewhere in the reader (a bit unclear where) and do I need to upload special font? I'm definitely saving this thread. It is a song of the future for me to have a 650 but I want to be prepared.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Foreign Language Dictionaries | Alymon | Amazon Kindle | 16 | 08-05-2014 01:44 PM |
best reader for foreign language dictionaries? | glasgow oldie | Which one should I buy? | 8 | 11-19-2011 11:11 AM |
Where are the foreign language posters? | weatherwax | General Discussions | 15 | 01-31-2011 03:02 PM |
PRS-600 foreign language dictionaries | franklekens | Sony Reader | 41 | 02-14-2010 04:03 PM |