Fix wrong Chinese characters being displayed (#1257)
* Fixed wrong index calculation. * Fixed font generation, indexing will goes wrong when no extra chars bitmap is present. * Image width exceeded 16384 will cause trouble in CJK. * Include libopenui update Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
Peter Feerick
parent
85bd9d16ea
commit
843d1be868
@@ -62,7 +62,7 @@ int getTextWidth(const char * s, int len, LcdFlags flags)
|
||||
else if (c >= 0xFE) { // CJK marker
|
||||
s++;
|
||||
c = uint8_t(*s) + ((c & 0x01) << 8) - 1;
|
||||
if (c >= 0x101)
|
||||
if (c >= 0x100)
|
||||
c -= 1;
|
||||
c += CJK_FIRST_LETTER_INDEX;
|
||||
result += getFontPatternWidth(specs, c) + 1;
|
||||
|
||||
Reference in New Issue
Block a user