|
|
@@ -46,11 +46,17 @@ public class Word2Pdf {
|
|
|
FontSettings font = new FontSettings();
|
|
|
String path = "/usr/share/fonts";
|
|
|
FolderFontSource folderFontSource = new FolderFontSource(path, true);
|
|
|
- ArrayList fontSources = (ArrayList) Arrays.asList(font.getFontsSources());
|
|
|
+ // ArrayList fontSources = (ArrayList) Arrays.asList(font.getFontsSources());
|
|
|
+ ArrayList fontSources = new ArrayList(Arrays.asList(font.getFontsSources()));
|
|
|
+
|
|
|
fontSources.add(folderFontSource);
|
|
|
FontSourceBase[] updatedFontSources = (FontSourceBase[]) fontSources.toArray(new FontSourceBase [fontSources.size()]);
|
|
|
-// font.setFontsFolder(path, true);
|
|
|
-// font.setDefaultFontName("KaiTi");
|
|
|
+ font.setFontsFolder(path, true);
|
|
|
+ font.setDefaultFontName("KaiTi");
|
|
|
+ font.setDefaultFontName("SimHei");
|
|
|
+ font.setDefaultFontName("NSimSun");
|
|
|
+ font.setDefaultFontName("STFangsong");
|
|
|
+ font.setDefaultFontName("STZhongsong");
|
|
|
font.setFontsSources(updatedFontSources);
|
|
|
doc.setFontSettings(font);
|
|
|
|