Skip to content

Commit 86f80a3

Browse files
committed
Disable Justfont and replace it with additional Google web fonts
1 parent b41859f commit 86f80a3

3 files changed

Lines changed: 41 additions & 30 deletions

File tree

decorate.bash

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
#### 4. Insert Language menu in the left navigation bar, under the search box (matched with ^<\/form>). (for displaying and switching language options)
77
#### 5. Replace the title of the book with different language, and replace `zzz_replace_token` (just a placeholder) with correct language name.
88
#### by Whyjay Zheng
9-
#### created on 2016/1/12, last updated on 2022/07/26
9+
#### created on 2016/1/12, last updated on 2022/07/28
10+
#### - Temporarily disabled Justfont settings; use Google Font (Noto Sans) instead
1011

1112
html_files=$(ls docs/_build/html/*.html docs/_build/html/main/*.html docs/_build/html/en/*.html docs/_build/html/en/main/*.html)
1213

1314
google_fonts=$(cat docs/_addons/google_fonts.txt)
14-
jf_string=$(cat docs/_addons/jf_code.txt)
15+
# jf_string=$(cat docs/_addons/jf_code.txt)
1516
disqus_string=$(cat docs/_addons/disqus_code.txt)
1617
localemenu=$(cat docs/_addons/localemenu.txt)
1718

@@ -27,15 +28,15 @@ google_fonts=${google_fonts//\^/\\\^} # changes all "^" to "\^"
2728
google_fonts=${google_fonts//\//\\\/} # changes all "/" to "\/"
2829
google_fonts=${google_fonts//\"/\\\"} # changes all '"' to '\"'
2930

30-
jf_string=${jf_string//\\/\\\\} # changes all "\" to "\\"
31-
jf_string=${jf_string//\[/\\\[} # changes all "[" to "\["
32-
jf_string=${jf_string//\]/\\\]} # changes all "]" to "\]"
33-
jf_string=${jf_string//\$/\\\$} # changes all "$" to "\$"
34-
jf_string=${jf_string//\./\\\.} # changes all "." to "\."
35-
jf_string=${jf_string//\*/\\\*} # changes all "*" to "\*"
36-
jf_string=${jf_string//\^/\\\^} # changes all "^" to "\^"
37-
jf_string=${jf_string//\//\\\/} # changes all "/" to "\/"
38-
jf_string=${jf_string//\"/\\\"} # changes all '"' to '\"'
31+
# jf_string=${jf_string//\\/\\\\} # changes all "\" to "\\"
32+
# jf_string=${jf_string//\[/\\\[} # changes all "[" to "\["
33+
# jf_string=${jf_string//\]/\\\]} # changes all "]" to "\]"
34+
# jf_string=${jf_string//\$/\\\$} # changes all "$" to "\$"
35+
# jf_string=${jf_string//\./\\\.} # changes all "." to "\."
36+
# jf_string=${jf_string//\*/\\\*} # changes all "*" to "\*"
37+
# jf_string=${jf_string//\^/\\\^} # changes all "^" to "\^"
38+
# jf_string=${jf_string//\//\\\/} # changes all "/" to "\/"
39+
# jf_string=${jf_string//\"/\\\"} # changes all '"' to '\"'
3940

4041
disqus_string=${disqus_string//\\/\\\\} # changes all "\" to "\\"
4142
disqus_string=${disqus_string//\[/\\\[} # changes all "[" to "\["
@@ -70,14 +71,14 @@ do
7071
# insert a new line before the pygments.css line
7172
sed -i "/pygments.css/i\ $google_fonts" $html_f
7273
fi
73-
# ==== Attaching jf code ====
74-
if grep -q 'jf.push' $html_f; then
75-
echo skip ${html_f##*/} - already attached the jf code
76-
else
77-
echo ----- Attaching jf code to ${html_f##*/} ...
78-
# insert a new line after </head> tag
79-
sed -i "/<\/head>/a\ $jf_string" $html_f
80-
fi
74+
# # ==== Attaching jf code ====
75+
# if grep -q 'jf.push' $html_f; then
76+
# echo skip ${html_f##*/} - already attached the jf code
77+
# else
78+
# echo ----- Attaching jf code to ${html_f##*/} ...
79+
# # insert a new line after </head> tag
80+
# sed -i "/<\/head>/a\ $jf_string" $html_f
81+
# fi
8182
# ==== Attaching disqus code ====
8283
if grep -q 'disqus_thread' $html_f; then
8384
echo skip ${html_f##*/} - already attached the disqus code

docs/_addons/google_fonts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<link href='https://fonts.googleapis.com/css?family=Varela Round' rel='stylesheet'>
1+
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Sans+TC:wght@300;400;500;700&family=Quicksand:wght@300;400;500;600;700&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Varela+Round&display=swap" rel="stylesheet">

docs/_static/style.css

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
/*========================================================*/
22
/* Justfont settings (webfont for Chinese characters) */
3+
/* Temporarily disabled. */
34
/*========================================================*/
4-
.jf-loading body { /*載入中不顯示*/
5+
/*載入中不顯示*/
6+
/* .jf-loading body {
57
opacity: 0;
68
visibility: hidden;
7-
}
8-
.jf-active body { /*如果處理成功,直接顯示*/
9+
} */
10+
11+
/*如果處理成功,直接顯示*/
12+
/* .jf-active body {
913
opacity: 1;
1014
visibility: visible;
11-
}
12-
.jf-inactive body {/*如果處理失敗,直接顯示*/
15+
} */
16+
17+
/*如果處理失敗,直接顯示*/
18+
/* .jf-inactive body {
1319
opacity: 1;
1420
visibility: visible;
15-
}
16-
17-
21+
} */
1822

1923
/*========================================================*/
2024
/* Disable right sidebar (TOC) -- for now, let's keet ip */
@@ -32,11 +36,17 @@
3236
/* sidebar 字體的百分比由 --sbt-font-size-small-1 和 --sbt-font-size-small-1 定義 */
3337
--pst-sidebar-font-size: 1em; /* 左側章節字體大小 1 * 87.5 = 0.875 em (14px) */
3438
--pst-sidebar-caption-font-size: 1.143em; /* 左側章節群組標題字體大小 1.143 * 87.5% = 1 em (16px) */
35-
/* 加入 Varela Round (from Google Fonts) */
36-
--pst-font-family-base-system: Varela Round, -apple-system, Segoe UI, "Helvetica Neue", Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
39+
/* 加入 Quicksand & Noto Sans TC (from Google Fonts); skip Varela Round for now */
40+
--pst-font-family-base-system: Quicksand, "Noto Sans TC", -apple-system, Segoe UI, "Helvetica Neue", Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
41+
/* 加入 Ubuntu Mono & Noto Sans TC (from Google Fonts); skip Anonymous Pro for now */
42+
--pst-font-family-monospace-system: Ubuntu Mono, "SFMono-Regular", Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace, "Noto Sans TC";
3743
--sbt-prevnext-font-size: var(--sbt-font-size-regular); /* make prevnext font bigger (14px) */
3844
}
3945

46+
/* Set up generic font weight */
47+
body {
48+
font-weight: 300
49+
}
4050

4151
/*========================================================*/
4252
/* Left navigation bar settings */

0 commit comments

Comments
 (0)