Skip to main content
Known Participant
August 27, 2015
Question

Leading always set to Auto

  • August 27, 2015
  • 2 replies
  • 416 views

I'm using the following function and while I'm always setting the leading to a value, in the Photoshop UI it is set to AUTO (and the leading use is incorrect), any idea what I might be doing incorrectly?

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

{

  artLayerRef.kind = LayerKind.TEXT

  //This section defines the color of the hello world 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.width = 110;

  textItemRef.height = size/2;

  textItemRef.justification=Justification.CENTER;

  textItemRef.size = size;

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

   textItemRef.leading = size; //also tried explicit integer values

  textItemRef.hyphenation = false;

}

This topic has been closed for replies.

2 replies

cwodwrthAuthor
Known Participant
September 17, 2015

Perfect, thank you!

cwodwrthAuthor
Known Participant
September 15, 2015

Just checking back in with this, does anyone have an answer?

SuperMerlin
Inspiring
September 15, 2015

You need  textItemRef.useAutoLeading = false; and then textItemRef.leading = 50; //etc.