Free Support Forum - aspose.com

Fonts are lost after round-trips with Aspose.PSD

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

@arnoldbeilandevozon,

We have created an issue with ID PSDNET-680 to further investigate the reported issue. W e will share the feedback with you as soon as the issue will be addressed.