From 3ed84e1c3edba46fe8990544ef7e58fe8e3dd901 Mon Sep 17 00:00:00 2001
From: tassaron
Date: Tue, 8 Aug 2017 20:53:51 -0400
Subject: fixed incorrect outline for small-caps
---
src/components/text.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
(limited to 'src/components')
diff --git a/src/components/text.py b/src/components/text.py
index f6bd17d..4d4f5d3 100644
--- a/src/components/text.py
+++ b/src/components/text.py
@@ -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"')
--
cgit v1.2.3
calidraw fork; this is more so a personal build for my own use, features that i don't use are probably broken
|