Skip to main content
Inspiring
May 11, 2024
Question

How to obtain the horizontal flip, vertical flip, line spacing, and letter spacing of the text layer

  • May 11, 2024
  • 3 replies
  • 1102 views

How to obtain the horizontal flip, vertical flip, line spacing, and letter spacing of the text layer in the psd file through script or .net

 

This topic has been closed for replies.

3 replies

c.pfaffenbichler
Community Expert
Community Expert
May 13, 2024

 

// based on code by michael l hale;
// 2020, use it at your own risk;
if (app.documents.length > 0) {
var ref = new ActionReference();
ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID('textKey'));
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
var layerDesc = executeActionGet(ref);
var textDesc = layerDesc.getObjectValue(stringIDToTypeID('textKey'));
try {var theTransform = textDesc.getObjectValue(stringIDToTypeID("transform"));
checkDesc2 (theTransform, true);
} catch (e) {};
};

 

javaerAuthor
Inspiring
May 14, 2024

Sincerely thank you all for your replies and help

Participant
May 12, 2024

To achieve these effects in Adobe Photoshop:

  1. Horizontal Flip: Select the text layer, then go to Edit > Transform > Flip Horizontal.

  2. Vertical Flip: Similarly, select the text layer, then go to Edit > Transform > Flip Vertical.

  3. Line Spacing: To adjust line spacing, go to Window > Character to open the Character panel. Adjust the "Leading" option, which controls the spacing between lines of text.

  4. Letter Spacing: With the text layer selected, go to Window > Character to open the Character panel. Adjust the "Tracking" option, which controls the spacing between individual letters.

These options allow you to manipulate text layers in various ways to achieve the desired effects.

javaerAuthor
Inspiring
May 13, 2024

I hope to get these status values through script instead of operating on the interface.

javaerAuthor
Inspiring
May 11, 2024

What I want to get most is the flipped state。The red rectangle shows the flipped text. How to get the flipped status?

 

Legend
May 12, 2024

I don't think there are any flip statuses.

They're just buttons.

A horizontal flip simply reverses the sign of xx and yx,

and a vertical flip reverses the sign of xy and yy.

 

javaerAuthor
Inspiring
May 13, 2024

Can the flip state be calculated from the values of xy and yy? Or there are other ways