Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-18-2012, 12:48 PM   #1
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
How do I get accented characters to show up in Calibre's reader?

I have an epub with a lot of accented characters for French words. They show up fine in Adobe Digital Editions on my PC and in Stanza on my Touch. But using Calibre's reader, what shows up instead of the accented character is simply the tilde character. I tried tinkering with the settings for Calibre's reader, trying different fonts, but nothing seems to change this behavior. Is there a setting somewhere I'm missing? Or is this a limitation with Calibre's reader?
PatNY is offline   Reply With Quote
Old 04-18-2012, 01:05 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by PatNY View Post
I have an epub with a lot of accented characters for French words. They show up fine in Adobe Digital Editions on my PC and in Stanza on my Touch. But using Calibre's reader, what shows up instead of the accented character is simply the tilde character. I tried tinkering with the settings for Calibre's reader, trying different fonts, but nothing seems to change this behavior. Is there a setting somewhere I'm missing? Or is this a limitation with Calibre's reader?
In the reader (on a book that shows wrong)
Right click: Inspect

What is the encoding shown on the first line?
theducks is offline   Reply With Quote
Advert
Old 04-18-2012, 02:22 PM   #3
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Hi ducks, the first line reads:

<html xmlns= "http: / / www.w3.org/ 1999 xhtml">

Is that what you're looking for? That's the first line in the left-hand pane when I click on "inspect."
PatNY is offline   Reply With Quote
Old 04-18-2012, 02:34 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by PatNY View Post
Hi ducks, the first line reads:

<html xmlns= "http: / / www.w3.org/ 1999 xhtml">

Is that what you're looking for? That's the first line in the left-hand pane when I click on "inspect."
There should be some lines before(they are dimmer), that declare the encoding used;
Code:
"?xml version="1.0" encoding="utf-8" standalone="no"?"
without an encoding statement, the viewer does not have a clue which character set to use but why does ADE get it correct?
theducks is offline   Reply With Quote
Old 04-18-2012, 03:10 PM   #5
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
ducks, there is no line above that.

Just looked at a few other books in my library and some have an encoding line with "utf-8" in it, and some do not. Some of the others that do not have that line in them are not having any problems showing the correct characters.

Both ADE and Stanza can show all accented characters correctly in this book, so I doubt that line is the issue. The book in Stanza was loaded directly from Calibre's content server too, so it's exactly the same.
PatNY is offline   Reply With Quote
Advert
Old 04-18-2012, 03:27 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
No other ideas.
theducks is offline   Reply With Quote
Old 04-18-2012, 05:21 PM   #7
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
I'm grasping at straws, but is there a special named font in the epub's css, i.e. font-family:"special name";
rather than a more generic font-family:serif or font-family:sans-serif?

Is it possible you have the named font on the reader but not the PC?
jackie_w is offline   Reply With Quote
Old 04-18-2012, 05:29 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jackie_w View Post
I'm grasping at straws, but is there a special named font in the epub's css, i.e. font-family:"special name";
rather than a more generic font-family:serif or font-family:sans-serif?

Is it possible you have the named font on the reader but not the PC?
Oooo!
theducks is offline   Reply With Quote
Old 04-18-2012, 07:10 PM   #9
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Quote:
Originally Posted by jackie_w View Post
I'm grasping at straws, but is there a special named font in the epub's css, i.e. font-family:"special name";
rather than a more generic font-family:serif or font-family:sans-serif?

Is it possible you have the named font on the reader but not the PC?
Yay, success! Thanks, Jackie ... The CSS sheet was calling for AGaramond, serif. I used tweak epub to edit out all references to the font family, and now the accented characters show up just fine.

I was also having this same problem with another book but it was with fractional numbers (ie, 1/2, 1/4 ... it is a cookbook!) not appearing and instead only a tilde showed up. The CSS in that epub was calling for Charis. On this book I just did an epub-to-epub conversion and simply filtered out all font-family references by using the option under the "Look and Feel" tab. Fractions now show up fine in Calibre's reader.

Note that I don't have the named fonts on either my Windows operating system or in Stanza on the Touch. The reason the accented characters show up on Stanza is because the app is designed to purposely ignore all font-families called for in a CSS and just use whatever font family you specify in Stanza's own settings instead. I'm not sure what Adobe Digital Editions does but I suspect it is essentially doing the same thing as Stanza.

So here's a question I have for the developers of Calibre: If a font family is specified in an epub's CSS, but the font files themselves are not in the epub, why won't the Calibre reader default to the font specified in the reader's settings? I have no idea what font it's using now in these instances, but it's not the one I chose in the settings for Calibre's reader. For example, I set it to "Georgia" for both serif and non-serif fonts, and chose "serif" to be the Standard font. But the books with this issue will show all non-serif fonts. It looks like some sort of basic Windows default font, which I'm guessing is why special characters such as fractions and accents won't display. Can this behavior be changed?
PatNY is offline   Reply With Quote
Old 04-18-2012, 08:22 PM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
That font family had a fall back(s) appended to the list (serif),. I wonder why that failed

AGaramond sounds like an Apple variant, having a few more common (reader) fonts on the list might help (along with the matching @font {.... )


NB 1/2, 1/4 are vulgar fractions on some charts ( &frac12; &frac14; &frac34; )
theducks is offline   Reply With Quote
Old 04-18-2012, 11:32 PM   #11
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: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by PatNY View Post
So here's a question I have for the developers of Calibre: If a font family is specified in an epub's CSS, but the font files themselves are not in the epub, why won't the Calibre reader default to the font specified in the reader's settings? I have no idea what font it's using now in these instances, but it's not the one I chose in the settings for Calibre's reader. For example, I set it to "Georgia" for both serif and non-serif fonts, and chose "serif" to be the Standard font. But the books with this issue will show all non-serif fonts. It looks like some sort of basic Windows default font, which I'm guessing is why special characters such as fractions and accents won't display. Can this behavior be changed?
The reader uses a font matching algorithm to find the "closest" match to the font specified in the CSS. On windows that algorithm sucks. Unfortunately, there is no way to turn it off as it's a toolkit level thing, short of patching Qt. Which is too much work.
kovidgoyal is offline   Reply With Quote
Old 04-19-2012, 02:21 PM   #12
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Ahh, ok. At least I know what the issue is now and how to easily fix it. Thanks for your reply, Kovid.
PatNY is offline   Reply With Quote
Old 04-23-2012, 05:30 PM   #13
addressee
Member
addressee began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2011
Device: iPod Touch 4g
Just to stretch this thread through another question/example of rendering accented characters...

A book I am reading uses french characters including the "grave accent"/accent grave such as "à" (small letter 'a' with grave) which is not rendered correctly in the Calibre Ebook viewer.

The CSS sheet calls for "font-family : Georgia, serif;" which is available to both Windows7 and Stanza on my iPod. The book and character renders correctly in Stanza, Sigil, Adobe Digital Editions, Firefox, etc., but not in the Calibre Ebook viewer, where it appears as "è". This is also how the character appears in the Web Inspector.

The Calibre viewer config specifies Georgia for the serif family; my user stylesheet does not specify a font.

Is Qt also at fault here for this generic font?
Is there anything a reader or publisher can do to ease this situation?

Thanks.
addressee is offline   Reply With Quote
Old 04-23-2012, 08:58 PM   #14
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Without seeing the epub this is only a guess, but I quite often see something similar if the html file containing the 'wrong' chars (usually curly quotes for me) has an incorrect encoding statement at the top in the html header. Epubs are supposed to always be utf-8. I often find something like charset=iso-8859-1, which I manually edit to charset=utf-8. It then looks OK in the calibre viewer. If this is the problem there's a good chance it's wrong in every html file in the epub.

Last edited by jackie_w; 04-23-2012 at 09:02 PM.
jackie_w is offline   Reply With Quote
Old 04-23-2012, 10:42 PM   #15
addressee
Member
addressee began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2011
Device: iPod Touch 4g
All html files plus the toc.ncx and content.opf are encoded utf-8:

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
Reading the document further and examining the book further I've found that the character is sometimes rendered correctly, sometimes in error. In fact, in Calibre's Ebook viewer, it is rendered correctly more often than not: just 2 errors that I happened to strike upon early.

I am sure you are on to something examining at the internal file level, if not at the style level. At the header level, the html docs are identical except for the <title> declaration.

It's more of a puzzle than an annoyance: works OK across multiple tools, yet 2 errors only in perhaps 20 occurrences in one viewer only.

Thanks for your input.


The two styles where the character is incorrectly rendered:

Code:
p.badstyle1 {
	font-family : Georgia, serif;
	font-weight : normal;
	font-style : normal;
	font-size : 1.08em;
	text-decoration : none;
	font-variant : normal;
	line-height : 1.85;
	text-align : left;	 
	text-indent : 0px;
	margin : 0px;
}

p.badstyle2 {
	font-family : Georgia, serif;
	font-weight : normal;
	font-style : normal;
	font-size : 0.85em;
	text-decoration : none;
	font-variant : normal;
	line-height : 1.36;
	text-align : left;
	text-indent: 0px!important
}
Examples of styles where the character is correctly rendered:

Code:
p.goodstyle1 {
	font-family : Georgia, serif;
	font-weight : normal;
	font-style : normal;
	font-size : 0.92em;
	text-decoration : none;
	font-variant : normal;
	line-height : 1.36;
	text-align : left;	 
	text-indent : 15px;
	margin : 0px;
}

p.goodstyle2 {
	font-family : Georgia, serif;
	font-weight : normal;
	font-style : normal;
	font-size : 0.92em;
	text-decoration : none;
	font-variant : normal;
	line-height : 1.36;
	text-align : left;	 
	text-indent : 15px;
	margin : 8px 0px 0px 0px;
}
addressee is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
For the sake of accented characters with Calibre Naga Conversion 6 07-02-2011 07:48 AM
Hungarian accented characters 'ő' and 'ű' show up as '?' bupe Calibre 5 04-17-2010 05:50 AM
Error converting accented characters into LRF with calibre Seabound Calibre 5 10-19-2008 12:15 AM
PRS-500 Accented characters onto reader using Mac squiggle8 Sony Reader Dev Corner 9 12-06-2007 04:01 PM
Accented characters bingle Sony Reader 7 07-25-2007 06:36 AM


All times are GMT -4. The time now is 03:10 PM.


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