--- nono/wx/wxtextpanel.cpp 2026/04/29 17:05:16 1.1.1.9 +++ nono/wx/wxtextpanel.cpp 2026/04/29 17:05:31 1.1.1.11 @@ -82,7 +82,7 @@ WXTextPanel::DrawStringSJIS(int px, int px += font_width; } else { // 全角 - int code; + uint code; code = (*s++ << 8); code |= *s++; DrawChar2(px, py, code, attr); @@ -92,29 +92,31 @@ WXTextPanel::DrawStringSJIS(int px, int } // (px, py) を左上とする座標から半角文字 code を属性 attr で描画する。 -// code は ASCII または半角カナ。 +// code は ASCII または半角カナ。attr のうち反応するのは Bold のみ。 // フォントサイズは現行のフォント。 void WXTextPanel::DrawChar1(int px, int py, uint code, uint attr) { - const uint8 *glyph; - assertmsg(code < 0x100, "code=0x%x", code); - glyph = gFontManager->AsciiGlyph(code, attr); + const uint8 *glyph = gFontManager->AsciiGlyph(code); BitmapI1 src(glyph, font_width, font_height); - bitmap.DrawBitmap(px, py, src, palette); + if (__predict_false((attr & TA::Bold))) { + src = src.ConvertToBold(); + } + bitmap.DrawBitmapI1(px, py, src, palette); } // (px, py) を左上とする座標から漢字1文字を属性 attr で描画する。 -// sjiscode は Shift_JIS。 +// sjiscode は Shift_JIS。attr のうち反応するのは Bold のみ。 // フォントサイズは現行のフォント。 void WXTextPanel::DrawChar2(int px, int py, uint sjiscode, uint attr) { - std::vector glyph; - - glyph = gFontManager->KanjiGlyph(sjiscode, attr); - BitmapI1 src(glyph.data(), font_width * 2, font_height); - bitmap.DrawBitmap(px, py, src, palette); + const uint8 *glyph = gFontManager->KanjiGlyph(sjiscode); + BitmapI1 src(glyph, font_width * 2, font_height); + if (__predict_false((attr & TA::Bold))) { + src = src.ConvertToBold(); + } + bitmap.DrawBitmapI1(px, py, src, palette); }