Browse Source

Prefer xkcd-script font

https://github.com/ipython/xkcd-font/blob/master/xkcd-script/font/xkcd-script.ttf
Also require an exact font name match
master
Ben Lucht 5 years ago
parent
commit
0ea50238b9
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      xkcdify.m

+ 6
- 2
xkcdify.m View File

@@ -91,8 +91,12 @@ function renderNewAxesLine(ax)
cartoonifyAxesEdge(axLine(i), newAxes);
end

if any(contains(listfonts,'Humor Sans'))
% requires Humor Sans font
if any(strcmp(listfonts,'xkcd Script'))
% prefer 'xkcd Script'
% https://github.com/ipython/xkcd-font/blob/master/xkcd-script/font/xkcd-script.ttf
set(ax, 'FontName', 'xkcd Script', 'FontSize', 14);
elseif any(strcmp(listfonts,'Humor Sans'))
% fall back on Humor Sans font
% https://github.com/shreyankg/xkcd-desktop/blob/master/Humor-Sans.ttf
set(ax, 'FontName', 'Humor Sans', 'FontSize', 14);
else


Loading…
Cancel
Save