Skip to content

Commit fa4a3b3

Browse files
authored
🚀 feat: v0.1.9 배포 (#42)
* 🚑️ fix: 이미지 생성 폰트 변경
1 parent 1f23e50 commit fa4a3b3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app-maple-stamp-api/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ ARG JAR_FILE=build/libs/app-maple-stamp-api-0.0.1-SNAPSHOT.jar
55
ARG CONTAINER_JAR_FILE=app-maple-stamp-api.jar
66
COPY ${JAR_FILE} ${CONTAINER_JAR_FILE}
77

8+
# Install Fonts
9+
RUN apt-get DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
10+
fontconfig \
11+
fonts-liberation
12+
813
EXPOSE 9000
914

1015
# Spring Boot를 실행하기 위한 entry point 지정

app-maple-stamp-api/src/main/java/com/mapletrend/appmaplestampapi/service/StampService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ public byte[] createStampImage(JSONObject jsonObject) {
4949
graphics2D.fillRect(0, 0, 600, 200);
5050

5151
int fontSize = 30;
52-
graphics2D.setFont(new Font(null, Font.BOLD, fontSize));
52+
graphics2D.setFont(new Font("Liberation Sans", Font.BOLD, fontSize));
5353
graphics2D.setColor(Color.black);
5454
graphics2D.drawString(invenNickname, 30, 60);
5555

56-
graphics2D.setFont(new Font(null, Font.PLAIN, 20));
56+
graphics2D.setFont(new Font("Liberation Sans", Font.PLAIN, 20));
5757
graphics2D.drawString("레벨: " + formattedCharacterLevel, 30, 100);
5858
graphics2D.drawString("전투력: " + formattedBattlePower, 30, 130);
5959
graphics2D.drawString("유니온: " + formattedUnionLevel, 30, 160);
6060

61-
Font detailsFont = new Font(null, Font.PLAIN, 12);
61+
Font detailsFont = new Font("Liberation Sans", Font.PLAIN, 12);
6262
graphics2D.setFont(detailsFont);
6363
// Calculate position for the text
6464
FontMetrics metrics = graphics2D.getFontMetrics(detailsFont);
@@ -81,7 +81,7 @@ public byte[] createStampImage(JSONObject jsonObject) {
8181
String watermarkText = invenNickname;
8282

8383
// Set watermark properties
84-
graphics2D.setFont(new Font(null, Font.PLAIN, watermarkFontSize));
84+
graphics2D.setFont(new Font("Liberation Sans", Font.PLAIN, watermarkFontSize));
8585
graphics2D.setColor(new Color(0, 0, 0, 128));
8686
graphics2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
8787

0 commit comments

Comments
 (0)