View Single Post
Old 12-29-2009, 10:27 PM   #74
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 973
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Quote:
Originally Posted by awp View Post
But I have another question. Is it possible to embed a font with a Chinese name into an EPUB manually so that this EPUB displays correctly in ADE and Sony Reader? Have you tried embedding "華康儷中宋(P)" in an EPUB manually (without modifying the TTF file)? If so, did it work?
Yes. I can embed Chinese TTF (with Chinese font-family name) into epub. Inf fact, it's the only way to display Chinese glyphs in ADE. Chinese glyphs in epub without a embedding font will be "?". Here is an working example:
Code:
@font-face {
  font-family : MyFont;
  font-weight : normal;
  font-style: normal;
  src : url(font.ttf);
}
body{margin-left:5%;margin-right:5%;margin-top:5%;margin-bottom:5%;background:Black;color:white}
p{text-indent:4em;margin-left:0;line-height:26pt;margin-right:0;margin-top:0;margin-bottom:15pt;font-family: MyFont;font-size:150%;line-height: 120%}
.p0{text-indent:0;margin-left:0;line-height:1;page-break-before:always}
.p2{text-indent:-0.31in;margin-left:0.92in}
.p3{text-indent:-0.5in;margin-left:1.11in}
.t0{font-family:Wingdings;font-size:255%}
.t1{font-size:255%}
.t2{font-family:Wingdings;font-size:218%}
.t3{font-size:218%}
.t6{font-family:MyFont}
.t7{text-decoration:line-through}
.t8{font-family:MyFont}
.t9{background:yellow}
.t10{background:yellow}
.t11{font-family:MyFont;background:yellow}
In fact, Chinese font-family name does not matter in this case. I just renamed the filename to "font.ttf“ for simplicity.

The attached image is the result of epub in ADE without embedding font. TOC is ok, but contents is all "?".
Attached Thumbnails
Click image for larger version

Name:	ADE.JPG
Views:	311
Size:	366.6 KB
ID:	42152  

Last edited by ericshliao; 12-29-2009 at 10:31 PM.
ericshliao is offline   Reply With Quote