How to resize text layer without text transformation?

New Here ,
Aug 24, 2020

Copy link to clipboard

Copied

I would like to resize the text layer using resize(..) api but this deforms the text. Is there any way to transform the text bounding box without transfroming text?

 

var textLayerRef = DummyGroup.artLayers.add();
textLayerRef.kind = LayerKind.TEXT;
var textItemRef = textLayerRef.textItem;
textItemRef.contents =  "Lorem Ipsum";
textItemRef.size = new UnitValue(14, "px");
textLayerRef.resize(200, 100, AnchorPosition.TOPLEFT); // This deforms the text
TOPICS
Actions and scripting, How to, Problem or error

Views

84

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to resize text layer without text transformation?

New Here ,
Aug 24, 2020

Copy link to clipboard

Copied

I would like to resize the text layer using resize(..) api but this deforms the text. Is there any way to transform the text bounding box without transfroming text?

 

var textLayerRef = DummyGroup.artLayers.add();
textLayerRef.kind = LayerKind.TEXT;
var textItemRef = textLayerRef.textItem;
textItemRef.contents =  "Lorem Ipsum";
textItemRef.size = new UnitValue(14, "px");
textLayerRef.resize(200, 100, AnchorPosition.TOPLEFT); // This deforms the text
TOPICS
Actions and scripting, How to, Problem or error

Views

85

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 24, 2020 0
Most Valuable Participant ,
Aug 24, 2020

Copy link to clipboard

Copied

Why are you using resize set the font size you want. You may need to calculate what size you want to use.   I think I remember I had to save the resolution change the document resolution to 72 because Adobe fonts seem to be baste on points ie 72DPI I could them divide the document height in pixels  by the number of lines of text I want to fit over the canvas set the text layer font size.  Like( height /5) if  I wanted text to be 1/5 document height.  Them I could restore  the document resolution and the text size would be good. 

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 24, 2020 0
New Here ,
Oct 13, 2020

Copy link to clipboard

Copied

I would like to create Paragraph Text layers using a script with a specific bounding box. The layer.bounds give me the tight bounding box instead of the values you see on the layer's properties window. I'll try to get the bounding box from transform, that should help.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2020 0