wangliang vor 3 Jahren
Ursprung
Commit
f79d211831

+ 3 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ImageTrajectoryUtil.java

@@ -26,6 +26,8 @@ import java.util.StringJoiner;
  */
 public class ImageTrajectoryUtil {
     private final static Logger log = LoggerFactory.getLogger(ImageTrajectoryUtil.class);
+    private final static String FONT_FORMAT = "微软雅黑";
+    private final static int FONT_SIZE = 30;
 
     /**
      * 生成图片
@@ -43,7 +45,7 @@ public class ImageTrajectoryUtil {
             Graphics2D g = image.createGraphics();// 得到图形上下文
             g.setColor(Color.red); // 设置画笔颜色
             // 设置字体
-            g.setFont(new Font("微软雅黑", Font.LAYOUT_LEFT_TO_RIGHT, 20));// 写入签名
+            g.setFont(new Font(FONT_FORMAT, Font.LAYOUT_LEFT_TO_RIGHT, FONT_SIZE));// 写入签名
             // 下面这一句中的43,image.getHeight()-10可以改成你要的坐标。
             for (int i = 0; i < jsonArray.size(); i++) {
                 JSONObject jsonObject = jsonArray.getJSONObject(i);