diff options
| author | Maximilian Siess | 2017-04-20 19:01:19 +0200 |
|---|---|---|
| committer | Maximilian Siess | 2017-04-20 19:01:19 +0200 |
| commit | 8423d958201f0230f4c4887a4b75f14f54a2161a (patch) | |
| tree | 6af71206ccee644e3b39419b708dc747fab9f169 /core.py | |
| parent | f639760ffc8f3152b46c32a881303a7522b8daca (diff) | |
added font size of text in preview
Diffstat (limited to 'core.py')
| -rw-r--r-- | core.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -26,7 +26,7 @@ class Core(): except: return "avconv" - def drawBaseImage(self, backgroundImage, titleText, titleFont, alignment, xOffset, yOffset): + def drawBaseImage(self, backgroundImage, titleText, titleFont, fontSize, alignment, xOffset, yOffset): if self._image == None or not self.lastBackgroundImage == backgroundImage: self.lastBackgroundImage = backgroundImage @@ -45,19 +45,19 @@ class Core(): self._image1 = QtGui.QImage(self._image) painter = QPainter(self._image1) font = titleFont - font.setPointSizeF(35) + font.setPointSizeF(fontSize) painter.setFont(font) painter.setPen(QColor(255, 255, 255)) - yPosition = 375 + yOffset + yPosition = yOffset fm = QtGui.QFontMetrics(font) if alignment == "Left": - xPosition = 70 + xOffset + xPosition = xOffset if alignment == "Middle": - xPosition = xOffset + (1280/2 - fm.width(titleText)/2) + xPosition = xOffset - fm.width(titleText)/2 if alignment == "Right": - xPosition = xOffset + (1210 - fm.width(titleText)) + xPosition = xOffset - fm.width(titleText) painter.drawText(xPosition, yPosition, titleText) painter.end() |
