From 1ecd5499877405c6788b682e946e71353a2fb20b Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 5 Dec 2019 18:58:02 +0100 Subject: [PATCH] Fonts optimization --- radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp | 4 ++-- radio/src/thirdparty/libopenui/src/button.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp index 896d2ad0d..fe10416ec 100644 --- a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp +++ b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp @@ -452,11 +452,11 @@ coord_t BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_ c -= 1; c += CJK_FIRST_LETTER_INDEX; uint8_t width = drawChar(x, y, font, fontspecs, c, flags); - INCREMENT_POS(width); + INCREMENT_POS(width + 1); } else if (c > 0x20) { uint8_t width = drawChar(x, y, font, fontspecs, getMappedChar(c), flags); - INCREMENT_POS(width); + INCREMENT_POS(width + 1); } else if (c == '\n') { pos = orig_pos; diff --git a/radio/src/thirdparty/libopenui/src/button.cpp b/radio/src/thirdparty/libopenui/src/button.cpp index 97ab5c371..011c07d3f 100644 --- a/radio/src/thirdparty/libopenui/src/button.cpp +++ b/radio/src/thirdparty/libopenui/src/button.cpp @@ -102,7 +102,8 @@ void TextButton::paint(BitmapBuffer * dc) } } - dc->drawText(rect.w / 2, (rect.h - getFontHeight(textFlags)) / 2, text.c_str(), CENTERED | textColor); + TRACE("ICI %d %d", rect.h, getFontHeight(textFlags)); + dc->drawText(rect.w / 2, (rect.h - getFontHeight(textFlags)) / 2, text.c_str(), CENTERED | textFlags | textColor); } void IconButton::paint(BitmapBuffer * dc)