@yasufumi_hayashi, 問題を再現できません。 WSL on Windows 10にインストールされている Arch Linuxで以下のコードを実行してみました。
コードを実行する前に、「VLゴシック」フォントを〜 /.local/share/fonts にコピーしてインストールしました。 Iosevkaフォントは、/usr/share/fontsにインストールされているArchLinuxの標準フォントです。
public class Main {
public static void main(String[] args) throws Exception {
License lic = new License();
lic.setLicense("Aspose.Words.Java.lic");
String docPath = "body1.rtf";
System.out.println(docPath);
Document doc = new Document(docPath);
FontSubstitutionWarningCollector callback = new FontSubstitutionWarningCollector();
doc.setWarningCallback(callback);
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setSaveFormat(SaveFormat.HTML);
saveOptions.setHtmlVersion(HtmlVersion.HTML_5);
saveOptions.setEncoding(StandardCharsets.UTF_8);
saveOptions.setExportImagesAsBase64(true);
doc.save("body1.aspose.words.21.10.html", saveOptions);
}
private static class FontSubstitutionWarningCollector implements IWarningCallback {
/// <summary>
/// Called every time a warning occurs during loading/saving.
/// </summary>
public void warning(WarningInfo info) {
if (info.getWarningType() == WarningType.FONT_SUBSTITUTION)
{
System.out.println(info.getDescription());
}
}
}
}
コードを実行するためのコマンド:
/usr/lib/jvm/java-18-jdk/bin/java -Dfile.encoding=UTF-8 -classpath /<path_to_project>:/<path_to>/aspose-words-21.10.0-jdk17.jar Main
出力は次のとおりです:
/<path_to>/body1.rtf
Font 'MS ゴシック' has not been found. Using 'VL Gothic' font instead. Reason: font info substitution.
Font 'MS 明朝' has not been found. Using 'VL Gothic' font instead. Reason: font info substitution.
Font 'Arial' has not been found. Using 'Iosevka Nerd Font Mono' font instead. Reason: font info substitution.
ご覧のとおり、置換されたフォントの中にMS 明朝が表示されています。
先に進む前に、問題を再現する必要があります。
オペレーティングシステムとJDKのバージョンは何ですか?
問題を示すDockerイメージを作成できれば素晴らしいと思います。