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

Font cosmetics

This commit is contained in:
Bertrand Songis 2019-12-13 12:00:37 +01:00
parent 9262a317b6
commit 22cfe6499a
No known key found for this signature in database
GPG key ID: F189F79290FEC50F

View file

@ -82,9 +82,12 @@ class FontBitmap:
draw = ImageDraw.Draw(char_image)
draw.text((-offset, 0), c, fill=self.foreground, font=font)
left, _, right, _ = self.get_real_size(char_image)
if right + offset + 1 < width:
# print("char %c: space reduced" % c)
width = right + offset + 1
if image:
image.paste(char_image.crop((left, 0, right + 1, image.height)), (x, 0))
return right - left + 1
image.paste(char_image.crop((-offset, 0, width, image.height)), (x, 0))
return width
def generate(self, filename, generate_coords_file=True):
coords = []