Highlighted

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

48

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

49

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
JJMack LATEST
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...