Commit c3042b92 by 王祖波

字体更换

parent 34021852
...@@ -243,15 +243,16 @@ public class ImageCombined { ...@@ -243,15 +243,16 @@ public class ImageCombined {
g.setColor(Color.WHITE); g.setColor(Color.WHITE);
g.fillRect(0, finalHeight - WHITE_SPACE_HEIGHT, width, WHITE_SPACE_HEIGHT); g.fillRect(0, finalHeight - WHITE_SPACE_HEIGHT, width, WHITE_SPACE_HEIGHT);
String font = ApolloUtils.combinedFonts(); String font = ApolloUtils.combinedFonts();
int type = ApolloUtils.combinedFontsType();
// 添加门店名称,距底部88px // 添加门店名称,距底部88px
g.setColor(new Color(36, 40, 53)); g.setColor(new Color(36, 40, 53));
g.setFont(new Font(font, Font.PLAIN, 30)); g.setFont(new Font(font, type, 30));
logger.info("使用字体:{}",g.getFont().getFontName()); logger.info("使用字体:{}",g.getFont().getFontName());
drawSingleLineText(g, lineOne, 30, finalHeight - WHITE_SPACE_HEIGHT + 72, width - 196); // 留出左右边距 drawSingleLineText(g, lineOne, 30, finalHeight - WHITE_SPACE_HEIGHT + 72, width - 196); // 留出左右边距
// 添加推荐人信息,距底部40px // 添加推荐人信息,距底部40px
g.setColor(new Color(151, 155, 165)); g.setColor(new Color(151, 155, 165));
g.setFont(new Font(font, Font.PLAIN, 26)); g.setFont(new Font(font, type, 26));
drawSingleLineText(g, lineTwo, 30, finalHeight - WHITE_SPACE_HEIGHT + 120, width - 196); // 留出左右边距 drawSingleLineText(g, lineTwo, 30, finalHeight - WHITE_SPACE_HEIGHT + 120, width - 196); // 留出左右边距
// 添加二维码,距底部12px // 添加二维码,距底部12px
......
...@@ -54,10 +54,16 @@ public class ApolloUtils { ...@@ -54,10 +54,16 @@ public class ApolloUtils {
*/ */
public static String combinedFonts() { public static String combinedFonts() {
Config config = ConfigService.getAppConfig(); Config config = ConfigService.getAppConfig();
String combinedFonts = config.getProperty("combinedFonts", "Arial"); String combinedFonts = config.getProperty("combinedFonts", "");
return combinedFonts; return combinedFonts;
} }
public static Integer combinedFontsType() {
Config config = ConfigService.getAppConfig();
String combinedFontsType = config.getProperty("combinedFontsType", "0");
return Integer.parseInt(combinedFontsType);
}
/** /**
* 线程池核心线程数 * 线程池核心线程数
* @return * @return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment