Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Placing Layer.TEXT relatively to top-left corner of the document

$
0
0

Hello everybody

My name is Tomasz and I have got my very first question to you guys.

 

Let's say I have a document which is 100 CM x 100 CM square. I need to place a number in a top-left corner of this document. Font size in the text layer is 36 points. Please, see attached picture for details:psd_text_layer.jpg

 

As you can see the top-left corner of the number (text layer actually) must be placed 1 CM from left and 1 CM from top. When my document is using a Centimeter ruler, it was not that hard, I just assigned an array of two values to position property of the layer and... everything seems to be fine but the "position" property points to where text layer begins (which is bottom-left corner of the text layer), so I realized that I need to add a font size to Y axis value. I have no idea how to add 36 points of the font to the 1 CM value. Using methods such: as() or convert() on a Unitvalue gives me an error: "Cannot convert".

 

Guys, do you have any idea how to solve this problem which is to calculate position of the top-left corner instead bottom-left one?


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>