2 Replies Latest reply on Jun 8, 2015 1:51 PM by cwodwrth

    Different Font Sizes Within PARAGRAPHTEXT

    cwodwrth

      Is it possible to assign via javascript different font sizes to each line I add via the function below??

       

      For example if I enter as the content "Title\nSubtitle" so have it appear something like this all with in the same text item?

       

      TITLE

      SUBTITLE

       

      function createText(artLayerRef, fface, size, colR, colG, colB, content, tX, tY)

      {

        artLayerRef.kind = LayerKind.TEXT

         

        textColor = new SolidColor();

        textColor.rgb.red = colR;

        textColor.rgb.green = colG;

        textColor.rgb.blue = colB;

       

       

        //Get a reference to the text item so that we can add the text and format it a bit

        textItemRef = artLayerRef.textItem;

        textItemRef.kind = TextType.PARAGRAPHTEXT; 

        textItemRef.contents = content;

        textItemRef.font = fface;

        textItemRef.color = textColor;

        textItemRef.leading = size/(600/72);

        textItemRef.width = 110;  

        textItemRef.height = size/2;  

        textItemRef.justification=Justification.CENTER;

        textItemRef.size = size/(600/72);

       

        //textItemRef.position = new Array(tX, tY) //pixels from the left, pixels from the top

        textItemRef.position = new Array(tX-textItemRef.width*(600/72)/2, tY ) //pixels from the left, pixels from the top

       

        textItemRef.hyphenation = false;

      }