4 Replies Latest reply on Nov 25, 2014 1:40 PM by Jacob Finkelstein

    Using alternate glyphs in a paragraph style

    Jacob Finkelstein Level 1

      Hi Everyone,

      I'm try to use alternate glyphs in a paragraph style.

       

      The default (1) glyph in the font I'm using looks like a bar (I) and the brand guidelines for this project require all instances the 1 to have look like a 1 with the bar coming down at the upper terminal. The font I'm using (Gill Sans MT Pro) does have an alternate glyph and I was able to do this before but for some reason it's not working now.

       

      Here's what I did last time: I added the alterante glyph to a glyph set and then set "stylisitic sets" to set 1 in the opentype features section of the paragraph style. For some reason it didnt work this time.

       

      Let me know if you have any ideas. Thanks for your help!

       

      Jacob

        • 2. Re: Using alternate glyphs in a paragraph style
          Mary Posner Level 3

          Huh. I can get that to turn on and off for a paragrah style via script:

           

          set myPara to paragraph style "Body"

          set OTF stylistic alternate of myPara to true

           

          ... but I don't see where to set that in the GUI in CS5.5. It does affect the appearance of the type and does show up in the General > Style Settings pane of the Paragraph Style Options panel, but I can't see where to set that manually.

          1 person found this helpful
          • 3. Re: Using alternate glyphs in a paragraph style
            Jacob Finkelstein Level 1

            It's been a while and I've learned a few things.

             

            •the Glyph Sets in the Glyph pallete have nothing to do with paragraph style. Their only purpose is to create little libraries of glyphs that are saved in InDesign. You cannot apply glyph sets to paragraph styles

             

            •stylistic sets are built into OpenType font files by the font designer. If a font contains a stylistic set, it appears in the glyph pallete's "show" pulldown menu.

             

            •The reason why checking off "stylistic set 1" worked for me was because the font I was using has a stylistic set that contained the glyph I needed (ironically it was the only glyph in the set)

             

            I had this problem again in a different file and for some reason my method wasn't working so I tried to move everything into a new file where my method was working. Last night when I saved that new file everything looked good. When I opened it this morning, the wrong glyph was being used but my paragraph syle was how I left it. Go figure.

             

            With help from a coworker, I built an applescript out of the code Mary pasted (it wasn't obvious to me that what she pasted was not the entire script). So basically Mary's script worked for me this time becasue luckily, the 1 glyph I want was set as a stylistic alternative (this is decided by the font designer).

             

            If anyone is having this problem just paste the following into Applescript Editor:

             

            tell application "Adobe InDesign CS6"

                      tell active document

                                set myPara to paragraph style "b1"

                                set OTF stylistic alternate of myPara to true

                      end tell

            end tell

             

            Right now the script only works for a style that's called b1. Also, if the style is in a folder (style group), the script will not work. Of course, you can edit the script and move your style to the root level and then run the script.

             

            I think it would be great if we could figure out a way to make the script to target a selected Paragraph Style so the script doesn't have to be edited all the time.

             

            Thanks for your help Mary!!!

            • 4. Re: Using alternate glyphs in a paragraph style
              Jacob Finkelstein Level 1

              It's been a longer while and I've figured out how to target a paragraph style that is in a paragraph style group. Here is the code:

               

              tell application "Adobe InDesign CS6"

                        tell active document

                                  set myPara to paragraph style "b1"

                                  set OTF stylistic alternate of myPara to true

                        end tell

              end tell


              The important line of code that we are dealing with is:

              set myPara to paragraph style "b1"


              If you want to target a style that is inside a paragraph style group you just add on:

              of paragraph style group "2"


              So that line of script would look like this:

              set myPara to paragraph style "b1" of paragraph style group "1"

              (right now this script is defining the myPara variable as the paragraph style "b1" which is in the style group named "1")


              In addition, you can target paragraph styles that are located in style groups within style groups. Here's how to target one.

              set myPara to paragraph style "b1" of paragraph style group "2" of paragraph style group "1"

              (right now this script is defining the myPara variable as the paragraph style "b1" which is in the style group named "2". Style group "2" is located inside style group "1")

               

              Note that when targeted a paragraph style that is inside of a group within a group you have to indicate the group that the style is placed in and move upward. For example if I'm targeting style x which is in group 3 and group 3 is in group 2 and group 2 is in group 1, I would write the following:

              set myPara to paragraph style "x" of paragraph style group "3" of paragraph style group "2" of paragraph style group "1"


              I tried targeting 3 levels down and it worked, although I'm sure going deeper would work also. There's no reason why it shouldn't


              Note that this script works for character styles too. Just substitute every instance of "paragraph" in the script for "character"


              By the way, styles are case sensitive so make sure you use the same case in the script as in your style  and style group names.


              I hope this helps someone!