diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index 88e888415..08ebd5c62 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit 88e88841555a6e105e973b8666288999928fb290 +Subproject commit 08ebd5c62e8968e9bad2a73a6511113b0fb35cbb diff --git a/tools/build-font-bitmap.py b/tools/build-font-bitmap.py index 66827c223..8c4235cd7 100755 --- a/tools/build-font-bitmap.py +++ b/tools/build-font-bitmap.py @@ -88,28 +88,26 @@ class FontBitmap: def generate(self, filename, generate_coords_file=True): coords = [] - image = Image.new("RGB", (len(self.chars) * self.font_size, self.font_size + 10), self.background) + image = Image.new("RGB", (len(self.chars) * self.font_size + 200, self.font_size + 20), self.background) width = 0 for c in self.chars: coords.append(width) - if c in extra_chars: - if self.extra_bitmap and c == extra_chars[0]: - if self.font_size == 16: - offset = 1 - else: - offset = self.font_size % 2 - image.paste(self.extra_bitmap.copy(), (width, offset)) - elif c == " ": + if c == " ": width += 4 elif c in special_chars["cn"]: width += self.draw_char(image, width, c, self.cjk_font) - else: + elif c not in extra_chars: width += self.draw_char(image, width, c, self.font) coords.append(width) _, top, _, bottom = self.get_real_size(image) + + if self.extra_bitmap: + image.paste(self.extra_bitmap.copy(), (width, top)) + width += self.extra_bitmap.width + image = image.crop((0, top, width, bottom)) coords.insert(0, bottom - top)