Open aticzz opened 7 months ago
As explained here: https://github.com/Agamnentzar/ag-psd?tab=readme-ov-file#updating-text-layers passing invalidateTextLayers: true
will result in the error message when opening PSD file in Photoshop. You can remove that option to prevent the warning, but in that case you have to redraw the text layer canvas yourself. Otherwise Photoshop will show the old layer content when you open the file.
Thank you so much for replying ☺️ How to redraw the text layer canvas. If I redraw that layer, will that layer remain an image layer or a text layer? I want text layer only because it should be edited in Photoshop also.
For compatibility reasons PSD files keep bitmap versions of all the layers, even text and vector layers, and when you open the file in Photoshop it uses those bitmaps instead of redrawing them, that's why even for vector and text layers when you change anything you also need to redraw the bitmap version. It will remain text/vector layer.
To replace it you just need to replace layer.canvas
with your own canvas with updated content. Unfortunately to accurately redraw text layer you have to replicate behavior of Photoshop text rendering code. Depending on complexity of text properties you want to use it might be easier or harder to do. HTML canvas has basic text drawing functions, so maybe that would be enough for your use case.
i want to apply simple linear gradient color on text layer. i read a issue #149 also i read Updating text layers information. but how i can remove this error.
i try everything but i failed
my code `
`