修改生成英文证书时英文完整换行
This commit is contained in:
@@ -300,9 +300,6 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
|
|
||||||
g.setFont(new Font("Arial", Font.PLAIN, 32));
|
g.setFont(new Font("Arial", Font.PLAIN, 32));
|
||||||
FontMetrics dess = g.getFontMetrics();
|
FontMetrics dess = g.getFontMetrics();
|
||||||
int alreadyWriteLine = 0; //已经写了多少行
|
|
||||||
int nowWidth = 0; //目前一行的长度
|
|
||||||
boolean space = true; //第一行空两格
|
|
||||||
String des = "";
|
String des = "";
|
||||||
if ("ZK".equals(type)){
|
if ("ZK".equals(type)){
|
||||||
des = "Has past the online-examination study of "+edes[0]+" Courses in Tai Hu Education online.";
|
des = "Has past the online-examination study of "+edes[0]+" Courses in Tai Hu Education online.";
|
||||||
@@ -310,9 +307,10 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
des = "Has satisfactorily completed an online course on "+edes[0]+" with "+edes[1]+" course hours in total, and has been recongnized eligibility without assessment.";
|
des = "Has satisfactorily completed an online course on "+edes[0]+" with "+edes[1]+" course hours in total, and has been recongnized eligibility without assessment.";
|
||||||
}
|
}
|
||||||
String str = "";
|
String str = "";
|
||||||
|
int alreadyWriteLine = 0; //已经写了多少行
|
||||||
int nowIndex = 0; //目前一行的长度
|
int nowIndex = 0; //目前一行的长度
|
||||||
for (int i = 0; i < des.length(); i++) { //9
|
for (int i = 0; i < des.length(); i++) { //9
|
||||||
String tempStr = "";
|
String tempStr;
|
||||||
str = str + des.charAt(i);
|
str = str + des.charAt(i);
|
||||||
int strWidth = dess.stringWidth(str.substring(nowIndex)); //获取字符的长度
|
int strWidth = dess.stringWidth(str.substring(nowIndex)); //获取字符的长度
|
||||||
if (strWidth>700) {//换行
|
if (strWidth>700) {//换行
|
||||||
|
|||||||
Reference in New Issue
Block a user