fixed incorrect outline for small-caps
This commit is contained in:
parent
4d0daa4336
commit
3ed84e1c3e
|
@ -146,7 +146,18 @@ class Component(Component):
|
|||
outliner = QtGui.QPainterPathStroker()
|
||||
outliner.setWidth(self.stroke)
|
||||
path = QtGui.QPainterPath()
|
||||
path.addText(x, y, font, self.title)
|
||||
if self.fontStyle == 6:
|
||||
# PathStroker ignores smallcaps so we need this weird hack
|
||||
path.addText(x, y, font, self.title[0])
|
||||
fm = QtGui.QFontMetrics(font)
|
||||
newX = x + fm.width(self.title[0])
|
||||
strokeFont = self.page.fontComboBox_titleFont.currentFont()
|
||||
strokeFont.setCapitalization(QFont.SmallCaps)
|
||||
strokeFont.setPixelSize(int((self.fontSize / 7) * 5))
|
||||
strokeFont.setLetterSpacing(QFont.PercentageSpacing, 139)
|
||||
path.addText(newX, y, strokeFont, self.title[1:])
|
||||
else:
|
||||
path.addText(x, y, font, self.title)
|
||||
path = outliner.createStroke(path)
|
||||
image.setPen(QtCore.Qt.NoPen)
|
||||
image.setBrush(PaintColor(*self.strokeColor))
|
||||
|
@ -167,8 +178,6 @@ class Component(Component):
|
|||
|
||||
return frame
|
||||
|
||||
|
||||
|
||||
def commandHelp(self):
|
||||
print('Enter a string to use as centred white text:')
|
||||
print(' "title=User Error"')
|
||||
|
|
Reference in New Issue