Hi!
We are processings TwoFonts.psd from the archive below using Aspose.PSD 20.5.0 and the following code:
AsposeLicenser.LoadLicense();
using (var image = Image.Load(filePath))
{
var psdImage = (PsdImage) image;
var layers = psdImage.Layers;
var textLayer = layers.First(layer => layer is TextLayer) as TextLayer;
textLayer.TextData.UpdateLayerData();
psdImage.Save(targetFilePath, new PsdOptions(psdImage));
}
using (var image = Image.Load(targetFilePath))
{
var psdImage = (PsdImage) image;
var layers = psdImage.Layers;
var textLayer = layers.First(layer => layer is TextLayer) as TextLayer;
// textLayer.TextData - has two portions with the same FontIndex
textLayer.TextData.UpdateLayerData();
psdImage.Save(targetFilePath + ".second.psd", new PsdOptions(psdImage));
// one of the fonts is lost in the second target file
}
As marked by the comments:
- when we reopen the file saved by Aspose.PSD the two portions in TextData will have the same FontIndex
- after saving the file for the second time, all text has the same font in Photoshop
Note that the first target file looks good in Photoshop (has both fonts).
TwoFonts.zip (18.9 KB)
Thanks!
Arnold