adobe-photoshop / generator-core

Core Node.js library for Adobe Photoshop CC's Generator extensibility layer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Size value of TextStyle does not update when TextLayer is scaled

insanetheta opened this issue · comments

When Text is scaled by either scaling Image Size or using Transform on a layer, the font size in Photoshop will show the change in size, but the size parameter on the textStyle Object will remain the same.

If instead I scale the text by directly changing the Text Size in the Photoshop Layer Property window, the generator value DOES change.

Example:

I have a 100pt font which I edit to 50pt in the font window.
The Generator Json changes from:

"size": {
"value": 19.1,
"units": "pointsUnit"
}

to

"size": {
"value": 9.55,
"units": "pointsUnit"
}
When I run my plugin.

But, when scale is applied instead, scaling the object by 50%, the property window correctly reflects the new font size of 50pt but the Json remains the same as:
"size": {
"value": 19.1,
"units": "pointsUnit"
}

This issue persists even if I save after scaling and restart photoshop. If instead I could get the exact "50pt" type value out of generator I would use that, but this "size" object seems to be the only method of getting a relative font size, and it does not update correctly when the font changes except expressly through typing in the font size field.

After digging some more through the JSON for the layer I noticed the "transform" object, which seems to solve my problem. It provides the scale that I need to multiply font size by to get the true font size.

"transform": {
"xx": 0.655958,
"xy": 0,
"yx": 0,
"yy": 0.657063,
"tx": 0,
"ty": 0
},