1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

Extra chars not displayed

This commit is contained in:
Bertrand Songis 2019-12-12 16:37:50 +01:00
parent dd03629ef2
commit 2589b9e87e
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
2 changed files with 11 additions and 6 deletions

View file

@ -92,21 +92,26 @@ class FontBitmap:
width = 0
for c in self.chars:
coords.append(width)
if c == " ":
width += 4
w = 4
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:
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)
_, top, _, bottom = self.get_real_size(image)
if self.extra_bitmap:
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))
coords.insert(0, bottom - top)