From da15a9773aaae31e74f7e0f2c5a49709c9f21765 Mon Sep 17 00:00:00 2001 From: Tong Hui Date: Mon, 10 Oct 2016 02:56:10 +0800 Subject: [PATCH] add FandolSong as default font --- .travis.yml | 3 +-- install.fandolsong.sh | 5 +++++ pdf/template.tex | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 install.fandolsong.sh diff --git a/.travis.yml b/.travis.yml index f1429bd..3ba8fbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,8 @@ before_script: - lsb_release -a - sudo apt-get update - "./install.latex.ubuntu.sh" + - "./install.fandolsong.sh" - wget https://github.com/jgm/pandoc/releases/download/1.17.2/pandoc-1.17.2-1-amd64.deb - - wget -c http://mirrors.ctan.org/fonts/fandol/FandolSong-Bold.otf http://mirrors.ctan.org/fonts/fandol/FandolKai-Regular.otf http://mirrors.ctan.org/fonts/fandol/FandolSong-Regular.otf - - mv *.ttf /usr/share/fonts/ - sudo dpkg -i *.deb script: diff --git a/install.fandolsong.sh b/install.fandolsong.sh new file mode 100755 index 0000000..b1dbc5b --- /dev/null +++ b/install.fandolsong.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +wget -c http://mirrors.ctan.org/fonts/fandol/FandolSong-Bold.otf http://mirrors.ctan.org/fonts/fandol/FandolKai-Regular.otf http://mirrors.ctan.org/fonts/fandol/FandolSong-Regular.otf +mv *.otf /usr/share/fonts/opentype/ +sudo fc-cache diff --git a/pdf/template.tex b/pdf/template.tex index cd77fa2..f119676 100644 --- a/pdf/template.tex +++ b/pdf/template.tex @@ -71,7 +71,7 @@ \definecolor{shadecolor}{gray}{0.90} -% 修改字体,粗体为文泉驿微米黑,普通文字为方正宋体(非开源,包含在WPS包内) +% 修改字体,粗体为 Noto Sans CJK,普通文字 FandolSong 宋体(GPLv3) % 字体选择: AR PL UMing 文鼎PL细上海宋 - 会出现问号在中间的错误 % AR PL SungtiL GB 文鼎PL简报宋 - 英文字体不好看 % Adobe Song Std L Adobe宋体 - item的·号无法显示 @@ -92,7 +92,6 @@ BoldItalicFont = *-Italic, ] {Liberation Serif} -% {Bitstream Charter} % uncomment for release build % 设置中文字体 \setCJKmainfont @@ -104,9 +103,10 @@ ] %{AR PL SungtiL GB} {FandolSong} + \setCJKsansfont{Noto Sans CJK SC} %\setCJKsansfont{WenQuanYi Micro Hei} -\setCJKmonofont{WenQuanYi Micro Hei} +\setCJKmonofont{WenQuanYi Micro Hei Mono} %\setCJKmonofont{Noto Sans Mono CJK SC} % uncomment for release build %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -149,7 +149,7 @@ \author{\textbf{[美] Richard M. Stallman 著}\\ \textbf{北京 GNU/Linux 用户组 译}\thanks{本书基于 GNU 自由文档协议 1.3 版 (GNU Free Documentation License 1.3) 授权发布,可自由复制和分发,和/或基于 GNU 自由文档协议 1.3 版或自由软件基金会发布的更高版本,做出修改。本书使用 Markdown 书写,源码地址:\url{https://github.com/beijinglug/fsfs-zh/}。}} -\def\w3cdtfymd{\the\year-\ifnum\month<10 0\fi\the\month} +\def\w3cdtfymd{\the\year 年 \ifnum\month<10 0\fi\the\month 月} \date{\w3cdtfymd} \newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp} @@ -218,7 +218,7 @@ \newcommand{\prechap}{第} \newcommand{\postchap}{部分} \newcommand{\presect}{} -\newcommand{\postsect}{节} +\newcommand{\postsect}{} \renewcommand{\chaptermark}[1]{\markboth{\textbf{\prechap \thechapter \postchap}\hspace*{1ex}#1}{}} \renewcommand{\sectionmark}[1]{\markright{\textbf{\presect \thesection \postsect}\hspace*{1ex}#1}} \newcommand{\chap}[1]{\newpage\thispagestyle{empty}\chapter{#1}\label{chap:\thechapter}}