TextLayer Issue

Hello team,

I’m trying chage font for textlayer in psd but I have many issues with it.
I use Font Name : Lobster , Caveat ,Satisfy ,Gochi Hand , …

  1. After update textlayer , 2 text not on the same line
  2. Charactor in text is not space or space verry large for each charactor in text.

→ You can replicate the issue if you update textlayer by manually and compare it after run by code.

I also attach file Aspose.rar in link (video to show the issue and psd file to replicate) : Aspose.7z - Google Drive

Code :
var fontColor = Color.FromArgb(Ultils.GetArgbColor(fontInfor.ColorCode));

            layer.UpdateText(custom.Value, fontColor);

            foreach(var item in layer.TextData.Items)
            {
                item.Style.FontName = fontInfor.FontName;
                item.Style.FontSize = layer.Font.Size;      
            }

            layer.TextData.UpdateLayerData(); 

I counted the number of error fonts

image.png (8.3 KB)

Font error make me cannot send product to my customer and It affect the company’s revenue. Please help me to investigate and fix it as soon as posible

Thanks.

@seller.teecom

I have observed the video as well as requirements from you. In order to further investigate the issues on our end a ticket with ID PSDNET-972 has been created to further investigate and resolve the issue. this thread has been linked with the issue so that you may be notified once the issue will be fixed.

Hi @mudassir.fayyaz,

I really need your help to investigate and resolve it.
My customer is chasing the font issue and it verry important
Could you please help me to fix it as high priority ?

Thanks

@seller.teecom

I request for your patience and will share feedback with you as soon as it will be shared.

Hi @mudassir.fayyaz,

Can I get any update ?
Customer is chasing me about text layer issue everyday , I really need you help

Thanks.

@seller.teecom

We have made some progress in issue although it is not completely fixed yet. I suggest you to please try using following sample code. We have shared the comparison of using existing approach as well as proposed approach.

   string sourceFileName = "fontExamples948.psd";
            string testFontsFoler = "Fonts";
            string outputPng = "output.png";

            FontSettings.SetFontsFolder(testFontsFoler);

            using (PsdImage image = (PsdImage)Aspose.PSD.Image.Load(sourceFileName))
            {
                foreach (var layer in image.Layers)
                {
                    var textLayer = layer as TextLayer;
                    if (textLayer != null)
                    {
                        ITextPortion textPortion = textLayer.TextData.Items[0];
                        textPortion.Style.FillColor = Color.BlueViolet;

                        textLayer.TextData.UpdateLayerData();
                    }
                }

                image.Save(outputPng, new PngOptions());
            }

ComparationWithCurrent.png (30.1 KB)
ComparationWith948.png (27.4 KB)

Hi @mudassir.fayyaz,

I already used the same code you shared in with me. It’t didn’t resolve the problem.
I posted question 2 weeks. It verry important, the customer is chasing me everyday.
Could you please shared me your estimate when you can resolve the issue ?

Thanks.

@seller.teecom

Like I said that using the latest version and above sample code there is some improvement but not all issues are completely fixed. Can you please share what issues you are still facing after using suggested code and version.

Hi @mudassir.fayyaz,

The information issue when I created ticket is still happening

I’m trying chage font for textlayer in psd but I have many issues with it.
I use Font Name : Lobster , Caveat ,Satisfy ,Gochi Hand , …

1. After update textlayer , 2 text not on the same line
2. Charactor in text is not space or space verry large for each charactor in text.

-> You can replicate the issue if you update textlayer by manually and compare it after run by code.

I also attach file Aspose.rar in link (video to show the issue and psd file to replicate) : [https://drive.google.com/file/d/1wlI0RIqyrB_R56dIibE0khVUONPIbqjc/view?usp=sharing ](https://drive.google.com/file/d/1wlI0RIqyrB_R56dIibE0khVUONPIbqjc/view?usp=sharing)

Code :
var fontColor = Color.FromArgb(Ultils.GetArgbColor(fontInfor.ColorCode));

```
            layer.UpdateText(custom.Value, fontColor);

            foreach(var item in layer.TextData.Items)
            {
                item.Style.FontName = fontInfor.FontName;
                item.Style.FontSize = layer.Font.Size;      
            }

            layer.TextData.UpdateLayerData(); 
```

I counted the number of error fonts

[image.png|attachment](https://forum.aspose.com/uploads/default/55078) (8.3 KB)

Font error make me cannot send product to my customer and It affect the company’s revenue. Please help me to investigate and fix it as soon as posible  

Could you please help me to confirm the issue will be resolved in next release ?

@seller.teecom

I have shared feedback in our issue tracking system and will get back to you as soon as further information will be shared.

Hi @mudassir.fayyaz,
I hope you are well !

I have installed lasted version 21.10.0.

  1. I can see some fonts have been resolved But currently the new code throw exception when I use UpdateText ( Just happened in lasted version )
    File Name : M1TTTT16062021001.psd

Information for update layer in psd :

  • Font: Gochi Hand
  • Color: Black (#000000)
  • Custom 1st Name: Mom
  • Custom 2nd Name: Stacy

Code :

`   var fontColor = Color.FromArgb(Ultils.GetArgbColor(fontInfor.ColorCode));
            
            layer.UpdateText(custom.Value, fontColor);

            foreach(var item in layer.TextData.Items)
            {
                item.Style.FontName = fontInfor.FontName;
                item.Style.FontSize = layer.Font.Size;      
            }

            layer.TextData.UpdateLayerData();`

Replicate: Pass value “Mom” to layer.UpdateText(“Mom”);.

Exception :
Message : Index was outside the bounds of the array.
Stack Trace : at .(Object )
at .(Object )
at .()
at .(Object , UInt32 )
at . (Boolean )
at .(Object[] , Type[] , Type[] , Object[] )
at .(Stream , String , Object[] , Type[] , Type[] , Object[] )
at .(Stream , String , Object[] )
at .(Stream , String , Object[] )
at .UpdateText(String , Point , Single , Color )
at Aspose.PSD.FileFormats.Psd.Layers.TextLayer.UpdateText(String text, Color color)

  1. I still see the error when using some Fonts.
    Font Name Example : Pacifico, Damion, Norican , Bangers , Sunshineyy, Lexend Deca

  2. I still see the error : Render Text Layer wrong position

File Name : M1TTTT16062021001.psd
TextLayer in psd file have the same position but after using method UpdateTextLayer , the image after generate is wrong position ( check file word in attached )

I also add file attach to explain font issue.
Report Error.7z (1.9 MB)

Could you please help me to check the issue as priority ? I really need your help to check, I was wait new release day by day with I hope the font issue will be fixed. My customers are chasing me everyday, It very important with me .

Thanks

@seller.teecom

I have shared your feedback with in concerned ticket. We are going to address most of issues reported in coming release Aspose.PSD for .NET 21.11. We will share the good news with you as soon as the issue will be fixed.

Hi @mudassir.fayyaz,

Could you please share me when the new version release (21.11) ?
I hope you can fix all issues above in new release.

Thanks

We have added a ticket with ID PSDNET-988 in our issue tracking system to further investigate the issue. We are hopeful to share good news in Aspose.PSD for .NET 21.11.

Hi @mudassir.fayyaz ,

I have upgraded to lasted version ( 21.11.0 ). I waited for new release for 1 month with the hope can fix the textlayer issue as you informed me in comment above (“We are going to address most of the issues reported in coming release Aspose.PSD for .NET 21.11”) But now I’m very disappointed

Issue :
The 2 text “Donna” and “Judy” are displayed unequal and disproportionate as iamge below :
image.jpg (101.2 KB)

Code example : M1TTTT16062021001.7z (596.4 KB)

 layer.UpdateText(custom.Value, fontColor);

            foreach (var item in layer.TextData.Items)
            {
                item.Style.FontName = fontInfor.FontName;
                item.Style.FontSize = layer.Font.Size;
            }

            layer.TextData.UpdateLayerData();

Could you please explain to me why the issue is still happening. ?
Please help me to take a look on it and fix the issue with high priority. The issue was happing more than 3 months and my customer very angry

I alo attached psd file to investigate

@seller.teecom

We are checking the issue on our end and will get back to you as soon as possible.

Hi @mudassir.fayyaz,

Can I get any an update ?

Hello,

We fixed most issues that were created according to your report:
PSDNET-988: IndexOutOfRangeException on TextLayer.UpdateText
PSDNET-972: TextLayer Issue fonts selection issue

But there is the last one issue and it’s the hardest one:
PSDNET-999: Incorrect vertical position on text rendering.

The font that is used in this PSD file has many peculiar properties, we haven’t added support for each of them.

We planned to fix it in Aspose.PSD 22.01.

Until we finish working on the problem, you can try to justify text layers manually, for example, you can find the top or bottom position of Rendered Text and then update the other Text Layer’s top and bottom by the found value.
layer.Top = layer.Top + foundDif;
layer.Bottom = layer.Bottom + foundDif;

Thank you.

Hi @DmitriySorokin,

Thanks for confirm me status issues.
I also have the issue in many months. 2 text rendered wrong position.
Please help me review previous comment on Oct 29 ( The 2 text “Donna” and “Judy” are displayed unequal and disproportionate ) . Please help me to check it and share me adivse .

Thanks

@seller.teecom The general solution is provided above. I’ll inform you when we make a code snippet to fix the issue with the top position.