Hi,
I look through “FontRepository.LoadFonts” document, it says that load system fonts and standard pdf font. But my pdf font is different before and after the usage method.
My Html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-family: 'Arial Unicode MS';
font-size: 16px;
}
</style>
</head>
<body>
test123
</body>
</html>
my code:
String out = "C:\\Users\\xxx\\Desktop\\1.pdf";
HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
Document document = new Document(new FileInputStream("C:\\Users\\xxx\\Desktop\\123.html"), htmlLoadOptions);
document.save(out);
// Load PDF document
Document pdfDocument = new Document(out);
Font[] allFonts = pdfDocument.getFontUtilities().getAllFonts();
for (Font font : allFonts) {
System.out.println(font.getFontName());
}
the font result is:
TimesNewRoman
Arial
when I add
FontRepository.loadFonts();
the result is
ArialUnicodeMS
Arial
Why pdf font has been changed? Based on the api document, FontRepository.loadFonts() only load system font, why it impact pdf font?
Thanks