--- nono/wx/fontmanager.cpp 2026/04/29 17:05:09 1.1 +++ nono/wx/fontmanager.cpp 2026/04/29 17:05:19 1.1.1.4 @@ -11,7 +11,7 @@ #include "fontmanager.h" #include "privatechar.h" #include "wxtextpanel.h" -#include "cgrom.h" +#include "builtinrom.h" #include "kaname12.h" // グローバル参照用 @@ -35,14 +35,17 @@ FontManager::SetFont(FontId fontid_) fontid = fontid_; // フォントデータを更新。 - // 6x12, 8x16 半角は X68030 CGROM にあるのでそれを使う。 + // 6x12, 8x16, 12x24 半角は X68030 CGROM にあるのでそれを使う。 const uint8 *base; switch (fontid) { case FontId::_6x12: - base = BuiltinCGROM::Get6x12(); + base = Builtin::CGROM6x12(); break; case FontId::_8x16: - base = BuiltinCGROM::Get8x16(); + base = Builtin::CGROM8x16(); + break; + case FontId::_12x24: + base = Builtin::CGROM12x24(); break; default: PANIC("fontid=%d", fontid); @@ -82,8 +85,11 @@ FontManager::SetFont(FontId fontid_) case FontId::_8x16: ptr = (const char *)pchar.data16; break; + case FontId::_12x24: + ptr = (const char *)pchar.data24; + break; default: - __unreachable(); + PANIC("corrupted fontid=%d", (int)fontid); } int idx = pchar.code * font_bytes; @@ -103,7 +109,7 @@ FontManager::AsciiGlyph(uint8 code, uint const std::vector *glyph; // ボールドかどうかでテーブルが別 - if ((attr & TA::Em)) { + if ((attr & TA::Bold)) { glyph = &bold_glyph; } else { glyph = &ascii_glyph; @@ -174,11 +180,15 @@ FontManager::KanjiGlyph(uint16 sjiscode, break; case FontId::_8x16: // 16x16 は X680x0 CGROM のを使う。 - base = BuiltinCGROM::Get16x16(); + base = Builtin::CGROM16x16(); + break; + case FontId::_12x24: + // 24x24 は X680x0 CGROM のを使う。 + base = Builtin::CGROM24x24(); break; default: // ここより先に必ず半角のほうでエラーが出るはず - __unreachable(); + PANIC("corrupted fontid=%d", (int)fontid); } int bytes = (((font_width * 2) + 7) / 8) * font_height; @@ -186,7 +196,7 @@ FontManager::KanjiGlyph(uint16 sjiscode, memcpy(&buf[0], base + code * bytes, bytes); - if (attr == TA::Em) { + if ((attr & TA::Bold)) { for (int i = 0; i < bytes; i++) { buf[i] |= buf[i] >> 1; } @@ -201,4 +211,5 @@ FontManager::fontinfo = { // 順序はヘッダの FontId_* 識別子の順と揃えること FONT_6x12, FONT_8x16, + FONT_12x24, };