2 Replies Latest reply on Jan 6, 2011 1:20 PM by chughes133

    appliedFont not working for a certain font

    chughes133 Level 1

      Hello all,

      a small but strange problem here. that only exists with a certain font. a shortened version of the script (as it pertains to the discussion) is here. It loops through paragraph styles looking for certain values and changes them:

       

                          else if (appliedFont.fontFamily== "Myriad Pro"){
                              appliedFont= "Yakout Linotype";
                              if (fontStyle== "Regular"){
                                  fontStyle= "Light";}
                              else if (fontStyle== "Semicondensed"){
                                  fontStyle= "Light";}
                              else if (fontStyle== "Semicondensed Italic"){
                                  fontStyle= "Light";
                                  skew= -15;}
                              else if (fontStyle== "Italic"){
                                  fontStyle= "Light";
                                  skew= -15;}
                              else if (fontStyle== "Semibold"){
                                  fontStyle= "Bold";}
                              else if (fontStyle== "Semibold Semicondensed"){
                                  /fontStyle= "Bold";}
                              else if (fontStyle== "Semibold Semicondensed Italic"){
                                  fontStyle= "Bold";
                                  skew= -15;}                       
                              else if (fontStyle== "Semibold Italic"){
                                  fontStyle= "Bold";
                                  skew= -15;}
                              else if (fontStyle== "Bold"){
                                  fontStyle= "Bold";}
                              else if (fontStyle== "Bold Italic"){
                                  fontStyle= "Bold";
                                  skew= -15;}

       

      With it i get the error that the system cannot find the font i want. It even wont work in this case:

       

      app.selection[0].appliedFont = "Yakout Linotype";

       

      HOWEVER, if I select a piece of text and change that piece of text to Yakout Linotype using indesigns GUI and THEN run the script, the script works without a flaw.

      anyone know why a font would have to be present in a document for the script to call upon it. Or why that doesnt seem to be the case with other fonts, ONLY Yakout Linotype. Thanks!

      Edit: "Yakout Linotype" is the fontFamily, Ive tried using fullName and fullNameNative.