[Horus] UI continued

This commit is contained in:
Bertrand Songis
2015-11-14 17:19:20 +01:00
parent f32231cab2
commit ed2f66aedd
28 changed files with 449 additions and 327 deletions
+3 -3
View File
@@ -49,12 +49,12 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
width = getFontWidth(fontsize, metrics)
top, bottom = getFontTopBottom(fontsize, metrics)
extraImage = QtGui.QImage("fonts/extra_%dpx.png" % (fontsize+1))
extraImage = QtGui.QImage("fonts/extra_%dpx.png" % fontsize)
if extraImage.isNull():
extraWidth = 0
else:
extraWidth = extraImage.size().width()
image = QtGui.QImage(width + extraWidth, fontsize+1, QtGui.QImage.Format_RGB32)
image = QtGui.QImage(width + extraWidth, fontsize+2, QtGui.QImage.Format_RGB32)
image.fill(background)
painter = QtGui.QPainter()
painter.begin(image)
@@ -73,7 +73,7 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
if fontsize >= 24:
painter.drawText(width-rect.left()+1, fontsize-2, c) # fontsize-bottom+1 -17 / 7
else:
painter.drawText(width-rect.left(), fontsize-2, c) # fontsize-bottom+1 -17 / 7
painter.drawText(width-rect.left(), fontsize-1, c) # fontsize-bottom+1 -17 / 7
width += getCharWidth(fontsize, metrics, i)
if extraWidth:
painter.drawImage(QtCore.QPoint(width, 0), extraImage)