From 8962369be6023c70b4ebabf89eeb7a460b72a641 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Fri, 1 Aug 2025 11:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=B7=AF=E5=BE=847?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/caseData/service/CertService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/caseData/service/CertService.java b/src/main/java/com/example/caseData/service/CertService.java index 6bd9dd8..e03ba53 100644 --- a/src/main/java/com/example/caseData/service/CertService.java +++ b/src/main/java/com/example/caseData/service/CertService.java @@ -55,7 +55,8 @@ public class CertService { g2d.drawImage(circleAvatar, 465, 620, null); // 3. 添加姓名 - font = new Font("Microsoft YaHei", Font.PLAIN, 40); // 可根据模板调整大小 + font = loadFont("static/cert/msyh.ttf", 40f); +// font = new Font("Microsoft YaHei", Font.PLAIN, 40); // 可根据模板调整大小 g2d.setFont(font); customColor = Color.decode("#111827"); @@ -63,7 +64,8 @@ public class CertService { g2d.drawString(name, 465, 790); // 4. 添加证书内容 - font = new Font("Microsoft YaHei", Font.PLAIN, 48); // 可根据模板调整大小 +// font = new Font("Microsoft YaHei", Font.PLAIN, 48); // 可根据模板调整大小 + font = loadFont("static/cert/msyh.ttf", 48f); g2d.setFont(font); customColor = Color.decode("#111827"); @@ -74,7 +76,8 @@ public class CertService { SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); String currentDate = sdf.format(new Date()); - font = new Font("Microsoft YaHei", Font.PLAIN, 34); // 可根据模板调整大小 +// font = new Font("Microsoft YaHei", Font.PLAIN, 34); // 可根据模板调整大小 + font = loadFont("static/cert/msyh.ttf", 34f); g2d.setFont(font); customColor = Color.decode("#111827");