Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144817430
D36623.1776586326.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36623.1776586326.diff
View Options
diff --git a/documentation/tools/asciidoctor.sh b/documentation/tools/asciidoctor.sh
--- a/documentation/tools/asciidoctor.sh
+++ b/documentation/tools/asciidoctor.sh
@@ -49,6 +49,8 @@
local cur_dir_source="content/$doc_lang/$doc_type/$doc_name/"
local cur_dir_output="public/$doc_lang/$doc_type/$doc_name/"
+ local theme_font=""
+
if [ ! -d "$cur_dir_output" ]; then
mkdir -p "$cur_dir_output"
fi
@@ -68,6 +70,27 @@
local asciidoctor_file_name="_index.adoc"
fi
+ # Check non default fonts
+ case "$doc_lang" in
+ zh-cn)
+ if [ ! -f "$LOCALBASE/share/docproj-fonts-cjk/NotoSansSC-Medium.otf" ]; then
+ echo " font not found, skipping pdf build"
+ return
+ fi
+ theme_font="-a scripts=cjk -a pdf-theme=./shared/zh-cn/zh-cn-theme.yml -a pdf-fontsdir=$LOCALBASE/share/docproj-fonts-cjk"
+ ;;
+ zh-tw)
+ if [ ! -f "$LOCALBASE/share/docproj-fonts-cjk/NotoSansTC-Medium.otf" ]; then
+ echo " font not found, skipping pdf build"
+ return
+ fi
+ theme_font="-a pdf-theme=./shared/zh-tw/zh-tw-theme.yml -a pdf-fontsdir=$LOCALBASE/share/docproj-fonts-cjk/"
+ ;;
+ *)
+ theme_font="-a pdf-theme=default-with-fallback-font"
+ ;;
+ esac
+
$ASCIIDOCTORPDF_CMD \
-r ./shared/lib/man-macro.rb \
-r ./shared/lib/git-macro.rb \
@@ -80,7 +103,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-cn/zh-cn-theme.yml b/shared/zh-cn/zh-cn-theme.yml
new file mode 100644
--- /dev/null
+++ b/shared/zh-cn/zh-cn-theme.yml
@@ -0,0 +1,16 @@
+extends: default
+font:
+ catalog:
+ merge: true
+ Noto Sans SC: NotoSansSC-Medium.otf
+ fallbacks:
+ - Noto Serif
+base:
+ text-align: left
+ font-family: Noto Sans SC
+codespan:
+ font-family: Noto Sans SC
+kbd:
+ font-family: $codespan-font-family
+code:
+ font-family: $codespan-font-family
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,16 @@
+extends: default
+font:
+ catalog:
+ merge: true
+ Noto Sans TC: NotoSansTC-Medium.otf
+ fallbacks:
+ - Noto Serif
+base:
+ text-align: left
+ font-family: Noto Sans TC
+codespan:
+ font-family: Noto Sans TC
+kbd:
+ font-family: $codespan-font-family
+code:
+ font-family: $codespan-font-family
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 8:12 AM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28382096
Default Alt Text
D36623.1776586326.diff (2 KB)
Attached To
Mode
D36623: Fix freebsd-doc zh-tw pdf font(has tofu) problem
Attached
Detach File
Event Timeline
Log In to Comment