From 16f02bbc1863609a1fa114bc9272d6a2a6f2e047 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 12 Feb 2016 00:19:25 +0000 Subject: zhspacing (11feb16) git-svn-id: svn://tug.org/texlive/trunk@39670 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/xetex/zhspacing/README | 2 +- .../texmf-dist/doc/xetex/zhspacing/t-zhspacing.tex | 117 +++++++++++++++++++++ .../zhspacing/test/zhspacing-context-test.tex | 45 -------- Master/texmf-dist/doc/xetex/zhspacing/zhs-man.pdf | Bin 151236 -> 167095 bytes Master/texmf-dist/doc/xetex/zhspacing/zhs-man.tex | 37 ++++--- .../doc/xetex/zhspacing/zhspacing-context-test.tex | 45 ++++++++ 6 files changed, 185 insertions(+), 61 deletions(-) create mode 100644 Master/texmf-dist/doc/xetex/zhspacing/t-zhspacing.tex delete mode 100644 Master/texmf-dist/doc/xetex/zhspacing/test/zhspacing-context-test.tex create mode 100644 Master/texmf-dist/doc/xetex/zhspacing/zhspacing-context-test.tex (limited to 'Master/texmf-dist/doc/xetex') diff --git a/Master/texmf-dist/doc/xetex/zhspacing/README b/Master/texmf-dist/doc/xetex/zhspacing/README index be0359202ab..b5b4223d953 100644 --- a/Master/texmf-dist/doc/xetex/zhspacing/README +++ b/Master/texmf-dist/doc/xetex/zhspacing/README @@ -6,6 +6,6 @@ This package is licensed in LPPL. If you are interested in the process of development you may observe - http://code.google.com/p/ctex-kit/updates/list + https://github.com/CTeX-org/ctex-kit/ - Yin Dian (yindian@gmail.com) diff --git a/Master/texmf-dist/doc/xetex/zhspacing/t-zhspacing.tex b/Master/texmf-dist/doc/xetex/zhspacing/t-zhspacing.tex new file mode 100644 index 00000000000..ce91f7ab9af --- /dev/null +++ b/Master/texmf-dist/doc/xetex/zhspacing/t-zhspacing.tex @@ -0,0 +1,117 @@ +%D \module +%D [ file=t-zhspacing, +%D version=2009.05.11, +%D title=\CONTEXT\ User Module, +%D subtitle=Zh-Spacing, +%D author=Yue Wang, +%D date=\currentdate, +%D copyright=Yue Wang +%D email=yuleopen@gmail.com, +%D license=BSD] + +\writestatus{loading}{Context User Module / Zh-Spacing} +\unprotect + +%D Macro package \type{zhspacing} was written by Yin Dian in order to +%D typeset Simplified Chinese in \XeTeX. The macro package uses \XeTeX's +%D inter-char token mechanism in order to support the basic Chinese +%D typesetting rules. This macro aims to port \type{zhspacing} to Hans +%D Hagen's \ConTeXt\ format. + +%D \ConTeXt\ MKII does not load unicode-letters.tex automatically +%D when the format is dumped. What's worse, standard \ConTeXt\ +%D distribution does not have unicode-letters.tex included. +%D So in order to define all the default \XeTeX\ character classes +%D as in plain \TeX\ and \LaTeX, we striped the related macros +%D from unicode-letters.tex to \type{zhspacing-unicode}. + + +\def\ID #1 #2 {\set{#1}{#2}{\global\XeTeXcharclass\n=1 \global\catcode\n=11 }} +\countdef\n=255 +\def\set#1#2#3{\n="#1 \loop #3 \ifnum\n<"#2 \advance\n by 1 \repeat} +\def\loop#1\repeat{\def\body{#1}\iterate} +\def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next} +\let\repeat=\fi \ID 3400 4DB5 \ID 4E00 9FC3 \ID 20000 2A6D6 + +%D \ConTeXt\ does not have the right catcode for zhspacing.sty defined. +%D So we should define the catcode correctly in order to load it. + +\catcode`\!=12 +\catcode`\@=11 +\catcode`\?=12 + + +%D zhspacing uses \TeX\ commands \type{\lq} and \type{\rq} in plain TeX. +%D However, these are not defined in \ConTeXt. So we define the two macros. + +\def\lq{`} \def\rq{'} + +%D And now we can load \type{zhspacing.sty} safely. + +\input zhspacing.sty + + +%D Last thing: we define the typescript for Adobe Chinese fonts. + +\starttypescript [serif] [myzhfont] + \definefontsynonym [Serif] [ZhSerif] + \definefontsynonym [SerifBold] [ZhSerifBold] + \definefontsynonym [SerifItalic] [ZhSerifItalic] + \definefontsynonym [SerifBoldItalic] [ZhSerifBoldItalic] +\stoptypescript + +\starttypescript [serif] [myzhfont] + \definefontsynonym [ZhSerif] [name:AdobeSongStd-Light] + \definefontsynonym [ZhSerifBold] [name:AdobeHeitiStd-Regular] + \definefontsynonym [ZhSerifItalic] [name:AdobeKaitiStd-Regular] + \definefontsynonym [ZhSerifBoldItalic] [name:AdobeHeitiStd-Regular] +\stoptypescript + +\starttypescript [sans] [myzhfont] + \definefontsynonym [Sans] [ZhSans] + \definefontsynonym [SansBold] [ZhSansBold] + \definefontsynonym [SansItalic] [ZhSansItalic] + \definefontsynonym [SansBoldItalic] [ZhSansBoldItalic] +\stoptypescript + +\starttypescript [sans] [myzhfont] + \definefontsynonym [ZhSans] [name:AdobeKaitiStd-Regular] + \definefontsynonym [ZhSansBold] [name:AdobeHeitiStd-Regular] + \definefontsynonym [ZhSansItalic] [name:AdobeKaitiStd-Regular] + \definefontsynonym [ZhSansBoldItalic] [name:AdobeHeitiStd-Regular] +\stoptypescript + +\starttypescript [mono] [myzhfont] + \definefontsynonym [Mono] [ZhMono] + \definefontsynonym [MonoBold] [ZhMonoBold] + \definefontsynonym [MonoItalic] [ZhMonoItalic] + \definefontsynonym [MonoBoldItalic] [ZhMonoBoldItalic] +\stoptypescript + +\starttypescript [mono] [myzhfont] + \definefontsynonym [ZhMono] [name:AdobeFangsongStd-Regular] + \definefontsynonym [ZhMonoBold] [name:AdobeHeitiStd-Regular] + \definefontsynonym [ZhMonoItalic] [name:AdobeFangsongStd-Regular] + \definefontsynonym [ZhMonoBoldItalic] [name:AdobeHeitiStd-Regular] +\stoptypescript + + +\starttypescript[myzhfont] + \definetypeface [myzhfont] [rm] [serif] [myzhfont] [default] + \definetypeface [myzhfont] [ss] [sans] [myzhfont] [default] + \definetypeface [myzhfont] [tt] [mono] [myzhfont] [default] +\stoptypescript + +\usetypescript[myzhfont] + +%D We set all the \type{zhxxxfont} used in \type{zhspacing.sty}. + +\zhspacing +\def\zhongwen{\pushcurrentfont\myzhfont\popcurrentfont} +\def\zhfont{\zhongwen} +\def\zhpunctfont{\zhongwen} +\def\zhcjkextafont{\zhongwen} +\def\zhcjkextbfont{\zhongwen} + + +\protect \ No newline at end of file diff --git a/Master/texmf-dist/doc/xetex/zhspacing/test/zhspacing-context-test.tex b/Master/texmf-dist/doc/xetex/zhspacing/test/zhspacing-context-test.tex deleted file mode 100644 index 1f6c528d25c..00000000000 --- a/Master/texmf-dist/doc/xetex/zhspacing/test/zhspacing-context-test.tex +++ /dev/null @@ -1,45 +0,0 @@ -\usemodule[zhspacing] - - -这是中文测试。中文和English的混排。中 -文和$E=mc^2$的混排。 - -九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 -太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 -“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 -帝、六丁六甲之力锻造而成,有诗为证: - -九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 -太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 -“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 -帝、六丁六甲之力锻造而成,有诗为证: - -\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps - -\ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps - -\tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps - -\blank - -\rm\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\rm\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\rm\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\rm\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par - -\blank - -\ss\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\ss\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\ss\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\ss\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par - -\blank - -\tt\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\tt\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\tt\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par -\tt\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par - - -\bye \ No newline at end of file diff --git a/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.pdf b/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.pdf index 30a336d2ddc..e2539e11888 100644 Binary files a/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.pdf and b/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.pdf differ diff --git a/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.tex b/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.tex index 6959a38d641..e4d16a710e6 100644 --- a/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.tex +++ b/Master/texmf-dist/doc/xetex/zhspacing/zhs-man.tex @@ -4,7 +4,10 @@ %\usepackage[margin=1.5in]{geometry} \usepackage{fontspec} \defaultfontfeatures{Mapping=tex-text} -\usepackage[no-sscript]{xltxtra} +\usepackage{hologo} +\def\eTeX{\hologo{eTeX}} +\def\XeTeX{\hologo{XeTeX}} +\def\XeLaTeX{\hologo{XeLaTeX}} \usepackage{zhspacing} \usepackage[fakebold]{zhfont} \usepackage[noactive]{zhmath} @@ -29,7 +32,7 @@ manual\thanks{Revision: \zhspacingrevision.}} \author{\textsc{Yin} Dian\footnote{Lab.\ of Network Comm. System \& Control, Univ.\ of Sci.\ \& Tech.\ of China.}} -\date{2012/03/14} +\date{2016/02/10} \maketitle \tableofcontents \newpage @@ -56,7 +59,7 @@ using \XeTeX, the package |zhspacing| is coded, utilizing the new primitive of \section{Getting Started} |zhspacing| can be used in both plain \XeTeX\ or \XeLaTeX. The usage is quite -straightforward. For instance, in plain \XeTeX, +straightforward. For instance, in plain \XeTeX, {\emptyskipscheme \begin{verbatim} \input zhspacing.sty @@ -90,11 +93,11 @@ well as math formulas. In fact, all of the following inputs can produce mixed langauge output with skip automatically inserted between Chinese and English characters, \begin{center} -\emptyskipscheme |中Eng文|,\quad |中 Eng文|,\quad |中Eng 文|\quad and\quad |中 Eng 文|. +\emptyskipscheme |中Eng文|,\quad |中 Eng文|,\quad |中Eng 文|\quad and\quad |中 Eng 文|. \end{center} And their corresponding output is, \begin{center} -中Eng文,\quad 中 Eng文,\quad 中Eng 文\quad and\quad 中 Eng 文. +中Eng文,\quad 中 Eng文,\quad 中Eng 文\quad and\quad 中 Eng 文. \end{center} Look close and you'll find, that the first and second input generates exactly @@ -200,7 +203,7 @@ link}}.}% or Fig.~\ref{fig:kieu}.} \subsection{More on Fonts} Sometimes it may be desirable to use different Chinese fonts for different \NFSS\ font families in \LaTeX. This can be done by changing the definition of -\cs{zhs@savefont} and \cs{zhfont}, without modifying the |zhspacing| source. +\cs{zhs@savefont} and \cs{zhfont}, without modifying the |zhspacing| source. Here is the way to do it.\footnote{See zhfont.sty later for convenient ways.} \begin{verbatim} @@ -287,7 +290,7 @@ All of the skip commands above are defined in the pattern \\ \vadjust{}\hfil |\def\skipxxx{\hskip xxxxx}|. |zhspacing| comes with three pre-defined skip schemes, namely -\cs{simsunskipscheme}, \cs{emptyskipscheme} and \cs{haltskipscheme}. The +\cs{simsunskipscheme}, \cs{emptyskipscheme} and \cs{haltskipscheme}. The first scheme should be suitable for font \fntname{SimSun} and other popular Chinese fonts used in China, which does not support OpenType features of |halt|, and needs negative spaces be inserted before opening punctuations and @@ -300,7 +303,8 @@ customization, of course. Vertical Chinese can be achieved by adding raw feature |vertical| to the specified font. An example could be, \hfil \setbox0=\hbox to 0pt{\vbox{\noindent -\newfontfamily\zhfont[RawFeature={script=hani:language=CHN:vertical:+vert}, +\newfontlanguage{Chinese}{CHN} +\newfontfamily\zhfont[Script=CJK,Language=Chinese,Vertical=RotatedGlyphs, BoldFont=SimHei]{SimSun} \let\zhpunctfont\zhfont \haltskipscheme @@ -312,12 +316,14 @@ specified font. An example could be, \hfil \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{zhspacing} - \zhspacing - \begin{document} + \newfontlanguage{Chinese}{CHN} \newfontfamily\zhfont[ - RawFeature={script=hani:language=CHN:vertical:+vert}]{SimSun} + Script=CJK, Language=Chinese, + Vertical=RotatedGlyphs]{SimSun} \let\zhpunctfont\zhfont \haltskipscheme + \zhspacing + \begin{document} \rotatebox{-90}{我是中国人,我爱自己的祖国。} \end{document} \end{verbatim} @@ -331,7 +337,7 @@ punctuations using some fonts such as \fntname{KaiTi\_GB2312} etc. I've told this bug to \name{jjgod} in May, but it seems that he hasn't solved the problem yet. Moreover, the baseline of vertical Chinese is not correct, so mixed typesetting of Chinese and English in vertical mode generates ugly results, and -thus should be avoided. +thus should be avoided. \subsection{Compatibility} Theoretically, |zhspacing| should be compatible with all macro packages, except those who change the definition of \cs{hskip} and \cs{penalty}, in which case @@ -391,7 +397,8 @@ You can get latest stable version of |zhspacing| on CTAN. |zhspacing| was hosted on an open-source project at googlecode. The old project homepage is \url{http://code.google.com/p/zhspacing/}. -Now |zhspacing| is part of |ctex-kit| project (\url{http://code.google.com/p/ctex-kit/}). You can get the lastest source via SVN. +Now |zhspacing| is part of |ctex-kit| project (\url{https://github.com/CTeX-org/ctex-kit/}). +You can get the lastest source via Git. \goodbreak \part{zhfont.sty} @@ -415,13 +422,13 @@ You can redefine them to customize your fonts. Simply macro to set \cs{zh\{rm/sf/tt\}font} using \cs{newfontfamily}. \mymacro\newfontfamilywithslant -Create a font family with fake slant. Take one argument as the font name. +Create a font family with fake slant. Take one argument as the font name. Example: |\newfontfamilywithslant\zhrmfont{SimSun}| \mymacro\newfontfamilywithslantandbold Create a font family with fake slant, and specify another font for its -boldface. Take two arguments as the font name and bold font name. +boldface. Take two arguments as the font name and bold font name. Example:\\\quad |\newfontfamilywithslantandbold\zhrmfont{SimSun}{SimHei}| \section{Examples} diff --git a/Master/texmf-dist/doc/xetex/zhspacing/zhspacing-context-test.tex b/Master/texmf-dist/doc/xetex/zhspacing/zhspacing-context-test.tex new file mode 100644 index 00000000000..1f6c528d25c --- /dev/null +++ b/Master/texmf-dist/doc/xetex/zhspacing/zhspacing-context-test.tex @@ -0,0 +1,45 @@ +\usemodule[zhspacing] + + +这是中文测试。中文和English的混排。中 +文和$E=mc^2$的混排。 + +九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 +太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 +“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 +帝、六丁六甲之力锻造而成,有诗为证: + +九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 +太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 +“混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 +帝、六丁六甲之力锻造而成,有诗为证: + +\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps + +\ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps + +\tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps + +\blank + +\rm\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\rm\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\rm\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\rm\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par + +\blank + +\ss\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\ss\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\ss\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\ss\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par + +\blank + +\tt\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\tt\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\tt\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par +\tt\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par + + +\bye \ No newline at end of file -- cgit v1.2.3