The text style is incorrect in a smart object when we use ReplaceContents

Hello.
I use latest Aspose.PSD version. I have a psd file which contains a smart object. The smart object has TextLayer. When I try to change a text value and replace the layer, the text has an incorrect style. It is longer and bigger. Any solution how to fix it? Thanks.

PsdLoadOptions psdLoadOptions = new PsdLoadOptions();
psdLoadOptions.LoadEffectsResource = true;

string inputFile = "c:\\psd\\test\\source.psd";
using (PsdImage psdImage = (PsdImage)Image.Load(inputFile, psdLoadOptions))
{
	psdImage.Save("c:\\psd\\test\\source.png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
	SmartObjectLayer smartObject = FindLayer("smart-object", psdImage) as SmartObjectLayer;
	
	using (PsdImage smartObjectImage = (PsdImage)smartObject.LoadContents(psdLoadOptions))
	{
		Layer layer = FindLayer("text", smartObjectImage);
		if (layer is TextLayer textLayer) {
			// textLayer.UpdateText("changed text"); // with changed text or without no difference
		}
		smartObject.ReplaceContents(smartObjectImage);
	}
	psdImage.Save("c:\\psd\\test\\target.png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}

public Layer FindLayer(string layerName, PsdImage image)
{
	// Get aa layers in PSD file
	var layers = image.Layers;
	// Find desired layer
	foreach (var layer in layers)
	{
		// Match layer's name
		if (string.Equals(layer.DisplayName, layerName, StringComparison.InvariantCultureIgnoreCase))
		{
			return layer;
		}
	}
	return null;
}

test.zip (4.2 МБ)

@BankaiPro

@BankaiPro please check if you have Tahoma Font correctly Installed. Making pixel-perfect rendering of fonts is a difficult task, but we make improvement with every release.

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-1642

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.

I’ve tried Arial, Times New Roman and others. Result is the same. I think it’s a bag. Because there is a difference in the file I attached. Text is stretched.

result.jpg (265.4 КБ)

I’ve set high priority for this bug. We will make an investigation and then I’ll write you back. We will try to investigate it and fix in Aspose.PSD 23.8

The issues you have found earlier (filed as PSDNET-1642) have been fixed in this update. This message was posted using Bugs notification tool by yaroslav.lisovskyi