mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Fix GfxPrint for Japanese UTF8 characters (#843)
This commit is contained in:
@@ -1533,7 +1533,6 @@ extern "C" void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(vo
|
||||
std::wstring wstr = StringToU16(str);
|
||||
|
||||
for (const auto& c : wstr) {
|
||||
unsigned char convt = ' ';
|
||||
if (c < 0x80) {
|
||||
printImpl(printer, c);
|
||||
} else if (c >= u'。' && c <= u'゚') { // katakana
|
||||
|
||||
@@ -323,16 +323,20 @@ void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t cha
|
||||
const char* str = (const char*)buffer;
|
||||
size_t count = charSize * charCount;
|
||||
|
||||
while (count != 0) {
|
||||
GfxPrint_PrintChar(this, *str++);
|
||||
count--;
|
||||
}
|
||||
// 2S2H [Port] Process the string with our wrapper that converts Japanese UTF8 characters for the print system
|
||||
OTRGfxPrint(str, this, GfxPrint_PrintChar);
|
||||
// while (count != 0) {
|
||||
// GfxPrint_PrintChar(this, *str++);
|
||||
// count--;
|
||||
// }
|
||||
}
|
||||
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str) {
|
||||
while (*str != '\0') {
|
||||
GfxPrint_PrintChar(this, *str++);
|
||||
}
|
||||
// 2S2H [Port] Process the string with our wrapper that converts Japanese UTF8 characters for the print system
|
||||
OTRGfxPrint(str, this, GfxPrint_PrintChar);
|
||||
// while (*str != '\0') {
|
||||
// GfxPrint_PrintChar(this, *str++);
|
||||
// }
|
||||
}
|
||||
|
||||
void* GfxPrint_Callback(void* arg, const char* str, size_t size) {
|
||||
|
||||
Reference in New Issue
Block a user