From 4a3bb35a95ab5e9f2f7f7b4f911fd6a1417ea6a1 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 20 Jul 2021 00:45:54 +0200 Subject: [PATCH] sfx: option to remove scp.woff2 --- copyparty/web/md.js | 2 +- scripts/make-sfx.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/copyparty/web/md.js b/copyparty/web/md.js index 20b0bd3a..e03af1e8 100644 --- a/copyparty/web/md.js +++ b/copyparty/web/md.js @@ -176,7 +176,7 @@ function md_plug_err(ex, js) { var lns = js.split('\n'); if (ln < lns.length) { o = mknod('span'); - o.style.cssText = 'color:#ac2;font-size:.9em;font-family:scp;display:block'; + o.style.cssText = "color:#ac2;font-size:.9em;font-family:'scp',monospace,monospace;display:block"; o.textContent = lns[ln - 1]; } } diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index fab6928c..a7b0b910 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -20,6 +20,9 @@ echo # # `no-cm` saves ~90k by removing easymde/codemirror # (the fancy markdown editor) +# +# `no-fnt` saves ~9k by removing the source-code-pro font +# (mainly used my the markdown viewer/editor) # port install gnutar findutils gsed coreutils @@ -61,6 +64,7 @@ while [ ! -z "$1" ]; do [ "$1" = re ] && repack=1 && shift && continue [ "$1" = gz ] && use_gz=1 && shift && continue [ "$1" = no-ogv ] && no_ogv=1 && shift && continue + [ "$1" = no-fnt ] && no_fnt=1 && shift && continue [ "$1" = no-cm ] && no_cm=1 && shift && continue [ "$1" = no-sh ] && do_sh= && shift && continue [ "$1" = no-py ] && do_py= && shift && continue @@ -190,6 +194,12 @@ done sed -r '/edit2">edit \(fancy/d' <$f >t && tmv "$f" } +[ $no_fnt ] && { + rm -f copyparty/web/deps/scp.woff2 + f=copyparty/web/md.css + sed -r '/scp\.woff2/d' <$f >t && tmv "$f" +} + [ $repack ] || find | grep -E '\.py$' | grep -vE '__version__' |