mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
Font cosmetics
This commit is contained in:
parent
9262a317b6
commit
22cfe6499a
1 changed files with 5 additions and 2 deletions
|
@ -82,9 +82,12 @@ class FontBitmap:
|
||||||
draw = ImageDraw.Draw(char_image)
|
draw = ImageDraw.Draw(char_image)
|
||||||
draw.text((-offset, 0), c, fill=self.foreground, font=font)
|
draw.text((-offset, 0), c, fill=self.foreground, font=font)
|
||||||
left, _, right, _ = self.get_real_size(char_image)
|
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:
|
if image:
|
||||||
image.paste(char_image.crop((left, 0, right + 1, image.height)), (x, 0))
|
image.paste(char_image.crop((-offset, 0, width, image.height)), (x, 0))
|
||||||
return right - left + 1
|
return width
|
||||||
|
|
||||||
def generate(self, filename, generate_coords_file=True):
|
def generate(self, filename, generate_coords_file=True):
|
||||||
coords = []
|
coords = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue