Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2012, 05:33 PM   #1
Abelinkin
Junior Member
Abelinkin began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2012
Device: ipad
ePub CSS @fontface Unicode chars render in <td>, not in <div>, other elements

Hi,

I'm working on a project to convert several hundred thousand life sciences articles into epub format, and we have run in to a problem with character entities.

Being that these are scientific articles, the characters are from a wide range of Unicode charts, and are essential to transmitting the meaning of the data.

The problem is that in my epub, the character entity inside a table data cell is rendering the @font-face correctly, but inside any other HTML element, the character renders as an empty box on our ipad2s.

So inside div@class="stix", we see boxes, inside td@class="stix", we see the character rendered properly.

Code:
      <div class="stix">Let &#x1d542; be a field, which will be either the complex numbers &#x02102; or the finite field &#x1d53d;</div>
      <table id="t31" rules="all">
        <tr>
          <td>&#x1d542;</td>
          <td class="stix">&#x1d542;</td>
          <td>U+1D542 MATHEMATICAL DOUBLE-STRUCK CAPITAL K </td>
        </tr>

My CSS looks like this:

Code:
@font-face {
    font-family: 'STIX';
    src: url('STIX-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    unicode-range:  U+02B0-02FF, U+07C0-07FF,  U+0900-097F,U+0F00-0FD8, U+1D00-1D7F, U+1D80-1DBF, U+1D400-1D7FF, U+1E00-1EFF, U+1F00-1FFE,U+2000-206F, U+20A0-20B8, U+20D0-20F0, U+2300,23FF, U+25A0-25FF, U+2600-26FF, U+27C0-27EF, U+27F0-27FF, U+2900-297F, U+2A00-2AFF, U+2B00-2B59, U+2C60-2C7F ;
}
@font-face {
    font-family: 'STIX-Math';
    src: url('STIXMath-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    unicode-range:  U+02B0-02FF, U+07C0-07FF,  U+0900-097F,U+0F00-0FD8, U+1D00-1D7F, U+1D80-1DBF, U+1D400-1D7FF, U+1E00-1EFF, U+1F00-1FFE,U+2000-206F, U+20A0-20B8, U+20D0-20F0, U+2300,23FF, U+25A0-25FF, U+2600-26FF, U+27C0-27EF, U+27F0-27FF, U+2900-297F, U+2A00-2AFF, U+2B00-2B59, U+2C60-2C7F ;
}
 
 
.stix   {
        font-family: "STIX", "STIX-Math", sans-serif;
}

Is it possible that this is a rendering bug, because the character is rendering in the table cell, but not in other elements?

Have I missed something obvious?

Thanks,
Abe
Abelinkin is offline   Reply With Quote
Old 06-05-2012, 02:09 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
No, not really. You don't need the 'unicode-range' attribute though, nor the format part of the src.
iBooks is a little peculiar in font embedding. You need an additional file in your META-INF folder, called com.apple.ibooks.display-options.xml. For more info see the excellent article here.

This being said, not all fonts render correctly in readers. Some fonts just won't always work. Some don't in ADE and some don't in iBooks. Try if it works in ADE. If it doesn't, try another font.
Toxaris is offline   Reply With Quote
Advert
Old 06-05-2012, 04:24 AM   #3
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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I believe iBooks has some funny concept of CSS... try with <div><span class="stix"> instead of <div class="stix">

And why are you using both STIX and STIX-Math? If you have:

font-family: "STIX", "STIX-Math", sans-serif;

since you are embedding the two fonts, only the first will be used...
Jellby is offline   Reply With Quote
Reply

Tags
@fontface, character_set, ipad, rendering, unicode


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch CSS pseudo-elements in an EPUB: Supported? Benjamin Buford Kobo Reader 10 07-07-2011 03:08 AM
PDF->epub: double l chars changed bobkoure Conversion 1 05-02-2011 10:05 PM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM
Styling Elements in CSS - ADE and Sony toskpro Sony Reader 0 07-19-2010 01:55 PM
unicode chars in epubs after flashing hakim Sony Reader 4 10-12-2009 08:33 AM


All times are GMT -4. The time now is 10:35 AM.


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