Add a way for applications to supply custom fonts#711
Conversation
|
Perhaps this: |
|
Works just fine on Windows 🎉 |
|
From the Qt docs:
Also, |
|
macOS + pyqt appears to have crashed when running the OpenGL drawing tests... Sort of an improvement. The tests are passing for the new feature. |
|
I've been trying to experiment with the new Update : I came across the Noto fonts (https://web.archive.org/web/20150411172453if_/http://www.google.com/get/noto/) while browsing the Microsoft Font Typography Vendor page (https://docs.microsoft.com/en-gb/typography/font-list/). I was able to successfully add it in the but then when I tried using the font via Edit : |
rahulporuri
left a comment
There was a problem hiding this comment.
LGTM with a few questions/comments. I tested this in the kiva explorer with a font I downloaded and things worked as expected.
There's one minor user improvement I request. When I downloaded the Font, I downloaded a zip archive which contained 4 font files - one for each style i.e. regular, bold, bold italic and italic. I needed to add each font file separately to be able to use style kwarg to Font correctly. Do you think it makes sense to support passing directories to add_application_font?
We should also update the user documentation - but we can also do that in a separate PR if you prefer that.
| if ext in fontexts: | ||
| fontfiles.add(path) | ||
|
|
||
| return sorted(fontfiles) |
There was a problem hiding this comment.
I didn't know that sorting a set will return a list - in case anyone was wondering if it'll be a problem that we're returning an empty list above but a sorted set here.
|
I tried using the kiva explorer on wx (because i wanted to try this PR on wx) and I ran into a few issues across ETS - enthought/pyface#901, enthought/traitsui#1535 and #713. |
|
After fixing issues with the ETS libraries (traitsui and pyface) underneath, I was actually able to get this working with the wx toolkit - and it works perfectly 🎉 |
|
The macOS test is calling |
|
I've disabled the GL drawing test on everything but Linux now. CI is finally happy (and I still hate the GL backend). |
Closes #555
This works well with the QPainter and AGG backends. It does not work with the Quartz backend. Also, I was not able to test this properly with Wx because the feature isn't supported in the wheel that I installed (perhaps it's a macOS thing?).