PSD文件中字符串字体更改

请问如何更换PSD文件中某一行文本的字体呢?

我用调用字体方法出错:
PsdLoadOptions loadOptions = new PsdLoadOptions(); loadOptions.setDefaultReplacementFont(“Arial”);
image.png (21.5 KB)

OS 版本:Windows 10 专业版
Aspose版本:23.4

请尝试以下代码 (ITextStyle - Aspose.PSD for Java - API Reference):

    String[] specificFontNames = new String[] { "Chiller", "Algerian", "Blackadder ITC", "Bauhaus 93", "Californian FB", "Courier New", "Berlin Sans FB Demi", "Informal Roman", "Segoe Print", "Times New Roman", };
    String[] generalFontNames = new String[] { "Arial", "Comic Sans MS", "Courier New", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", "Palatino Linotype", "Tahoma", "Microsoft Sans Serif", };
    String outputFilePsd = "fontEditTest.psd";

    final PsdImage image = new PsdImage(500, 500);
    try /*JAVA: was using*/
    {
        for (int i = 0; i < specificFontNames.length; i++)
        {
            String fontName = specificFontNames[i];
            TextLayer textLayer = image.addTextLayer(fontName, new Rectangle(10, (i + 1) * layerHeight, image.getWidth(), layerHeight));

            ITextPortion firstPortion = textLayer.getTextData().getItems()[0];
            firstPortion.getStyle().setFontSize(24);
            firstPortion.getStyle().setFontName(FontSettings.getAdobeFontName(fontName));
            firstPortion.setText(firstPortion.getText().trim());

            ITextPortion secondPortion = textLayer.getTextData().producePortion();
            secondPortion.setText(" - other font");
            secondPortion.getParagraph().apply(firstPortion.getParagraph());
            secondPortion.getStyle().apply(firstPortion.getStyle());
            secondPortion.getStyle().setFontName(FontSettings.getAdobeFontName(generalFontNames[i]));

            textLayer.getTextData().addPortion(secondPortion);

            textLayer.getTextData().updateLayerData();
        }

        image.save(outputFilePsd);
    }
    finally { if (image != null) (image).dispose(); }

用psd 文件导出的 png 图像中,中文存在乱码现象,是字体的原因导致的吗?
image.jpg (21.0 KB)

PSD输入文件已经传过了,参见 PSD图像导出图像中文乱码
想确认下中文乱码的问题是因为字体原因导致的吗

PSD输入文件已经传过了,参见 PSD图像导出图像中文乱码
想确认下中文乱码的问题是因为字体原因导致的吗,可以通过修改字体解决乱码乱码问题吗

@junjun.pan
这是一个已知的错误,我已将其附加到您的票证中。该问题将在 Aspose.PSD for Java 23.6 的下一版本中修复,预计 2 周后。在此之前,您可以尝试旧版本的 Aspose.PSD for Java。我们会尽力更快地解决这个问题

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): PSDJAVA-457

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.

请问可以编辑倾斜文本吗?
如果可以,编辑文本的时候任何设置倾斜角度?

@junjun.pan
请用 ITextStyle - Aspose.PSD for Java - API Reference

例子: TextPortions[3].getStyle().setFauxItalic(true); // edit text style of “Italic\r”