Closed pelson closed 7 years ago
Incidentally, I tested I could have "xkcd", "xkcd Script" and "Humor Sans" all installed and used within matplotlib with:
import matplotlib.pyplot as plt
import matplotlib.font_manager
xkcd_regular = matplotlib.font_manager.FontProperties(family='xkcd', size=40)
xkcd_script = matplotlib.font_manager.FontProperties(family='xkcd Script', size=40)
humour_sans = matplotlib.font_manager.FontProperties(family='Humor Sans', size=40)
fig = plt.figure(figsize=(12.5, 3), dpi=100)
text = 'Hello XKCD world. BETTER?'
plt.figtext(0.01, 0.7, text + ' (xkcd)', transform=fig.transFigure, fontproperties=xkcd_regular)
plt.figtext(0.01, 0.4, text + ' (xkcd Script)', transform=fig.transFigure, fontproperties=xkcd_script)
plt.figtext(0.01, 0.1, text + ' (Humor Sans)', transform=fig.transFigure, fontproperties=humour_sans)
plt.show()
And got:
Note: Matplotlib cannot currently do ligatures, as can be seen in the word "BETTER".
Things I'd like to do next, preferably in another PR 😉 :
Proposal: All of the above are known issues, I do not recommend improving the font in this PR, instead I'm keen to lay the foundations (i.e. merge), and iteratively improve (i.e. with small PRs)
I'm sold on that.
:+1: for merging and doing further improvements in another PR.
🎉 - thanks for moving it forwards guys.
As mentioned in #16, I have been playing with the handwriting sample provided by Randall, to see if we can auto-generate a decent font.
This PR pulls all of my work together. It:
Recommended way of reviewing: Take a look around the branch at https://github.com/pelson/xkcd-font/tree/xkcd-script-v3
Here is the "handwriting sample" re-generated using the xkcd-script font:![Handwriting sample](https://user-images.githubusercontent.com/810663/27119311-4274f65a-50d7-11e7-99ee-f89ac717b989.png)
There were a number of issues along the way:
Known places where the work can be improved:
Proposal: All of the above are known issues, I do not recommend improving the font in this PR, instead I'm keen to lay the foundations (i.e. merge), and iteratively improve (i.e. with small PRs)
Future decisions (I propose we resolve this after this PR):