From 0a97252f9cf1dd5c2278bfc7616582ae30d0a25e Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Wed, 17 Mar 2021 18:40:56 +0100 Subject: [PATCH 1/2] Add support for text styles on Win32+Celiagg --- kiva/celiagg.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kiva/celiagg.py b/kiva/celiagg.py index 05aee2947..6d39599e4 100644 --- a/kiva/celiagg.py +++ b/kiva/celiagg.py @@ -627,8 +627,16 @@ def set_font(self, font): """ Set the font for the current graphics context. """ if sys.platform in ('win32', 'cygwin'): + # Have to pass weight and italic on Win32 + italic = (font.style in (constants.ITALIC, constants.BOLD_ITALIC)) + weight = agg.FontWeight.Regular + if font.style in (constants.BOLD, constants.BOLD_ITALIC): + weight = agg.FontWeight.Bold + # Win32 font selection is handled by the OS - self.font = agg.Font(font.findfontname(), font.size) + self.font = agg.Font( + font.findfontname(), font.size, weight, italic + ) else: # FreeType font selection is handled by kiva spec = font.findfont() From 9a1124f3f21a7852106d7bca23689356771a4a67 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Mon, 22 Mar 2021 16:18:45 +0100 Subject: [PATCH 2/2] Unpin Celiagg --- ci/edmtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index ebb54b5ab..dbd6def08 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -90,7 +90,7 @@ dependencies = { "apptools", - "celiagg^=2.0.0", + "celiagg", "coverage", "Cython", "fonttools",