Paragraph text not wrapping with higher DPI (javascript)
- May 26, 2020
- 1 reply
- 1570 views
I have a weird problem in Javascript with Paragraph text. My script creates text layers for labels and needs the text to fit the document width. For font attributes it uses a template text layer which is copied, changed to paragraph text, width and height set to document size and contents text set. This works as expected with DPI set to 72 which corresponds to 1 pixel= 1 pt . The ruler units are pixels.
If now I resize the image to 300 DPI, not reampling (i.e. page size changes, not pixel count) this does not work anymore. The template text layer is correctly scaled from roughly 69pt down to 16.56 pt (Unitvalues do correctly reflect the change to 300DPI in the baseUnit, thus conversion correct). When width and height of the text item are set to the document width and height they are automatically correctly scaled from 350ox to 84pt (as text item always uses pt). But when a text which would require 2 lines is assigned it flows out of the document on one single line.
So far I have checked a lot of things like nmoBreak set to false, useAutoLeading to true, autoLeadingAount=120% (i.e. nm problem to fit 2 16pt lines into 84pt). I did also try to force leading to fix value with nmo change in behavior. Once the same document is in 72pt again, the same script works as expected.
Am I missing something here, or is this a bug?
