Skip to content

Commit

Permalink
swap xkcd script for humor sans
Browse files Browse the repository at this point in the history
add xkcd-script font to doc build

Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com>
  • Loading branch information
story645 and oscargus committed Nov 15, 2023
1 parent ea66786 commit 3215acb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ commands:
ffmpeg \
fonts-crosextra-carlito \
fonts-freefont-otf \
fonts-humor-sans \
fonts-noto-cjk \
fonts-wqy-zenhei \
graphviz \
Expand All @@ -67,15 +66,16 @@ commands:
fonts-install:
steps:
- restore_cache:
key: fonts-2
key: fonts-3
- run:
name: Install custom fonts
command: |
mkdir -p ~/.local/share/fonts
wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
wget -nc https://github.com/ipython/xkcd-font/blob/master/xkcd-script/font/xkcd-script.ttf || true
fc-cache -f -v
- save_cache:
key: fonts-2
key: fonts-3
paths:
- ~/.local/share/fonts/

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {},
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "inkscape,ffmpeg,dvipng,lmodern,cm-super,texlive-latex-base,texlive-latex-extra,texlive-fonts-recommended,texlive-latex-recommended,texlive-pictures,texlive-xetex,fonts-wqy-zenhei,graphviz,fonts-crosextra-carlito,fonts-freefont-otf,fonts-humor-sans,fonts-noto-cjk,optipng"
"packages": "inkscape,ffmpeg,dvipng,lmodern,cm-super,texlive-latex-base,texlive-latex-extra,texlive-fonts-recommended,texlive-latex-recommended,texlive-pictures,texlive-xetex,fonts-wqy-zenhei,graphviz,fonts-crosextra-carlito,fonts-freefont-otf,fonts-comic-neue,fonts-noto-cjk,optipng"
}
},
"onCreateCommand": ".devcontainer/setup.sh",
Expand Down
5 changes: 3 additions & 2 deletions doc/devel/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ Optional

* `Inkscape <https://inkscape.org>`_
* `optipng <http://optipng.sourceforge.net>`_
* the font "Humor Sans" (aka the "XKCD" font), or the free alternative
`Comic Neue <http://comicneue.com/>`_
* the font `xkcd script`_ or `Comic Neue <http://comicneue.com/>`_
* the font "Times New Roman"

.. _`xkcd script`: https://github.com/dummy-index/xkcd-font/raw/brushup/xkcd-script/font/xkcd-script.ttf
2 changes: 1 addition & 1 deletion lib/matplotlib/mpl-data/matplotlibrc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
#font.serif: DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
#font.sans-serif: DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
#font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, Comic Neue, Comic Sans MS, cursive
#font.fantasy: Chicago, Charcoal, Impact, Western, Humor Sans, xkcd, fantasy
#font.fantasy: Chicago, Charcoal, Impact, Western, xkcd script, fantasy
#font.monospace: DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace


Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ font.size : 12.0
font.serif : DejaVu Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
font.sans-serif: DejaVu Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
font.fantasy : Comic Sans MS, Chicago, Charcoal, ImpactWestern, Humor Sans, fantasy
font.fantasy : Comic Sans MS, Chicago, Charcoal, ImpactWestern, xkcd script, fantasy
font.monospace : DejaVu Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace

### TEXT
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,12 @@ def xkcd(
scale: float = 1, length: float = 100, randomness: float = 2
) -> ExitStack:
"""
Turn on `xkcd <https://xkcd.com/>`_ sketch-style drawing mode. This will
only have effect on things drawn after this function is called.
Turn on `xkcd <https://xkcd.com/>`_ sketch-style drawing mode.
For best results, the "Humor Sans" font should be installed: it is
not included with Matplotlib.
This will only have an effect on things drawn after this function is called.
For best results, install the `xkcd script <https://github.com/ipython/xkcd-font/>`_
font; xkcd fonts are not packaged with Matplotlib.
Parameters
----------
Expand Down Expand Up @@ -749,8 +750,7 @@ def xkcd(

from matplotlib import patheffects
rcParams.update({
'font.family': ['xkcd', 'xkcd Script', 'Humor Sans', 'Comic Neue',
'Comic Sans MS'],
'font.family': ['xkcd', 'xkcd Script', 'Comic Neue', 'Comic Sans MS'],
'font.size': 14.0,
'path.sketch': (scale, length, randomness),
'path.effects': [
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8848,7 +8848,7 @@ def test_tick_param_labelfont():
fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4], [1, 2, 3, 4])
ax.set_xlabel('X label in Impact font', fontname='Impact')
ax.set_ylabel('Y label in Humor Sans', fontname='Humor Sans')
ax.set_ylabel('Y label in xkcd script', fontname='xkcd script')
ax.tick_params(color='r', labelfontfamily='monospace')
plt.title('Title in sans-serif')
for text in ax.get_xticklabels():
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/textpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_text_path(self, prop, s, ismath=False):
from matplotlib.text import TextToPath
from matplotlib.font_manager import FontProperties
fp = FontProperties(family="Humor Sans", style="italic")
fp = FontProperties(family="Comic Neue", style="italic")
verts, codes = TextToPath().get_text_path(fp, "ABC")
path = Path(verts, codes, closed=False)
Expand Down

0 comments on commit 3215acb

Please sign in to comment.