diff --git a/tools/apps/hgjson/DlgZk.cpp b/tools/apps/hgjson/DlgZk.cpp index b73bed2..c441428 100644 --- a/tools/apps/hgjson/DlgZk.cpp +++ b/tools/apps/hgjson/DlgZk.cpp @@ -101,21 +101,28 @@ void CDlgZk::regen(void) std::string ansi(util::u2a(text)); ansi = hz_2_py::getLetter(ansi); std::transform(ansi.begin(), ansi.end(), ansi.begin(), tolower); - sep += util::a2u(ansi.c_str()) + L"[] = {" + std::to_wstring(out.cx) + L", " + std::to_wstring(out.cy) + L"\r\n\t\t"; - swprintf_s(text, L", 0x%02X", ptr[0]); + fs = util::a2u(ansi.c_str()); + sep += fs + L"[] = {" + std::to_wstring(out.cx) + L", " + std::to_wstring(out.cy) + L"\r\n\t\t"; + { + ansi = util::u2a(text, true); + uint8_t* p = (uint8_t*)&ansi[0]; + swprintf_s(text, _countof(text) - 1, L"\\%03o\\%03o\\%03o", p[0], p[1], p[2]); + os = std::wstring(L"font_map_[\"") + text + L"\"] = " + fs + L";"; + } + swprintf_s(text, _countof(text) - 1, L", 0x%02X", ptr[0]); sep += text; for (int i = 1; i < out.cx * out.cy / 8; ++i) { if (i % 16 == 0) - swprintf_s(text, L"\r\n\t\t, 0x%02X", ptr[i]); + swprintf_s(text, _countof(text) - 1, L"\r\n\t\t, 0x%02X", ptr[i]); else if (i % 8 == 0) - swprintf_s(text, L", 0x%02X", ptr[i]); + swprintf_s(text, _countof(text) - 1, L", 0x%02X", ptr[i]); else - swprintf_s(text, L", 0x%02X", ptr[i]); + swprintf_s(text, _countof(text) - 1, L", 0x%02X", ptr[i]); sep += text; } delete[] ptr; - sep += L"\r\n\t};\r\n\r\n"; + sep += L"\r\n\t};\r\n" + os + L"\r\n\r\n"; } ::ReleaseDC(hwnd, hdc); diff --git a/tools/solution/Release/hgjson.exe b/tools/solution/Release/hgjson.exe index fae1070..9440d20 100644 Binary files a/tools/solution/Release/hgjson.exe and b/tools/solution/Release/hgjson.exe differ