ipython / xkcd-font

The xkcd font
https://cdn.rawgit.com/ipython/xkcd-font/master/preview.html
Other
1.06k stars 48 forks source link

Auto generated font from Randall's handwriting #17

Closed pelson closed 7 years ago

pelson commented 7 years ago

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

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):

pelson commented 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: mpl

Note: Matplotlib cannot currently do ligatures, as can be seen in the word "BETTER".

pelson commented 7 years ago

Things I'd like to do next, preferably in another PR 😉 :

rgbkrk commented 7 years ago

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.

takluyver commented 7 years ago

:+1: for merging and doing further improvements in another PR.

pelson commented 7 years ago

🎉 - thanks for moving it forwards guys.