修改海报字体某些服务器导致的乱码

This commit is contained in:
xuwenbo
2020-08-07 10:27:09 +08:00
parent e82321edfd
commit 9fc546f354
2 changed files with 2 additions and 2 deletions

View File

@ -682,10 +682,10 @@ public class CreatShareProductService {
}
g.drawImage(priductUrl.getScaledInstance(750,590,Image.SCALE_DEFAULT),0,0,null);
File newFileT = new File("Alibaba-PuHuiTi-Regular.otf");
File newFileT = new File("simsunb.ttf");
if(!newFileT.exists()){
InputStream streamT = getClass().getClassLoader()
.getResourceAsStream("Alibaba-PuHuiTi-Regular.otf");
.getResourceAsStream("simsunb.ttf");
FileUtils.copyInputStreamToFile(streamT, newFileT);
}
Font font = Font.createFont(Font.TRUETYPE_FONT, newFileT);