parse font size error
vollen opened this issue · 3 comments
main.zip
in my psd, the label is 22 pixel, but while readPsd, the font size is 1.528.
show as image:
Font size displayed in Photoshop UI is multiplied by text transform to make all the fonts in the document sizes make sense together regardless if you scaled some text boxes up or down, it won't be the same as the size saved in the document. To get the same size you need to multiply it by the transform.
Thank you very much for your response.
But I have tried many methods and still haven't figured out how to calculate the font size displayed in Photoshop.
Could you please help by providing example code?
"fontSize": 1.528,
"transform": [
14.375973048409659,
0,
0,
14.397948318701692,
377.5141057351093,
484.64813612439474
],
you have font size of 1.528
and transform [14.375973048409659, 0, 0, 14.397948318701692, 377.5141057351093, 484.64813612439474]
first number in the transform is scaleX and 4th one is scaleY, if you multiply your font size by 4th number in the transform you get 22.000065031
which after rounding is exacly what you have in the UI