Font - Don't LOAD

I’m trying to load a different font, I’ve already installed it in the operating system, I’ve already placed it in Adobe on my computer.
I’ve already tried GetAbobeFontName, I’ve already tried Aspose.PSD.Font.

None of them work, when I perform updateText, to update the layer’s text, it goes back to the Arial font by default.

@iqresultsbrn

It seems you’re having trouble loading a custom font in Aspose.PSD, and the text layer is reverting to Arial by default. Here are some steps you can take to ensure that your custom font is loaded correctly:

  1. Set the Fonts Folder: Make sure you specify the correct path to the folder where your custom fonts are installed. You can do this using the FontSettings.SetFontsFolder method. This should be done before you attempt to update the text layer.

  2. Use the Correct Font Name: When updating the text layer, ensure that you are using the correct font name. You can retrieve the Adobe font name using FontSettings.GetAdobeFontName("YourFontName"). This is crucial because the font name must match exactly what is recognized by the Aspose.PSD library.

  3. Update the Text Layer: After setting the font, update the text layer accordingly. Here’s a sample code snippet that demonstrates how to change the font of a text layer:

    using Aspose.PSD.FileFormats.Psd;
    using Aspose.PSD.FileFormats.Psd.Layers;
    using System;
    
    class Program
    {
        static void Main()
        {
            string documentFile = "path_to_your_psd_file.psd";
            string fontsFolder = "path_to_your_fonts_folder";
    
            using (var psdImage = (PsdImage)Image.Load(documentFile))
            {
                FontSettings.SetFontsFolder(fontsFolder);
                foreach (var layer in psdImage.Layers)
                {
                    if (layer is TextLayer textLayer)
                    {
                        var textData = textLayer.TextData;
                        textData.Items[0].Text = "Your new text";
                        textData.Items[0].Style.FontName = FontSettings.GetAdobeFontName("YourCustomFontName");
                        textData.UpdateLayerData();
                    }
                }
                psdImage.Save("output_file.psd");
            }
        }
    }
    
  4. Check Font Compatibility: Ensure that the font you are trying to use is compatible with Aspose.PSD. Some custom fonts, especially bitmap or SVG fonts, may not be fully supported.

If you follow these steps and still encounter issues, consider checking the font installation on your operating system and ensuring that it is accessible to the application.

If you need further assistance, feel free to ask!

Run! thanks bot ;d
all its ok