mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
SACT: Use bold font weight
This commit is contained in:
@@ -97,7 +97,11 @@ static void draw_log() {
|
|||||||
if (0 == strcmp(str, "\n")) {
|
if (0 == strcmp(str, "\n")) {
|
||||||
SDL_BlitSurface(hline, NULL, main_surface, &(SDL_Rect){0, y + FONTSIZE/2, main_surface->w, 3});
|
SDL_BlitSurface(hline, NULL, main_surface, &(SDL_Rect){0, y + FONTSIZE/2, main_surface->w, 3});
|
||||||
} else {
|
} 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);
|
gfx_drawString(0, y, str, 255, font_spec);
|
||||||
}
|
}
|
||||||
y += FONTSIZE;
|
y += FONTSIZE;
|
||||||
|
|||||||
@@ -31,8 +31,11 @@
|
|||||||
#include "ags.h"
|
#include "ags.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
|
|
||||||
static FontType ftype;
|
static FontSpec dt_spec = {
|
||||||
static int fsize; // フォントの大きさ
|
.type = FONT_GOTHIC,
|
||||||
|
.weight = FONT_WEIGHT_BOLD,
|
||||||
|
.size = 12
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 次に描く文字のフォントの種類と大きさを設定
|
* 次に描く文字のフォントの種類と大きさを設定
|
||||||
@@ -48,8 +51,8 @@ void dt_setfont(FontType type, int size) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ftype = type;
|
dt_spec.type = type;
|
||||||
fsize = size;
|
dt_spec.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +69,7 @@ void dt_setfont(FontType type, int size) {
|
|||||||
* @return: 実際に描画した幅
|
* @return: 実際に描画した幅
|
||||||
*/
|
*/
|
||||||
int dt_drawtext_col(SDL_Surface *sf, int x, int y, char *buf, int r, int g, int b) {
|
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;
|
if (glyph == NULL) return 0;
|
||||||
|
|
||||||
SDL_Rect rect = {x, y, glyph->w, glyph->h};
|
SDL_Rect rect = {x, y, glyph->w, glyph->h};
|
||||||
|
|||||||
@@ -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;
|
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_Surface *sf = SDL_CreateRGBSurfaceWithFormat(0, glyph->w, wSize, 32, SDL_PIXELFORMAT_ARGB8888);
|
||||||
SDL_SetSurfaceBlendMode(glyph, SDL_BLENDMODE_NONE);
|
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);
|
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_Surface *sf = SDL_CreateRGBSurfaceWithFormat(0, glyph->w, wSize, 32, SDL_PIXELFORMAT_ARGB8888);
|
||||||
SDL_SetSurfaceBlendMode(glyph, SDL_BLENDMODE_NONE);
|
SDL_SetSurfaceBlendMode(glyph, SDL_BLENDMODE_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user