Skip to content
Permalink
Browse files
Add small caps tests
  • Loading branch information
nyalldawson committed Nov 8, 2021
1 parent 5875253 commit 00554eff76fa8b795e91c3534643436796163077
@@ -14,10 +14,11 @@

import qgis # NOQA
from PyQt5.QtSvg import QSvgGenerator
from qgis.PyQt.QtCore import (Qt, QSizeF, QPointF, QRectF, QDir, QSize)
from qgis.PyQt.QtCore import (Qt, QT_VERSION_STR, QSizeF, QPointF, QRectF, QDir, QSize)
from qgis.PyQt.QtGui import (QColor, QPainter, QFont, QImage, QBrush, QPen)
from qgis.PyQt.QtXml import QDomDocument
from qgis.core import (QgsTextBufferSettings,
from qgis.core import (Qgis,
QgsTextBufferSettings,
QgsTextMaskSettings,
QgsTextBackgroundSettings,
QgsTextShadowSettings,
@@ -1506,6 +1507,24 @@ def checkRenderPoint(self, format, name, part=None, angle=0, alignment=QgsTextRe
painter.end()
return self.imageCheck(name, name, image)

@unittest.skipIf(int(QT_VERSION_STR.split('.')[0]) < 6 or (int(QT_VERSION_STR.split('.')[0]) == 6 and int(QT_VERSION_STR.split('.')[1]) < 3), 'Too old Qt')
def testDrawSmallCaps(self):
format = QgsTextFormat()
format.setFont(getTestFont('bold'))
format.setCapitalization(Qgis.Capitalization.SmallCaps)
format.setSize(30)
assert self.checkRender(format, 'mixed_small_caps', text=['Small Caps'])
assert False

@unittest.skipIf(int(QT_VERSION_STR.split('.')[0]) < 6 or (int(QT_VERSION_STR.split('.')[0]) == 6 and int(QT_VERSION_STR.split('.')[1]) < 3), 'Too old Qt')
def testDrawAllSmallCaps(self):
format = QgsTextFormat()
format.setFont(getTestFont('bold'))
format.setSize(30)
format.setCapitalization(Qgis.Capitalization.AllSmallCaps)
assert self.checkRender(format, 'all_small_caps', text=['Small Caps'])
assert False

def testDrawBackgroundDisabled(self):
format = QgsTextFormat()
format.setFont(getTestFont('bold'))
Binary file not shown.
Binary file not shown.

0 comments on commit 00554ef

Please sign in to comment.