16 Replies Latest reply on Dec 13, 2016 6:37 PM by Ellis home

    Fixed Layout ePub – OpenType features not working

    almi

      Hi,

       

      I'm working on a ePub with fixed layout using InDesign CC 2014.

      I have used some OpenType features like small caps and old style figures for numbers - but they don't appear correct in the ePub.

       

      What can I do?

       

      Thanks for your help

       

      Almute

        • 1. Re: Fixed Layout ePub – OpenType features not working
          Steve Werner Adobe Community Professional & MVP

          What reader are you using to preview? Try Readium on a Chrome browser or iBooks (Mavericks or iPad).

          • 2. Re: Fixed Layout ePub – OpenType features not working
            almi Level 1

            Hi Steve,

             

            I have tried all this three readers - everywhere the same problem.

            And I have also tried with different OpenType fonts, to be sure that it is not a single problem of a special font.

             

            Almute

            • 3. Re: Fixed Layout ePub – OpenType features not working
              Steve Werner Adobe Community Professional & MVP

              Exactly what OpenType fonts are you using. I've had no problems with OT fonts, in fact those are the ones which work the best!

               

              If possible, post the original ID file and the EPUB you created so we can test it out.

              • 4. Re: Fixed Layout ePub – OpenType features not working
                almi Level 1

                I'm using "Source sans" (an original Adobe Font), "Thesis Sans" and "Thesis Serif". All the same problems. OpenType setting are ignored or crash the text.

                 

                How can I upload files to you?

                • 5. Re: Fixed Layout ePub – OpenType features not working
                  Ellis home Level 4

                  Tested Source sans and I see no problem with lowercase. But old style for numbers doesn't work. I guess it falls under the category of changing horizontal/vertical scaling which fixed layout ignores.

                  • 6. Re: Fixed Layout ePub – OpenType features not working
                    almi Level 1

                    In my document the wrong small caps are used. You can see it clear when you write a word starting with a capital. The first letter has the correct stroke width but the small letter are too thin. This is what we call "false small caps".

                     

                    And I also wanted to use the different typesets of the OpenType font which substitute some letters with variants of the letter. This all is ignored. Every word only shows the standard variant of each letter.

                    And a very big problem: When using ligatures, all letters are pushed together and a big gap results after the word. Ligatures are very common to use in German layouts.

                    • 7. Re: Fixed Layout ePub – OpenType features not working
                      Ellis home Level 4

                      I see what you mean. This is a comparison between Indesign (first photo) and Readium. This is using Source Sans Pro with ligatures.  Maybe you can post some samples as well using the camera icon to insert the pictures.

                       

                      Indesign.JPGReadium.JPG

                      • 8. Re: Fixed Layout ePub – OpenType features not working
                        almi Level 1

                        The small caps are wrong in Source Sans Regular. This are not correct small caps . This seams to be missing in the font.

                        But in italic style you will find correct small caps. They only work in InDesign not in ePub.


                        And if you look in my images (first from InDesign, second from Radium - iBooks looks the same) you can see many difference between InDesign and ePub.

                        Note the word "pfiffig", the I at the beginning of "Igor" in second paragraph and the "a" in the italic paragraph.


                        This is very frustrating! 


                        Bildschirmfoto 2014-08-19 um 17.23.57.png.


                        Bildschirmfoto 2014-08-19 um 17.25.19.png

                        • 9. Re: Fixed Layout ePub – OpenType features not working
                          Ellis home Level 4

                          I tried to type the part in italic from your example (by the way I don't speak German so forgive me if there are any mistakes) and I don't see much trouble with spacing and the "pfiffig". Did you applied any horizontal scaling to Quax den Jet zu Bruch? This is what I get (in Readium). By the way are you using Windows or Mac?

                           

                          Germantest.JPG

                          • 10. Re: Fixed Layout ePub – OpenType features not working
                            almi Level 1

                            Hi Ellis,

                             

                            you didn't use the same ligatures I used. There are special ones with different "f".

                            I didn't apply any horizontal or vertical scalings to the text. The only thing I did is to choose "smalll caps".

                             

                            Im working on Mac, newest OS X and newest InDesign.

                            • 11. Re: Fixed Layout ePub – OpenType features not working
                              Ellis home Level 4

                              I just noticed the difference on the paragraph in italics between yours and mine. Is the paragraph in italics also Source Sans? When I use Sour Sans Pro italics it changes the characters compared to the regular version. It doesn't look like yours.

                              • 12. Re: Fixed Layout ePub – OpenType features not working
                                almi Level 1

                                This is the Thesis Sans.

                                I have used some OpenType type sets to use variants of the characters which a better in my layout. And this changes are not shown in ePub.

                                • 13. Re: Fixed Layout ePub – OpenType features not working
                                  MMCC Forensic

                                  I’ve noticed similar issues with, say, swashes not being exported.

                                   

                                  I think I found the issue: InDesign fails to export the CSS needed to tell an ePub reader (most of which are based on modern HTML5 + CSS3 rendering engines such as Gekko and Webkit) to recognize and utilize OpenType Pro features.

                                   

                                  The proper CSS for this at present (there’s a better syntax using “font-variant-[various]”, but it’s still in development and few modern browsers handle it yet even with prefixes [Firefox / Gekko is one that does implement it]) is the “font-feature-settings” attribute, like so:

                                  .myParagraphStyleAsExportedInGeneratedHTML5 {
                                    ⋮
                                    font-feature-settings: "liga", "calt", "swsh" 1;
                                    ⋮
                                  }
                                  

                                  This syntax, as I said, isn’t the best, but it’s the most powerful and works with the most rendering engines. The four-letter feature codes are simply passed as-is (along with any following numeric parameter) to the font itself. Note that Gekko defaults to enabling standard ligatures (“liga”) and contextual alternates (“calt”), but that Webkit does not, so you want to include those two even though you shouldn’t need to by default.

                                   

                                  To get at the CSS in the ePub, you can use the (free!) 7-Zip or something similar to open the .epub file as if it were a .zip archive (it is, actually), navigate to the“/OEBPS/css” folder, and edit the one-and-only .css file (“idGeneratedStyles.css”) therein (yes, 7-Zip actually lets you edit a text file right within an archive, and changes saved from the editor get re-compressed into the file! No need to rename the extension to “.zip”, extract the whole shebang, edit the one file, then re-compress the whole shebang and rename the extension to “.epub”!). Insert the “font-feature-settings” attribute with your desired parameters (see here for a more complete list) in the classes for the styles where it needs to be.

                                   

                                  I do recommend extracting the whole thing, though, so you can open individual pages in a web browser, then use its Developer Tools (both Firefox and Chrome have decent tools) to play with the CSS and make sure you get it right. You can edit the CSS right from the Developer Tools, then save it out and replace the version that was exported.

                                   

                                  Of course, the proper solution is for Adobe to fix InDesign so that it includes this CSS (and the new syntax for future compatibility) automatically in the idGeneratedStyles.css! After all, that information is already in the styles themselves,.

                                  • 14. Re: Fixed Layout ePub – OpenType features not working
                                    AnneMarie Concepcion Adobe Community Professional

                                    Cool ... you've tested this with iBooks, Readium, ADE, Kindle? Is this what you use in your own ebooks?

                                     

                                    Stuff that works in a browser often won't work in the restricted environment of the EPUB 3.0 spec.

                                     

                                    Is there a font-variant that would support numerator and denominator (to maintain the look of the OT Fractions attribute)

                                     

                                    --AM

                                    • 15. Re: Fixed Layout ePub – OpenType features not working
                                      MMCC Forensic Level 1

                                      Sorry, AnneMarie, but I didn’t see your Reply until just now.

                                       

                                      To answer your question, you can use any OpenType font feature specification using this method. To do diagonal-style fractions, assuming the font supports it, you can use "frac" (a different code, "afrc", exists for “proper” aka “stacked” or “vertical” fractions). Even a basic font should support the three most common fractions this way (¼, ½, ¾), and some others will support ⅓, ⅔, ⅕, ⅖, ⅗, ⅘, ⅙, ⅚, ⅛, ⅜, ⅝, & ⅞, and if the font has true superscript-size digits, maybe even automatically follow “⅟” with those to allow any arbitrary fraction with a numerator of “¹” (I just prefer to type all of those directly or using HTML Entities as I just did here when I need them rather than rely on CSS and OpenType to do it for me). A fully functional OpenType Pro font should allow any fraction, and automatically detect and convert them if the “frac” feature is active.

                                       

                                      A trick to get decent-looking arbitrary diagonal fractions in HTML (and thus ePub) with most any font is to do this:

                                      <sup style="font-size: 75%;">123</sup>&frasl;<span style="font-size: 67%;">654</span>

                                      which produces this result: “123654” (note that the “&frasl;” is the HTML Named Entity for a “fraction slash,” and that you may need to tweak the font-size percentages depending on font).

                                       

                                      But my main point in all of this is that Adobe InDesign itself should be smart enough to include the proper font-feature-settings (with rendering engine prefixes as needed for backwards compatibility) in its exported CSS in the ePub, according to the OpenType features enabled for each Paragraph and Character Style as specified in the .indd document (so, for instance, if you enabled “Fractions” in a Character Style called “Body Text w/Fractions,” then any text with that Character Style would be rendered as something like, say, a “<span class="body-text-w-fractions">123/654</span>” and the CSS spec for the class would detect the “Fractions” setting and thus automatically include "frac" in its font-feature-settings). It wasn’t as of CS 2015.4. I should try it with the brand new CS 2017 that just came out last month and see if they fixed this.

                                      • 16. Re: Fixed Layout ePub – OpenType features not working
                                        Ellis home Level 4

                                        Still not fixed. So we'll have to add a style sheet when exporting to ePub. Most of the browsers support "frac". It works fine on Readium and  ADE latest version (Windows desktop version and Android version); but  not on iBooks or Kindle.