6 Replies Latest reply on Nov 25, 2009 4:28 AM by AdobeScripts

    [Novice] Simple question about fontStyle

    Melzi94270

      Hi everybody !

       

      A simple question concerning fontStyle (ParagraphSyle or Paragraph)

      I saw that fontStyle is for bold, italic and underline.

       

      Is it possible to have some paragraph bold AND italic or italic AND underline? If it's possible how can I do that (example in javascript)?

      I found only these type of examples :

       

      myParagraphStyle.appliedFont = "Arial";
      myParagraphStyle.fontStyle = "Bold";
      myParagraphStyle.pointSize = 24;
      myParagraphStyle.spaceAfter = 24;
      myParagraphStyle.spaceBefore = 24;
      myParagraphStyle.fillColor = myDocument.colors.item("Red");

       

      Someone have an idea?

       

      Goor afternoon

        • 1. Re: [Novice] Simple question about fontStyle
          Melzi94270 Level 1

          In fact my question is just for bold AND italic. It exists an underline property independant of fontStyle

          • 2. Re: [Novice] Simple question about fontStyle
            [Jongware] Most Valuable Participant
             ..I saw that fontStyle is for bold, italic and underline ..

             

            No it isn't. fontStyle is whatever can appear in the Font Style under Font Family in InDesign itself. That includes "Bold Italic", by the way, but not by somehow 'combining' bold and italic. It's a simple text string, taken from whatever the designer called it in the font file itself.

             

            A few examples of what fontStyle may contain: "Light Italic Display", "SmText", "Black", "1", "Extended #2", "Pi", "Demi", "A", "UH" -- most of the stranger names are linked to only a single font.

            1 person found this helpful
            • 3. Re: [Novice] Simple question about fontStyle
              Kasyan Servetsky Level 5

              bold AND italic:

              myParagraphStyle.appliedFont = "Arial\tBold Italic";

              or

              myParagraphStyle.appliedFont = "Arial";
              myParagraphStyle.fontStyle = "Bold Italic";

               

              underline:

              myParagraphStyle.underline = true;

              1 person found this helpful
              • 4. Re: [Novice] Simple question about fontStyle
                AdobeScripts Level 3

                Is it possible to have some paragraph bold AND italic or italic AND underline? If it's possible how can I do that (example in javascript)?

                I found only these type of examples :

                 

                myParagraphStyle.appliedFont = "Arial";
                myParagraphStyle.fontStyle = "Bold";
                myParagraphStyle.pointSize = 24;
                myParagraphStyle.spaceAfter = 24;
                myParagraphStyle.spaceBefore = 24;
                myParagraphStyle.fillColor = myDocument.colors.item("Red");

                 

                Someone have an idea?

                Each font has its own list of styles - so some fonts will work with "Bold Italic" - some won't.

                 

                Myriad PRO have "Bold Condensed Italic" and "Bold Italic". Some fonts use "Slanted" as "Italic".

                 

                robin

                 

                www.adobescripts.co.uk

                • 5. Re: [Novice] Simple question about fontStyle
                  Melzi94270 Level 1

                  Thank you very much for all these answers. They were very useful.

                  Sorry to have asked a simple question like that, but I am a beginner and it not works with the same manner all the time.

                  For example in flex:

                  fontFamily = name of the font

                  fontStyle = italic / normal

                  fontWeight = bold/normal

                  textDecoration = underline/none

                   

                  So I was a little (completly?) lost

                   

                   

                  Thank you very much

                   

                  Good evening

                  • 6. Re: [Novice] Simple question about fontStyle
                    AdobeScripts Level 3
                    For example in flex:

                    fontFamily = name of the font

                    present:

                     

                    Property FontFamily As String
                        read-only
                        Member of InDesign.Font
                        The name of the font family

                    fontStyle = italic / normal

                    present - in all text objects, like:

                     

                    Property FontStyle As String
                        Member of InDesign.Text
                        The name of the font style.

                    fontWeight = bold/normal

                    Property PointSize As Variant
                        Member of InDesign.Text
                        The text size. Type: Unit (Double or String)

                    textDecoration = underline/none

                    there is no "decoration" property - but you can set Capitalization, Ligatures, Underline, StrikeThru, Skew, Rules (above and below), few OpenType features and more.

                     

                    robin

                     

                    www.adobescripts.co.uk