Attached is example code of trying to fill in some text layers for a PSD. One of the layers - DisplayName - is wrapped on a circle. The code properly replaces the text for the layer, but it is no longer wrapped as expected. The source code includes the PSD that is being used that works in photoshop. Here is example of the expected output:
The issue you’re experiencing with the text not being wrapped correctly on a circular shape in your PSD file is likely due to the way the text layer is being updated. When you replace the text in a text layer, the wrapping settings may not be preserved, leading to the text not following the intended path.
Solution
To maintain the text wrapping on a shape, ensure that you are using the correct methods to update the text layer. Specifically, utilize the TextLayer class and its associated properties to manage text portions effectively. This allows you to specify the wrapping and formatting options that align with your original design.
Code
Here’s an example of how to update a text layer while preserving the wrapping:
from aspose.psd import Color
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import TextLayer
from aspose.pycore import cast
def update_text_layer(source_file, output_file, new_text):
with PsdImage.load(source_file) as img:
text_layer = cast(TextLayer, img.layers[0]) # Adjust index as needed
text_layer.update_text(new_text, Color.red) # Update text and color
text_layer.text_data.update_layer_data() # Ensure to update layer data
img.save(output_file)
# Usage
update_text_layer("path/to/your/source.psd", "path/to/your/output.psd", "New Wrapped Text")
Make sure to replace "path/to/your/source.psd" and "path/to/your/output.psd" with the actual file paths.
Next Steps
Test the provided code with your PSD file to see if the text wraps correctly on the shape.
If the issue persists, check the properties of the text layer to ensure that the wrapping settings are correctly configured.
Review the documentation on text layer manipulation for more advanced options if needed.
Please let me know if this resolves your issue or if you need further assistance!
@omnant
At this moment, Aspose.PSD doesn’t support rendering text over the circle. I’ve increased priority of this task because of big amount of requests this month.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PSDNET-2256
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@omnant this task is planned, but it’s not in progress at the moment, so I can’t give the any accurate ETA. Release 25.10 will be made in the end of September.