17 Replies Latest reply on May 31, 2016 3:00 PM by Dirk Becker

    OpenType feature

    hiddenfist

      Hello,

       

      I'm using Glyphs App to create my own typeface. I created a OpenType feature called "falt" which stands for Final Glyph on Line Alternates.. and what it does is replace final glyph one the line with an alternate.

      The feature works perfectly in Glyphs but I can't find any solution to use it in InDesign.

      I'm working on Mac, with InDesign CS 6.

       

      Let me know if there is any solution?

        • 1. Re: OpenType feature
          Peter Spier Most Valuable Participant (Moderator)

          Maybe Contextual Alternates?

          • 2. Re: OpenType feature
            hiddenfist Level 1

            Not working

            • 3. Re: OpenType feature
              Peter Spier Most Valuable Participant (Moderator)

              The font must be properly built, and I'm not font expert, but that would be the way ID accesses alternate glyphs.

              • 4. Re: OpenType feature
                hiddenfist Level 1

                How this could be solved than? InDesign script?

                • 5. Re: OpenType feature
                  [Jongware] Most Valuable Participant

                  hiddenfist wrote:

                   

                  How this could be solved than? InDesign script?

                   

                  No - or at least, not directly. The problem is that InDesign does not support all possible OpenType features. In addition, 'falt' is primarily a feature "intended for or exclusively required by West-Asian (Semitic, Arabic) and other cursive scripts or fonts", so even if InDesign offered that option, it could be excused for not applying it to non-Arabic text. Compare for example the 'isol', 'init', 'medi', and 'fina' forms of characters, which are meant to be used only for Arabic.

                   

                  It may be possible to do this using a script: find the character(s) you want to change, check if they are at the end of a line, then replace it with the correct glyph from your font. Changing glyphs is hard, though. (I cannot recall if it's only "hard" or straight up impossible. I have zero scripts that do this, in my current list of 391 script.)

                   

                  Since you are still in the 'design' stage, can you easily add the glyph to a feature that InDesign does support, such as one of the Stylistic Sets? If you do, you "only" have to apply that set to the last character of a line.

                  • 6. Re: OpenType feature
                    Dirk Becker Level 4

                    You can invoke most OpenType features even if they aren't backed by an InDesign feature (e.g. dedicated attribute or composer logic). The glyphs panel does exactly that when you manually pick such a glyph - it prefers the appropriate attributes, falls back to the generic "opentypeFeatures" attribute and finally may even specify the glyph by ID - also scriptable via a different text attribute.

                     

                    As I don't have a font with that particular feature I can't tell for sure that the InDesign type rendering engine supports it, but if you  just use a GSUB you should be ok. With the same "opentypeFeatures" text attribute I could for example activate character variants from the sil.org Scheherazade font. Btw. the 'cv..' feature could be a nice secondary way to expose those glyphs. I love that you can assign names to the character variant itself and also name each alternative therein.

                     

                    Note that the "opentypeFeatures" attribute is one of a few that can't be included in styles.

                    The following single line script should get you started:

                    app.selection[0].opentypeFeatures=[["falt",1]];

                     

                    If you prefer a UI with preview and so forth, I have an old pet project for that. Have a look at the Twitter page for some screenshots and contact me directly if you want to give it a try - CS6 is no problem. I still have to add support for OT features with multiple choices, though. I'm not sure whether that should include 'falt'?

                     

                    Cheers,

                    Dirk

                    • 7. Re: OpenType feature
                      MW Design Level 4

                      In ID you'll be better off moving the lookup into contextual alternates, which has ID does support. I don't know anything about the application you are using. But I would add a table to the chaining context lookup the various possibilities that you would want the end of word character to appear. So I would add the space, full stop, various other punctuation, that sort of thing.

                       

                      That should allow ID to swap out the characters that falt would otherwise work on.

                       

                      Mike

                      • 8. Re: OpenType feature
                        MW Design Level 4

                        BTW, I once downloaded a font originally by Jim Lyles, and was modified by Adam Twardoch. The font is used to test OT Features in applications.

                         

                        As you know, features are 4 letter codes. The font uses a string of 2 letters and substitutes those 2 letters with the 4 letter feature code if the feature is supported in any particular application. The screen shot below is from inside ID. Any supported feature has the 2 letter code replaced with the 4 letter feature code.

                         

                        Capture-000042.png

                        As you can see, there are a number of features not possible in ID. The feature you wish to use appears above by the 2 letter code, ay. Other layout applications support more, some support fewer, OT features. None that I have support falt that I know of.

                         

                        Mike

                        • 9. Re: OpenType feature
                          Dirk Becker Level 4

                          Mike,

                           

                          thanks for mentioning the test font - the URL is http://www.twardoch....yezhdaSLOne.zip

                          Using my approach of above (actually via the plugin, but you could do it via script too) I got to this screenshot (using CC.2015):

                           

                          Bildschirmfoto 2016-02-04 um 08.47.35.png

                          If I spend a bit more time I'm sure I can enable the missing ones too - e.g. those with multiple choice (aalt, ornm and others), or invalid ones such as ss21.

                           

                          Dirk

                          • 10. Re: OpenType feature
                            MW Design Level 4

                            Pretty cool, Dirk!

                             

                            So what's the plug-in? Will it be available at some point?

                             

                            Mike

                            • 11. Re: OpenType feature
                              Dirk Becker Level 4

                              Mike,

                               

                              the plugin is a partial implementation of UI ideas that floated around in 2014 along the #AdobeTypeUI petition - I wrote a large share of it before I even was aware of the petition. Development stalled later when I assumed Adobe would deliver something similar. If you're interested anyway please send me a direct message with your email address and your InDesign version (for now Mac only, CS5 or later), and I will send you a copy. I'm especially interested in critical testers, and might spend some more time on it ...

                               

                              Dirk

                              • 12. Re: OpenType feature
                                Dirk Becker Level 4

                                Here is another screenshot, I found the remaining toggles for the features that I had missed this morning.

                                The only features missing for now are aalt (as multiple choice it shouldn't be a toggle), dflt (not sure why I omitted it) and ss21/ss22 (not in spec). On the other hand I could name several more OpenType features unused in the font, starting with cv00 thru cv99, but also exotics such as ovlp, strr and strl, cpct, jp03, pkna ...

                                Bildschirmfoto 2016-02-04 um 16.51.24.png

                                Dirk

                                • 13. Re: OpenType feature
                                  MW Design Level 4

                                  Hi Dirk--thanks for the offer, but I use Windows.

                                   

                                  It's interesting that they can be turned on but the ID team hasn't gotten around to implementing the requisite changes in the ID UI. It doesn't affect me too much as most of the time I use a broad amount of features in in mag ads or such things, and then I'll use CorelDDraw (for it's great its handling of stylistic alternates). These may or may not then be placed in a layout application.

                                   

                                  This is a screen shot from Serif's PagePlus. It handles (in the UI) a broader range of OT features, though still not the falt in question. But it also has no facility in recent versions for rtl languages (there was a company that was making mods for rtl, stopped 4 versions back iirc).

                                   

                                  Capture-000040.png

                                  I don't know if Adam is interested in expanding the font for yet other OT features. If he isn't I would be willing to add those features for testing.

                                   

                                  Mike

                                  • 14. Re: OpenType feature
                                    Sami Artur Level 1

                                    Hi Dirk,

                                    thank's for the tip.

                                    Please How do You do to turn off the expression: "app.selection[0].opentypeFeatures=[["falt",1]];"

                                    In opentype features indesign directly suport I use a script like this:

                                    main ();

                                     

                                     

                                    main ();

                                     

                                     

                                    function main ()

                                      {

                                      try

                                      {

                                      if (app.selection[0].otfStylisticAlternate == true)

                                      app.selection[0].otfStylisticAlternate = false;

                                      else

                                      app.selection[0].otfStylisticAlternate = true

                                      }

                                      catch (_){}

                                      }

                                     

                                    But this does not work with [["falt",1]]

                                    Any help would be great.

                                    Sami

                                    • 15. Re: OpenType feature
                                      Dirk Becker Level 4

                                      Hi Sami,

                                       

                                      assuming you only need that single OpenType feature:

                                       

                                      if( app.selection.length ) // do we have a selection?

                                      if( app.selection[0].hasOwnProperty("opentypeFeatures") ) // does the selection support "openTypeFeatures"?

                                      if( app.selection[0].opentypeFeatures.toSource()=="[[\"afrc\", 1]]" ) // are alternate fractions enabled?

                                        app.selection[0].opentypeFeatures = []; // reset to nothing

                                      else

                                        app.selection[0].opentypeFeatures =[["afrc", 1]]; // set them!

                                       

                                      Note that with the additional checks I eliminated the need for try/catch.

                                       

                                      If you need multiple OpenType features in parallel, and if you want to toggle them individually, that would be some more complicated string expression after "toSource()" or you have to iterate the array. On the other hand a thorough solution would also consider each text style run of the selection separately.

                                       

                                      Dirk

                                      1 person found this helpful
                                      • 16. Re: OpenType feature
                                        Sami Artur Level 1

                                        Thank You very much Dirk!

                                        It works nicely!

                                        If You need any help with a font with opentype features or add a opentypefeature to a font, my specialty is microsoft VOLT.

                                        Sami

                                        • 17. Re: OpenType feature
                                          Dirk Becker Level 4

                                          Thanks for the kind offer. I've reduced my activities regarding OpenType when that mentioned pet project of an OpenType palette plugin has only received lukewarm interest even by folks with a typographic background, while Adobe's own progress (that selection popup thingy) also improved the situation in the application.

                                           

                                          Anyway, this Thursday I'll demo the plugin at the Hamburg IDUG, maybe they give me a reason to revive it.

                                           

                                          Dirk