SACT: Use bold font weight

This commit is contained in:
kichikuou
2026-09-11 14:09:04 +09:00
parent cc96c85381
commit 8c69f53073
3 changed files with 17 additions and 8 deletions
+5 -1
View File
@@ -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;
+8 -5
View File
@@ -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};
+4 -2
View File
@@ -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);