From 8c69f53073e0813541359c65c64a1af97a050c2c Mon Sep 17 00:00:00 2001 From: kichikuou Date: Fri, 11 Sep 2026 13:42:31 +0900 Subject: [PATCH] SACT: Use bold font weight --- modules/SACT/sactlog.c | 6 +++++- modules/lib/drawtext.c | 13 ++++++++----- modules/lib/sactcg.c | 6 ++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/SACT/sactlog.c b/modules/SACT/sactlog.c index 02156a1..13620e1 100644 --- a/modules/SACT/sactlog.c +++ b/modules/SACT/sactlog.c @@ -97,7 +97,11 @@ static void draw_log() { if (0 == strcmp(str, "\n")) { SDL_BlitSurface(hline, NULL, main_surface, &(SDL_Rect){0, y + FONTSIZE/2, main_surface->w, 3}); } else { - FontSpec font_spec = { .type = cur < 6 ? FONT_MINCHO : FONT_GOTHIC, .size = FONTSIZE }; + FontSpec font_spec = { + .type = cur < 6 ? FONT_MINCHO : FONT_GOTHIC, + .weight = cur < 6 ? FONT_WEIGHT_NORMAL : FONT_WEIGHT_BOLD, + .size = FONTSIZE + }; gfx_drawString(0, y, str, 255, font_spec); } y += FONTSIZE; diff --git a/modules/lib/drawtext.c b/modules/lib/drawtext.c index e3ea50b..1bec4c5 100644 --- a/modules/lib/drawtext.c +++ b/modules/lib/drawtext.c @@ -31,8 +31,11 @@ #include "ags.h" #include "font.h" -static FontType ftype; -static int fsize; // フォントの大きさ +static FontSpec dt_spec = { + .type = FONT_GOTHIC, + .weight = FONT_WEIGHT_BOLD, + .size = 12 +}; /** * 次に描く文字のフォントの種類と大きさを設定 @@ -48,8 +51,8 @@ void dt_setfont(FontType type, int size) { } #endif - ftype = type; - fsize = size; + dt_spec.type = type; + dt_spec.size = size; } /** @@ -66,7 +69,7 @@ void dt_setfont(FontType type, int size) { * @return: 実際に描画した幅 */ int dt_drawtext_col(SDL_Surface *sf, int x, int y, char *buf, int r, int g, int b) { - SDL_Surface *glyph = ags_drawStringToSurface(buf, r, g, b, (FontSpec){ .type = ftype, .size = fsize }); + SDL_Surface *glyph = ags_drawStringToSurface(buf, r, g, b, dt_spec); if (glyph == NULL) return 0; SDL_Rect rect = {x, y, glyph->w, glyph->h}; diff --git a/modules/lib/sactcg.c b/modules/lib/sactcg.c index 6df61cd..ed8a474 100644 --- a/modules/lib/sactcg.c +++ b/modules/lib/sactcg.c @@ -220,7 +220,8 @@ void scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) { // 勝手に出ていいのかな? if (svar_length(wText) == 0) return; - SDL_Surface *glyph = ags_drawStringToSurface(svar_get(wText), wR, wG, wB, (FontSpec){ .size = wSize }); + FontSpec spec = { .type = FONT_GOTHIC, .weight = FONT_WEIGHT_BOLD, .size = wSize }; + SDL_Surface *glyph = ags_drawStringToSurface(svar_get(wText), wR, wG, wB, spec); SDL_Surface *sf = SDL_CreateRGBSurfaceWithFormat(0, glyph->w, wSize, 32, SDL_PIXELFORMAT_ARGB8888); SDL_SetSurfaceBlendMode(glyph, SDL_BLENDMODE_NONE); @@ -244,7 +245,8 @@ void scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs } sprintf(s, ss, wValue); - SDL_Surface *glyph = ags_drawStringToSurface(s, wR, wG, wB, (FontSpec){ .size = wSize }); + FontSpec spec = { .type = FONT_GOTHIC, .weight = FONT_WEIGHT_BOLD, .size = wSize }; + SDL_Surface *glyph = ags_drawStringToSurface(s, wR, wG, wB, spec); SDL_Surface *sf = SDL_CreateRGBSurfaceWithFormat(0, glyph->w, wSize, 32, SDL_PIXELFORMAT_ARGB8888); SDL_SetSurfaceBlendMode(glyph, SDL_BLENDMODE_NONE);