diff --git a/documentation/tools/asciidoctor.sh b/documentation/tools/asciidoctor.sh --- a/documentation/tools/asciidoctor.sh +++ b/documentation/tools/asciidoctor.sh @@ -68,6 +68,14 @@ local asciidoctor_file_name="_index.adoc" fi + local theme_font="" + + if [ "$doc_lang" = "zh-tw" ]; then + theme_font="-a pdf-theme=./shared/zh-tw/zh-tw-theme.yml -a pdf-fontsdir=/usr/local/share/fonts/noto/" + else + theme_font="-a pdf-theme=default-with-fallback-font" + fi + $ASCIIDOCTORPDF_CMD \ -r ./shared/lib/man-macro.rb \ -r ./shared/lib/git-macro.rb \ @@ -80,7 +88,7 @@ -a lang="$doc_lang" \ -a isonline=1 \ -a env-beastie=1 \ - -a pdf-theme=default-with-fallback-font \ + ${theme_font} \ -o "${cur_dir_output}${doc_name}_${doc_lang}.pdf" \ "${cur_dir_source}${asciidoctor_file_name}" } diff --git a/shared/zh-tw/zh-tw-theme.yml b/shared/zh-tw/zh-tw-theme.yml new file mode 100644 --- /dev/null +++ b/shared/zh-tw/zh-tw-theme.yml @@ -0,0 +1,17 @@ +extends: default +font: + catalog: + merge: true + Noto Sans TC: NotoSansCJKtc-Regular.otf + Noto Sans Mono TC: NotoSansMonoCJKtc-Regular.otf + fallbacks: + - Noto Serif +base: + text-align: left + font-family: Noto Sans TC +codespan: + font-family: Noto Sans Mono TC +kbd: + font-family: $codespan-font-family +code: + font-family: $codespan-font-family