[Horus] font fixes (#5901)
* avoid generating a blank part for font size that do not have extras * use “stretch” instead of “jessie” .. and add libgtest-dev. * keep space width equal 4, no matter what * updated generated fonts * updated reference images * Replace PyQt completely (#5902) * ported img2lbm.py to Pillow (and get rid of PyQt) * removed PyQt from Dockerfile * fixed travis * fixed issue with img2lbm and Horus bitmaps
This commit is contained in:
committed by
Bertrand Songis
parent
842b04627a
commit
ea898e5122
@@ -33,25 +33,26 @@ def createFontBitmap(filename, fontname, fontsize, fontoffset, foreground, backg
|
||||
font = ImageFont.truetype(font_filename, fontsize)
|
||||
|
||||
extraImage = None
|
||||
extraWidth, extraHeight = 0, 0
|
||||
extraFilename = 'fonts/extra_%dpx.png' % fontsize
|
||||
|
||||
try:
|
||||
extraImage = Image.open(extraFilename)
|
||||
extraImage = extraImage.convert('RGB');
|
||||
extraWidth, extraHeight = extraImage.size
|
||||
|
||||
extraWidth = extraWidth / COUNT_EXTRA_CHARS
|
||||
|
||||
except IOError:
|
||||
print 'Missing extra symbol filename %s' % extraFilename
|
||||
|
||||
def getCharWidth(c):
|
||||
if c in chars_extra:
|
||||
if ord(c) <= 9:
|
||||
return 13
|
||||
if extraImage:
|
||||
# Extra characters 16px
|
||||
#if fontsize == 16:
|
||||
if ord(c) <= 9:
|
||||
return 13
|
||||
else:
|
||||
return 15
|
||||
else:
|
||||
return 15
|
||||
return 0
|
||||
elif c == " ":
|
||||
return 4
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user