mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 16:55:15 +03:00
Extra chars not displayed
This commit is contained in:
parent
dd03629ef2
commit
2589b9e87e
2 changed files with 11 additions and 6 deletions
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 13 KiB |
|
@ -92,21 +92,26 @@ class FontBitmap:
|
||||||
|
|
||||||
width = 0
|
width = 0
|
||||||
for c in self.chars:
|
for c in self.chars:
|
||||||
coords.append(width)
|
|
||||||
|
|
||||||
if c == " ":
|
if c == " ":
|
||||||
width += 4
|
w = 4
|
||||||
elif c in special_chars["cn"]:
|
elif c in special_chars["cn"]:
|
||||||
width += self.draw_char(image, width, c, self.cjk_font)
|
w = self.draw_char(image, width, c, self.cjk_font)
|
||||||
elif c not in extra_chars:
|
elif c not in extra_chars:
|
||||||
width += self.draw_char(image, width, c, self.font)
|
w = self.draw_char(image, width, c, self.font)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
coords.append(width)
|
||||||
|
width += w
|
||||||
|
|
||||||
coords.append(width)
|
coords.append(width)
|
||||||
|
|
||||||
_, top, _, bottom = self.get_real_size(image)
|
_, top, _, bottom = self.get_real_size(image)
|
||||||
|
|
||||||
if self.extra_bitmap:
|
if self.extra_bitmap:
|
||||||
image.paste(self.extra_bitmap.copy(), (width, top))
|
image.paste(self.extra_bitmap.copy(), (width, top))
|
||||||
width += self.extra_bitmap.width
|
for coord in [14, 14, 12, 12, 13, 13, 13, 13, 13] + [15] * 12:
|
||||||
|
width += coord
|
||||||
|
coords.append(width)
|
||||||
|
|
||||||
image = image.crop((0, top, width, bottom))
|
image = image.crop((0, top, width, bottom))
|
||||||
coords.insert(0, bottom - top)
|
coords.insert(0, bottom - top)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue