From dd29164bcf2b5260d23acf9c65775b13812850bb Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Fri, 5 Aug 2022 09:05:49 +0100 Subject: [PATCH 1/2] Use font family in quartz when no font name given. --- kiva/quartz/ABCGI.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index e298e4c65..14c6b7026 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -809,7 +809,11 @@ cdef class CGContext: constants.ITALIC: 'italic', constants.BOLD_ITALIC: 'bold italic', }[font.is_bold() | font.style] - self.select_font(font.face_name, font.size, style=style) + if font.face_name: + name = font.face_name + else: + name = font.findfontname() + self.select_font(name, font.size, style=style) def set_font_size(self, float size): """ Change the size of the currently selected font From 903451315b2d0150acfb29d2f9d7941f954715f0 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Fri, 5 Aug 2022 09:20:57 +0100 Subject: [PATCH 2/2] Render quartz text with fill color rather than stroke color. --- kiva/quartz/ABCGI.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiva/quartz/ABCGI.pyx b/kiva/quartz/ABCGI.pyx index 14c6b7026..ffd85fa5b 100644 --- a/kiva/quartz/ABCGI.pyx +++ b/kiva/quartz/ABCGI.pyx @@ -938,7 +938,8 @@ cdef class CGContext: pointer = self.current_font.get_pointer() ct_font = pointer - ct_line = _create_ct_line(text, ct_font, self.stroke_color) + # using fill_color here brings rendering in line with Agg backends + ct_line = _create_ct_line(text, ct_font, self.fill_color) if ct_line == NULL: return