Html转word多字体不生效

Hi:
我碰到一个问题,html文本设置字体:font-family:“Times New Roman”,仿宋_GB2312,转word后英文和数字正常设置为"Times New Roman"字体,但中文内容没有设置为仿宋_GB2312字体。
image.jpg (173.4 KB)
image.jpg (144.6 KB)
tempDoc.zip (3.1 KB)

@o2oa2019

请确保将HTML转换为DOC的计算机上已安装HTML中使用的字体。

我们建议您使用Aspose.Words for Java 20.7的最新版本。 希望对您有帮助。

如果仍然遇到问题,请ZIP并在此处附加文档中使用的字体以进行测试。 还请分享用于测试这种情况的代码示例。 我们将对此问题进行调查,并为您提供更多信息。

我使用的是 Aspose.Words for Java 20.7,有安装字符集,因为如果我只设置仿宋_GB2312字体生成的word字体是正常的,html和word前面已经上传。
image.png (19.2 KB)

@o2oa2019

请在此处共享所需的资源进行测试。

我们建议您执行以下代码示例,如果遇到任何字体丢失警告,请告知我们。

Document doc = new Document(MyDir + "tempDoc.doc");
        doc.setWarningCallback(new com.aspose.words.IWarningCallback() {
            @Override
            public void warning(com.aspose.words.WarningInfo warningInfo) {
                if(warningInfo.getWarningType() == WarningType.FONT_SUBSTITUTION)
                    System.out.println(warningInfo.getDescription());
            }
        });
doc.save(MyDir + "output.pdf");