Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kiva/qpainter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import warnings

# Major package imports.
from pyface.qt import QtCore, QtGui
from pyface.qt import QtCore, QtGui, is_qt5

# Local imports.
from .abstract_graphics_context import AbstractGraphicsContext
Expand Down Expand Up @@ -75,7 +75,7 @@
constants.WEIGHT_BOLD: QtGui.QFont.Weight.Bold,
constants.WEIGHT_EXTRABOLD: QtGui.QFont.Weight.ExtraBold,
constants.WEIGHT_HEAVY: QtGui.QFont.Weight.Black,
constants.WEIGHT_EXTRAHEAVY: 99,
constants.WEIGHT_EXTRAHEAVY: 99 if is_qt5 else QtGui.QFont.Weight.Black,
}

gradient_coord_modes = {}
Expand Down
19 changes: 16 additions & 3 deletions kiva/tests/drawing_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
from kiva.api import (
DECORATIVE, DEFAULT, ITALIC, MODERN, NORMAL, ROMAN, SCRIPT, TELETYPE, Font
)
from kiva.constants import (
WEIGHT_THIN, WEIGHT_EXTRALIGHT, WEIGHT_LIGHT, WEIGHT_NORMAL, WEIGHT_MEDIUM,
WEIGHT_SEMIBOLD, WEIGHT_BOLD, WEIGHT_EXTRABOLD, WEIGHT_HEAVY,
WEIGHT_EXTRAHEAVY
)


families = [DECORATIVE, DEFAULT, MODERN, ROMAN, SCRIPT, TELETYPE]

weights = [
WEIGHT_THIN, WEIGHT_EXTRALIGHT, WEIGHT_LIGHT, WEIGHT_NORMAL, WEIGHT_MEDIUM,
WEIGHT_SEMIBOLD, WEIGHT_BOLD, WEIGHT_EXTRABOLD, WEIGHT_HEAVY,
WEIGHT_EXTRAHEAVY,
]


class DrawingTester(object):
Expand Down Expand Up @@ -79,9 +93,8 @@ def test_quarter_circle(self):
self.gc.stroke_path()

def test_text(self):
for family in [
DECORATIVE, DEFAULT, ITALIC, MODERN, ROMAN, SCRIPT, TELETYPE]:
for weight in range(100, 1001, 100):
for family in families:
for weight in weights:
for style in [NORMAL, ITALIC]:
with self.subTest(family=family, weight=weight, style=style):
self.gc = self.create_graphics_context()
Expand Down