OpenType aalt feature

Does anyone have a resource or know a list of features that can be listed in aalt?

Comments

  • I guess I didn't fully understand what Access All Alternates does.  What does enabling the features by listing under this feature actually do?
  • Bahman EslamiBahman Eslami Posts: 73
    edited January 2016
    I think all the features that contain only substitution lookup type could be added to the aalt. In a text editor it gives user access to all the alternate shapes for the selected glyph. For example in glyphs panel of indesign you can choose to see alternate glyphs for the selected character.
  • So something like this (http://opentypecookbook.com/common-techniques.html), 2nd method for fraction would not work.
  • Kent LewKent Lew Posts: 905
    All features that contain only substitution lookup types 1 or 3— aalt will ignore contextual and ligature substitutions.

    See: http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#8.a

    Function: This feature makes all variations of a selected character accessible. This serves several purposes: An application may not support the feature by which the desired glyph would normally be accessed; the user may need a glyph outside the context supported by the normal substitution, or the user may not know what feature produces the desired glyph.
    From: https://www.microsoft.com/typography/otspec/features_ae.htm#aalt


  • Kent, 

    5.c. [GSUB LookupType 3] Alternate substitution

    An Alternate Sub rule is specified as:

      substitute <glyph> from <glyphclass>;
    
    Can "sub <glyphclass> from <glyphclass>;" considered to be type 3 and thus work with aalt?
  • attarattar Posts: 209
    Yes it will, I believe. Also be careful, current makeotf silently drops invalid aalt directives https://github.com/adobe-type-tools/afdko/issues/97
  • Kent LewKent Lew Posts: 905
    Can "sub <glyphclass> from <glyphclass>;" considered to be type 3 and thus work with aalt?

    Only if <glyphclass1> has a single member.

    If <glyphclass1> has multiple members, then this syntax will fail to compile, due to the “from” keyword, which only applies to one-from-many substitutions.

  • Because aalt is there to provide access to alternate glyphs, I find it much better to just be explicit about these things and write out the "sub x from [x];" syntax for the feature, instead of using the include feature.

    If you're using a sane glyph naming scheme, this is pretty easy to script, for example:
    from robofab.world import CurrentFont
    font = CurrentFont()
    
    def rotate(l,n):
        return l[-n:] + l[:-n]
    
    alts = {}
    
    for glyph in font:
        if "." in glyph.name:
            if glyph.name.split(".")[0] is not "":
                if glyph.name.split(".")[0] not in alts:
                    alts[glyph.name.split(".")[0]] = [glyph.name.split(".")[0], glyph.name]
                else:
                    t = alts[glyph.name.split(".")[0]]
                    if glyph.name not in t:
                        t.append(glyph.name)
                        alts[glyph.name.split(".")[0]] = t
                        
    keys = alts.keys()
    keys.sort()
    for i in keys:
        s = alts[i]
        glyphs = []
        for n in s:
            if n in font.keys():
                glyphs.append(n)
        if len(glyphs) > 1:
            r = len(glyphs)
            c = 0
            while c < r:
                w = rotate(glyphs, c)
                sub = ""
                for n in w:
                    sub = sub + " " + n
                print "  sub " + w[0] + " from ["+ sub[1:] + "];"
                c += 1
    I'm sure that one can come up with something better/cleaner than this example if they wanted.
  • John HudsonJohn Hudson Posts: 2,955
    I've never bothered including the {aalt} feature in fonts, because it seems to me that software should be able to parse the other features and compile its own list of alternates. Basically, I think it's one of those features that Adobe registered in the early days of OpenType without fully considering how the technology might actually work. The use case was always given as the InDesign glyph palette which, unsurprisingly, is perfectly capable of parsing other OTL features to compile lists of alternates.
  • ty everyone
  • Joon ParkJoon Park Posts: 56
    edited January 2016
    feature name { # name
     # DEFAULT
        sub @glyphclass1 by @glyphclass2;
     script latn; # Latin
        sub @glyphclass1 by @glyphclass2;
     language AZE ; # Azeri
     language TRK ; # Turkish
     language MOL ; # Moldavian
     language ROM ; # Romanian
     language CRT ; # Crimean Tatar
    } name;
    As you see on example above, I often see features defined default then greek/cyrillic/latin multiple times even if they are same thing as default followed by languages.

    It seems redundant, is this something I should just follow?
  • Joon ParkJoon Park Posts: 56
    edited January 2016
    Wish there's a delete comment option.
  • Kent LewKent Lew Posts: 905
    That example looks like the result of opening a compiled font into a font editor. This is reflective of the actual structure of the compiled font, where each declared language gets mapped to lookups. “Cracking” open a font into a font editor usually leads to such explicit interpretations.

    But in development the redundant declarations are not necessary, as the Adobe syntax compiler will assign defaults to all relevant languages when undeclared.

    Rules that are specified after the start of a feature and before the first "script" and/or "language" statement will be included in all the language systems specified by the "languagesystem" statements.
    [ . . . ]
    Once the first script or language statement occurs within a feature block, subsequent lookups and rules are registered only within the currently specified script and language.

    From: http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#4.b.ii
  • Thank you, Kent
  • Without an aalt feature, will Illustrator's Stylistic Alternates button work?
  • As far as I know, the this button has nothing to do with the aalt feature but uses salt. 
Sign In or Register to comment.