Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-14-2012, 10:30 PM   #1
northstar7
Member
northstar7 began at the beginning.
 
northstar7's Avatar
 
Posts: 11
Karma: 10
Join Date: Apr 2012
Device: Kindle
Problem embedding font for Sanskrit

I have been trying to embed the Liberation font in an ebook that includes quotations in Sanskrit, which include a lot of diacritical marks.

The marks appear in a few readers, but not in ADE. I have tried many different things, but the letters with diacriticals appear as rectangles with X's inside or they're just blank.

I have read that the Liberation font includes a large number of unicode glyphs and that it should work for this application. However, when I have downloaded the font -- multiple times -- I sometimes see that only about 700 glyphs are included. I am wondering if it could be that I'm not getting the glyphs I need.

If anyone can help me figure this one out, I'd be very grateful. I'd be happy to post what I'm doing if it seems like it would help.

Does it matter whether I use ttf or otf version?

Thanks a lot.
northstar7 is offline   Reply With Quote
Old 05-15-2012, 02:42 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
The first action would be making sure the font contains the glyphs you need. Then, if you embed the font correctly, it will work in ADE.
A few pointers:
1. mind the case of font-name. Not only the file, but also the name and family itself.
2. make sure you specify the @font-face correctly
3. make sure you specify the font in a class attached to the text
Toxaris is offline   Reply With Quote
Old 05-15-2012, 03:07 AM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
ADE can handle combined glyphs. Most likely your problems were caused by the font. For example Annapurna SIL works fine, but contains only basic Devanagari characters.
Attached Files
File Type: epub Devanagari.epub (324.7 KB, 400 views)

Last edited by Doitsu; 05-15-2012 at 03:14 AM.
Doitsu is offline   Reply With Quote
Old 05-20-2012, 12:15 PM   #4
northstar7
Member
northstar7 began at the beginning.
 
northstar7's Avatar
 
Posts: 11
Karma: 10
Join Date: Apr 2012
Device: Kindle
Hi. Thanks very much for your replies. They are very helpful.

However, there are two points you mention that I have been unable to figure out. I've googled them both with no luck.

The first is: How do you confirm that a particular glyph exists in a font? The best I've been able to do on this is to open Word, choose the font and enter the unicode for the glyph. Unfortunately, I've found that while the glyph appears in Word, it's still missing in ADE.

Second: Where can I find the exact name of the font that should be used in the CSS. The only approach I've been able to find is to open the font in a text editor. However, this doesn't reveal very much.

Any suggestions as to how to carry out these two tasks would be much appreciated.

Thanks
northstar7 is offline   Reply With Quote
Old 05-20-2012, 01:05 PM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by northstar7 View Post
The first is: How do you confirm that a particular glyph exists in a font? The best I've been able to do on this is to open Word, choose the font and enter the unicode for the glyph. Unfortunately, I've found that while the glyph appears in Word, it's still missing in ADE.
I guess the best way is to open the font with a font editor such as FontForge

Quote:
Second: Where can I find the exact name of the font that should be used in the CSS. The only approach I've been able to find is to open the font in a text editor. However, this doesn't reveal very much.
You can use whichever name you want, but you have to define it and embed the font file(s) in the ePub, like this:

Code:
@font-face {
  font-family: "Roman Antique";
  font-weight: bold;
  font-style: normal;
  src: url("../fonts/RomanAntique-Italic.otf") format("opentype");
}

h1, h2, h3 {
  font-family: "Roman Antique";
  font-weight: bold;
}
The bold parts have to match, but they could say "foobar" or whatever. Note that in the @font-face block I'm defining the "Roman Antique" bold upright (not italic) font to use the RomanAntique-Italic.otf file, if I have different files for regular and italic variants, I should define each of them, all with the same font-family.
Jellby is offline   Reply With Quote
Old 05-20-2012, 01:08 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by northstar7 View Post
The first is: How do you confirm that a particular glyph exists in a font?
You can use BabelMap to see all glyphs or simply use the Annapurna SIL Devanagari font that I suggested.

Quote:
Originally Posted by northstar7 View Post
The best I've been able to do on this is to open Word, choose the font and enter the unicode for the glyph. Unfortunately, I've found that while the glyph appears in Word, it's still missing in ADE.
ADE, will only display the glyph if you correctly embed it in the ePub. Open your ePub with Sigil and click the green checkmark to find out, if your font is actually correctly referenced.

Quote:
Originally Posted by northstar7 View Post
Second: Where can I find the exact name of the font that should be used in the CSS. The only approach I've been able to find is to open the font in a text editor. However, this doesn't reveal very much.
You can use any name that you like. The only thing that ADE cares about is that the font path is correct. For an example, open my Devanagari ePub with Sigil.
Doitsu is offline   Reply With Quote
Old 07-09-2012, 09:51 AM   #7
caraka
Junior Member
caraka began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2012
Device: Nook Color CM10
@northstar7

I too am working on an ebook that embeds romanized sanskrit with lots of diacriticals. I have embedded Libertine successfully and the Sigil validation passes the epub and the embedding works in my Nook and other android readers I use, but not ADE. Have you had any joy?
FYI, the devanagari script isn't included in Linux Libertine, but the Latin Extended Additional segement IS included. (It contains all the less common diacriticals you may be searching for, such as ṛ, ḥ, ṅ etc.)
caraka is offline   Reply With Quote
Old 07-09-2012, 09:53 AM   #8
caraka
Junior Member
caraka began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2012
Device: Nook Color CM10
Lol @northstar7
lets just say that was n-dot-above, h-dot-below and s-dot-below!
It will be useful when forum software supports unicode too!
caraka is offline   Reply With Quote
Old 07-10-2012, 04:05 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
You mean ṅ, ḥ, ṣ? Those are supported all right by the forum, it must be something with your copy-pasting...
Jellby is offline   Reply With Quote
Old 07-10-2012, 08:37 AM   #10
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by caraka View Post
@northstar7

I have embedded Libertine successfully and the Sigil validation passes the epub and the embedding works in my Nook and other android readers I use, but not ADE.
I doubt that it has been embedded correctly to be honest. ADE supports embedding fonts quite well, so if it doesn't work on ADE either the font doesn't work on ADE (which is rare, but happens) or the font-embedding is not quite correct.

With ADE you must really mind you p's and q's with regards to the stylesheet. A small mistake in the stylesheet will make ADE ignore the stylesheet and thus font embedding. Try to validate your stylesheet.
Toxaris is offline   Reply With Quote
Old 07-17-2012, 11:10 PM   #11
caraka
Junior Member
caraka began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2012
Device: Nook Color CM10
Thanks Toxaris. I have validated with http://jigsaw.w3.org/css-validator/validator and all is well with the css, but not withing ADE. Any other suggestions? (Or perhaps another validator to suggest?)
caraka is offline   Reply With Quote
Old 07-18-2012, 02:47 AM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Can you post your stylesheet and a part of the XHTML which you want to display in that font? Please note, I would like to see the code of the XHTML page.
Toxaris is offline   Reply With Quote
Reply

Tags
ade, diacricitals, fonts, sanskrit

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Solution for Converting Devnagari (Sanskrit/Hindi) or other font book to epub Sanjay Agnihotri ePub 4 05-01-2020 06:44 PM
Font embedding sachin Sigil 3 03-21-2012 09:19 AM
Problem embedding font into an ePub mvo ePub 16 01-03-2012 07:10 PM
Do I need a font license if all I'm doing is referring to the font (not embedding)? Stodder Workshop 21 04-21-2011 04:19 AM
Another font embedding problem b.tarde EPUBReader 12 03-11-2010 01:40 PM


All times are GMT -4. The time now is 07:58 AM.


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