OSDN Git Service

Doc on Chinese fonts.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Sun, 19 May 2013 16:23:09 +0000 (00:23 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Sun, 19 May 2013 16:23:09 +0000 (00:23 +0800)
doc/luatexja-zhfonts.pdf [new file with mode: 0644]
doc/luatexja-zhfonts.tex [new file with mode: 0644]

diff --git a/doc/luatexja-zhfonts.pdf b/doc/luatexja-zhfonts.pdf
new file mode 100644 (file)
index 0000000..0b211eb
Binary files /dev/null and b/doc/luatexja-zhfonts.pdf differ
diff --git a/doc/luatexja-zhfonts.tex b/doc/luatexja-zhfonts.tex
new file mode 100644 (file)
index 0000000..3e63ee4
--- /dev/null
@@ -0,0 +1,250 @@
+\documentclass[DIV=13]{article}\r
+\usepackage{typearea}\r
+\usepackage{hologo}\r
+\def\pTeX{p\TeX}\r
+\def\LuaTeX{Lua\TeX}\r
+\def\XeTeX{\hologo{XeTeX}}\r
+\usepackage{booktabs}\r
+\usepackage{multicol}\r
+\usepackage{indentfirst}\r
+\usepackage{luatexja-fontspec}\r
+\parindent2\zw\r
+\setmainjfont[BoldFont={FZXiaoBiaoSong-B05}]{FZShuSong-Z01}\r
+\title{\LuaTeX-ja简体中文字体配置}\r
+\author{马起园 苏 杰}\r
+\date{2013年5月}\r
+\begin{document}\r
+\maketitle\r
+\section{\LuaTeX-ja项目简介}\r
+\LuaTeX-ja项目旨在将\pTeX 处理汉字的机制移植到\LuaTeX 下,当前项目的成员\r
+有:北川弘典、前田一貴、八登崇之、黒木裕介 、阿部紀行、山本宗宏、本田知\r
+亮、齋藤修三郎和馬起園。\r
+\r
+\LuaTeX 虽然在编码上支持Unicode,但并不能直接处理汉字断行以及禁则应用,而\r
+在\pTeX 系列中则能够处理断行并应用禁则,但并不支持pdf输出。\LuaTeX 下处理\r
+汉字的断行和应用禁则需要使用其内建的诸多callback来进行。\pTeX 扩展TFM为JFM,\r
+但是JFM抽象程度更高,该文件涉及到的内容是字体的标点压缩,可以用于多个汉字字体。\r
+\r
+当前版本的\LuaTeX-ja 可以应用于\TeX\ Live和W32\TeX,但不能在MikTeX下使用,\r
+因为MikTeX下的\LuaTeX 存在bug。\r
+\section{字体使用}\r
+\subsection{关于Lua\TeX-ja的字体调用}\r
+\XeTeX 在调用字体的时候需要使用freetype和fontconfig库,所以需要更新字体缓\r
+存,但是在\LuaTeX 下就不太一样。\LuaTeX 只需要在初次使用的时候刷新字体数据\r
+库即可(此数据库是一个lua文件)。\LuaTeX 下的字体缓存实际上是将字体的各种\r
+信息导出并保存的文件,在调用一个新字体的时候会生成一个。\LuaTeX 对于字体的\r
+处理并没有使用freetype,而是使用了fontforge,不过可能由于该库的接口有一些\r
+问题,导致部分字体无法在\LuaTeX 下使用。\r
+\r
+在使用\LuaTeX-ja的时候,需要先刷新字体数据库,该命令的使用方法如下:\r
+\begin{verbatim}\r
+Usage: mkluatexfontdb [OPTION]...\r
+    \r
+Rebuild the LuaTeX font database.\r
+\r
+Valid options:\r
+  -f --force                   force re-indexing all fonts\r
+  -q --quiet                   don't output anything\r
+  -v --verbose=LEVEL           be more verbose (print the searched directories)\r
+  -vv                          print the loaded fonts\r
+  -vvv                         print all steps of directory searching\r
+  -V --version                 print version and exit\r
+  -h --help                    print this message\r
+\end{verbatim}\r
+\r
+又是可能遇到通不过的字体,需要将这个字体的绝对路径添加到otfl-blacklist.cnf中,\r
+这个文件的内容如下:\r
+\begin{verbatim}\r
+% Tackes ages to load\r
+LastResort.ttf % a MacOSX font, but also available for free from unicode.org \r
+\r
+% Mac OS X TTC fonts, this list need to be filtered out\r
+/Library/Fonts/AmericanTypewriter.ttc\r
+/Library/Fonts/Baskerville.ttc\r
+/Library/Fonts/Chalkboard.ttc\r
+/Library/Fonts/Cochin.ttc\r
+/Library/Fonts/Copperplate.ttc\r
+/Library/Fonts/Didot.ttc\r
+/Library/Fonts/Futura.ttc\r
+/Library/Fonts/GillSans.ttc\r
+/Library/Fonts/Hoefler Text.ttc\r
+/Library/Fonts/MarkerFelt.ttc\r
+/Library/Fonts/Optima.ttc\r
+/Library/Fonts/Papyrus.ttc\r
+/Library/Fonts/STHeiti Medium.ttc\r
+/System/Library/Fonts/AquaKana.ttc\r
+/System/Library/Fonts/HelveticaNeue.ttc\r
+/System/Library/Fonts/LucidaGrande.ttc\r
+/System/Library/Fonts/Menlo.ttc\r
+/System/Library/Fonts/STHeiti Light.ttc\r
+\end{verbatim}\r
+\r
+Lua\TeX 调用TrueType和OpenType字体并没有固定的方式,\XeTeX 使用了固定的接口,\r
+而Lua\TeX 需要使用luaotfload包来进行字体的调用。这两种字体一般都有高级特性,\r
+在\TeX\ Live或者W32\TeX 中可以使用otfinfo命令来查看相关的信息:\r
+\begin{verbatim}\r
+'Otfinfo' reports information about an OpenType font to standard output.\r
+Options specify what information to print.\r
+\r
+Usage: otfinfo [-sfzpg | OPTIONS] [OTFFILES...]\r
+\r
+Query options:\r
+  -s, --scripts                Report font's supported scripts.\r
+  -f, --features               Report font's GSUB/GPOS features.\r
+  -z, --optical-size           Report font's optical size information.\r
+  -p, --postscript-name        Report font's PostScript name.\r
+  -a, --family                 Report font's family name.\r
+  -v, --font-version           Report font's version information.\r
+  -i, --info                   Report font's names and designer/vendor info.\r
+  -g, --glyphs                 Report font's glyph names.\r
+  -t, --tables                 Report font's OpenType tables.\r
+  -T, --dump-table NAME        Output font's 'NAME' table.\r
+\r
+Other options:\r
+      --script=SCRIPT[.LANG]   Set script used for --features [latn].\r
+  -V, --verbose                Print progress information to standard error.\r
+  -h, --help                   Print this message and exit.\r
+  -q, --quiet                  Do not generate any error messages.\r
+      --version                Print version number and exit.\r
+\r
+Report bugs to <ekohler@gmail.com>.\r
+\end{verbatim}\r
+\subsection{使用字体的方法}\r
+目前\LuaTeX-ja支持在plain \TeX 和\LaTeX 下使用。如果你使用texinfo,那么很\r
+不幸,你不太可能使用\LuaTeX-ja来处理中文,因为texinfo是针对pdf\TeX 设计的,\r
+在\LuaTeX 下使用已经有了一定的不兼容现象,即使完全兼容也需要对texinfo中的\r
+字体配置进行调整,如果你急需使用texinfo来处理中文,请尝试W32\TeX 下的texinfo,\r
+这个发行版中的texinfo已经打了补丁。对于Con\TeX t用户,请使用李延瑞的zhfonts模块\r
+\footnote{见https://github.com/liyanrui/zhfonts}。\r
+\r
+在plain \TeX 中使用Lua\TeX-ja可以在源文件中写入:\r
+\begin{verbatim}\r
+\input luatexja-core.sty\r
+\end{verbatim}\r
+Lua\TeX-ja移植的了\verb!\jfont!命令,在plain \TeX 下需要通过该命令来\r
+控制输出的汉字字体,例如:\r
+\begin{verbatim}\r
+\jfont\song={name:SimSun:jfm=banjiao} at 10pt\r
+\song 我能吞下玻璃而不伤身体。\r
+\end{verbatim}\r
+上文中的\verb!jfm=banjiao!使用来控制标点压缩的,如果此项未设定,则\r
+使用默认的\verb!ujis!压缩模式,对于简体中文来讲,可用的模式有:\r
+\texttt{quanjiao,banjiao,kaiming}。\r
+\r
+而在\LaTeX 下使用则较为简单,使用:\r
+\begin{verbatim}\r
+\usepackage{luatexja-fontspec}\r
+\end{verbatim}\r
+这个包对fontspec包进行了封装,令其能够较为便利地设定汉字字体。\r
+这个包提供的命令如下:\r
+\begin{table}[htbp]\r
+  \centering\r
+    \begin{tabular}{ll}\r
+    \toprule\r
+    \multicolumn{1}{c}{\textbf{命令}} & \multicolumn{1}{c}{\textbf{用途}} \\\r
+    \midrule\r
+    \verb!\jfontspec! & 改变当前汉字字体 \\\r
+    \verb!\setmainjfont! & 设定文档主汉字字体 \\\r
+    \verb!\setsansjfont! & 设定文档的无衬线汉字字体(黑体) \\\r
+    \verb!\newjfontfamily! & 设定新的汉字字体族命令 \\\r
+    \verb!\newjfontface! & 设定新的汉字字体命令 \\\r
+    \verb!\defaultjfontfeatures! & 默认汉字字体的特性 \\\r
+    \verb!\addjfontfeatures! & 设定当前字体的特性 \\\r
+    \bottomrule\r
+    \end{tabular}%\r
+\end{table}%\r
+\r
+\r
+\subsection{不可用字体系列}\r
+中文字体在丰度上与日文字体对比并不占优势,所以中文\TeX 文档在使用使用字体\r
+上没有太大变化。当你想在\LuaTeX-ja下是有部分特色字体的时候,请做好此种字体\r
+可能无法使用的准备。目前报错明显的字体有数个:\r
+\begin{itemize}\r
+\item 灵格斯词典附带的音标字体,这些字体会安装到系统字体文件夹下,在更新\r
+   字体数据库的时候会出现程序崩溃的情况,这是字体本身的原因,需要添加到黑名单中\r
+\item 康熙字典体,这是中国大陆一位业余字体设计者所设计的字体,由于该作者\r
+   缺乏相关技术知识,导致此字体的CMap出错,无论是完全版还是试用版都会出现\r
+   问题,此外该字体的boundingbox也是错误的,在嵌入pdf文档中十分影响阅读\r
+\item 信黑体,这个字体也是CMap的问题,无法使用\r
+\end{itemize}\r
+\subsection{华文字体系列}\r
+在微软提供的Office套装中附带了一定数量的中文字体,\r
+这些字体是常州华文印刷新技术有限公司制造的。\r
+这些字体安装在系统字体文件夹下,在使用\LuaTeX-ja 的时候\r
+可以酌情使用。在本文档中,我们推荐简体中文用户使用\r
+此套字体,从使用率上看,各大学都会装有微软的操作系统\r
+和微软的Office,可以说已经相当普及,故做推荐。\r
+\r
+\begin{table}[htbp]\r
+  \centering\r
+    \begin{tabular}{llll}\r
+    \toprule\r
+    \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{PostScript名}} & \multicolumn{1}{c}{\textbf{样例}} \\\r
+    \midrule\r
+    华文宋体  & \texttt{STSONG.TTF} & STSong & {\jfontspec{STSong}我能吞下玻璃而不伤身体} \\\r
+    华文中宋  & \texttt{STZHONGS.TTF} & STZhongsong & {\jfontspec{STZhongsong}我能吞下玻璃而不伤身体} \\\r
+    华文细黑  & \texttt{STXIHEI.TTF} & STXihei & {\jfontspec{STXihei}我能吞下玻璃而不伤身体} \\\r
+    华文楷体  & \texttt{STKAITI.TTF} & STKaiti & {\jfontspec{STKaiti}我能吞下玻璃而不伤身体} \\\r
+    华文仿宋  & \texttt{STFANGSO.TTF} & STFangsong & {\jfontspec{STFangsong}我能吞下玻璃而不伤身体} \\\r
+    \bottomrule\r
+    \end{tabular}%\r
+\end{table}%\r
+\subsection{中易字体系列}\r
+在Windows系统简体中文版中,附带了数种中文字体。\r
+这些字体为中易中标电子信息技术有限公司制造的。\r
+同我们强烈推荐的第一种方案比较,没有中宋。\r
+如果按照CCT的传统,一般使用黑体替换。\r
+\r
+\begin{table}[htbp]\r
+  \centering\r
+    \begin{tabular}{llll}\r
+    \toprule\r
+    \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{PostScript名}} & \multicolumn{1}{c}{\textbf{样例}} \\\r
+    \midrule\r
+    宋体    & \texttt{simsun.ttc} & SimSun & {\jfontspec{SimSun}我能吞下玻璃而不伤身体} \\\r
+    黑体    & \texttt{simhei.ttf} & SimHei & {\jfontspec{SimHei}我能吞下玻璃而不伤身体} \\\r
+    楷体    & \texttt{simkai.ttf} & KaiTi & {\jfontspec{KaiTi}我能吞下玻璃而不伤身体} \\\r
+    仿宋    & \texttt{simkai.ttf} & FangSong & {\jfontspec{FangSong}我能吞下玻璃而不伤身体} \\\r
+    \bottomrule\r
+    \end{tabular}%\r
+\end{table}%\r
+\subsection{Adobe字体系列}\r
+在Adobe Reader简体中文版中,附带了宋体和黑体两种字体。\r
+这两种字体实际上是华文字体,但是和华文字体不能混用,\r
+因为Adobe Reader中的中文字体的基线都进行了调整,\r
+不能互相匹配。在Adobe InDesign中还附带了楷体和仿宋体。\r
+Adobe的中文字体的Postscript名即为文件名去掉后缀名。\r
+\r
+\begin{table}[htbp]\r
+  \centering\r
+    \begin{tabular}{lll}\r
+    \toprule\r
+    \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{样例}} \\\r
+    \midrule\r
+    Adobe 宋体 Std & \texttt{AdobeSongStd-Light.otf} & {\jfontspec{AdobeSongStd-Light}我能吞下玻璃而不伤身体} \\\r
+    Adobe 黑体 Std & \texttt{AdobeHeitiStd-Regular.otf} & {\jfontspec{AdobeHeitiStd-Regular}我能吞下玻璃而不伤身体} \\\r
+    Adobe 楷体 Std & \texttt{AdobeKaitiStd-Regular.otf} & {\jfontspec{AdobeKaitiStd-Regular}我能吞下玻璃而不伤身体} \\\r
+    Adobe 仿宋 Std & \texttt{AdobeFangsongStd-Regular.otf} & {\jfontspec{AdobeFangsongStd-Regular}我能吞下玻璃而不伤身体} \\\r
+    \bottomrule\r
+    \end{tabular}%\r
+\end{table}%\r
+\subsection{方正字体系列}\r
+方正字体的来源有两种,第一种是使用方正的排版系统的时候会\r
+安装到Windows系统的字体文件夹下,第二种是针对Linux系统\r
+来说的,WPS for Linux附带了部分方正字体。\r
+\r
+\begin{table}[htbp]\r
+  \centering\r
+    \begin{tabular}{llll}\r
+    \toprule\r
+    \multicolumn{1}{c}{\textbf{字体名}} & \multicolumn{1}{c}{\textbf{文件名}} & \multicolumn{1}{c}{\textbf{全名}} & \multicolumn{1}{c}{\textbf{样例}} \\\r
+    \midrule\r
+    方正书宋\_GBK & \texttt{FZSSK.TTF} & FZShuSong-Z01 & {\jfontspec{FZShuSong-Z01}我能吞下玻璃而不伤身体} \\\r
+    方正小标宋\_GBK & \texttt{FZXBSK.TTF} & FZXiaoBiaoSong-B05 & {\jfontspec{FZXiaoBiaoSong-B05}我能吞下玻璃而不伤身体} \\\r
+    方正黑体\_GBK & \texttt{FZHTK.TTF} & FZHei-B01 & {\jfontspec{FZHei-B01}我能吞下玻璃而不伤身体} \\\r
+    方正楷体\_GBK & \texttt{FZKTK.TTF} & FZKai-Z03 & {\jfontspec{FZKai-Z03}我能吞下玻璃而不伤身体} \\\r
+    方正仿宋\_GBK & \texttt{FZFSK.TTF} & FZFangSong-Z02 & {\jfontspec{FZFangSong-Z02}我能吞下玻璃而不伤身体} \\\r
+    \bottomrule\r
+    \end{tabular}%\r
+\end{table}%\r
+\end{document}\r