summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-06-28 22:45:31 +0000
committerKarl Berry <karl@freefriends.org>2011-06-28 22:45:31 +0000
commitc65e75c1bde5e42977f9fc2f01d8acca17cbcb57 (patch)
tree6b6155f9a39a988e70f31390380d917b48b33ff8
parent4c251b1be76ed73481140c2537eda183c6cec4f2 (diff)
context-notes-zh-cn update for license
git-svn-id: svn://tug.org/texlive/trunk@23171 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/README4
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdfbin741696 -> 738337 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/basis.tex12
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibl-lyr.tex77
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibliography.bib18
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex64
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex89
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex51
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/fonts.tex51
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/layout.tex17
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/presentation.tex23
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/project.tex10
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/references.tex16
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-layout.tex411
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.lua272
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.mkiv37
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhspuncs.lua178
-rw-r--r--Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex99
18 files changed, 1137 insertions, 292 deletions
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README
index 48135b1bfce..eb41b59ff07 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/README
@@ -1,6 +1,8 @@
This is an introductory tutorial on ConTeXt in Chinese written by Yanrui Li.
-ConTeXt installation, fonts, layout design, cross-reference, project structure, metafun, presentation design are covered in this tutorial.
+ConTeXt installation, fonts, layout design, cross-reference, project structure, metafun are covered in this tutorial.
+
+This package is licensed in GFDL (GNU Free Documentation License).
If you are interested in the process of development you may observe
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
index 42e9ed4737d..5b13416d1ee 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/ctxnotes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/basis.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/basis.tex
index 4583db0f02e..6d1e46590b4 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/basis.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/basis.tex
@@ -228,7 +228,15 @@ $ context --generate
介绍了以上学习资源之后,我开始如释重负。以后再在这份文档上折腾,心里就不会总是想着自己在写一本 \CONTEXT\ 教程,那样子很累,并且很容易丧失乐趣。这份笔记的真正的意图是自我备忘,将它投放到网络上,是希望我的经验能够对他人有所帮助并且能够一同学习、讨论 \CONTEXT\ 排版知识。
-\vfil
-\midaligned{\color[gray]{\bfa Just for fun!}}
+\section{更多阅读……}
+
+如果上述内容有误或者你认为讲述的不够细致,那么请阅读以下文档:
+
+\startitemize
+\item “序幕有些长”,介绍了 \TEX\ 与 \CONTEXT\ MkIV 的背景知识:\crlf \hbox{\tt http://garfileo.is-programmer.com/2011/1/10/zhfonts-usage.23740.html}
+\item “这就是 \CONTEXT\ Minimals”,讲述了 \CONTEXT\ Minimals 的安装方法:\crlf\hbox{\tt http://liyanrui.is-programmer.com/2009/10/7/this-is-context-minimals.11971.html}
+\stopitemize
+
+我计划今年年底将这些外部文档归整到这份文档中。
\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibl-lyr.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibl-lyr.tex
new file mode 100644
index 00000000000..6e30f437813
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibl-lyr.tex
@@ -0,0 +1,77 @@
+\setupcite[num][inbetween={, }, lastpubsep={, },compress=yes]
+
+\def\withbrackets#1{[#1]~~}
+\setuppublications
+ [sorttype=,
+ criterium=,
+ refcommand=num,
+ numbering=yes,
+ numbercommand=\withbrackets,
+ autohang=yes]
+
+\setuppublicationlist
+ [artauthor=\normalauthor,
+ editor=\normalauthor,
+ author=\normalauthor,
+ namesep={,},
+ lastnamesep={ and },
+ finalnamesep={ and },
+ firstnamesep={ },
+ juniorsep={ },
+ vonsep={ },
+ surnamesep={ },
+ authoretallimit=5,
+ editoretallimit=5,
+ artauthoretallimit=5,
+ authoretaldisplay=5,
+ editoretaldisplay=5,
+ artauthoretaldisplay=5,
+ authoretaltext={ etc},
+ editoretaltext={ etc},
+ artauthoretaltext={ etc},
+]
+
+\setuppublicationlayout[article]{%
+ \insertartauthors{}{\unskip.}{}%
+ \insertarttitle{\bgroup }{\egroup[J].}{}%
+ \insertjournal{\bgroup }{\egroup}{}%
+ \insertpubyear{,}{}{}%
+ \insertvolume{,}{}{}%
+ \insertissue{(}{)}{}%
+ \insertpages{:}{.}{}%
+}
+
+\setuppublicationlayout[phdthesis]{%
+ \insertauthors{}{\unskip.}{}%
+ \inserttitle{}{\unskip[D].}{}%
+ \insertpubname{}{,}{}%
+ \insertpubyear{}{.}{}%
+}
+
+\setuppublicationlayout[techreport]{%
+ \insertauthors{}{.}{}%
+ \inserttitle{}{[R].}{}%
+ \insertpubname{}{}{}%
+ \insertpubyear{,}{.}{}%
+}
+
+\setuppublicationlayout[inproceedings]{%
+ \insertauthors{}{.}{}%
+ \insertarttitle{}{[C].}{}%%
+ \inserttitle{}{}{}%
+ \insertpubyear{,}{.}{}%
+}
+
+\setuppublicationlayout[book]{%
+ \insertauthors{}{.}{}%
+ \inserttitle{}{[M].}{}%
+ \insertpubname{}{}{}%
+ \insertpubyear{,}{.}{}%
+ \insertnote{}{}{}%
+}
+
+\setuppublicationlayout[unpublished]{%
+ \insertauthors{}{.}{}%
+ \inserttitle{}{.}{}%
+ \inserturl{}{}{}%
+}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibliography.bib b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibliography.bib
index c142fa54ca5..0203a2de9ac 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibliography.bib
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/bibliography.bib
@@ -1,52 +1,52 @@
-@booklet{bibtex,
+@unpublished{bibtex,
title = {{Tame the BeaST: The B to X of Bib\TeX}},
author = {Nicolas Markey},
url = {http://www.ctan.org/tex-archive/info/bibtex/tamethebeast/},
}
-@manual{fonts,
+@unpublished{fonts,
title = {{Fonts in \ConTeXt}},
author = {PRAGMA},
url = {http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf},
}
-@booklet{Taco,
+@unpublished{Taco,
title = {{Bibliographies}},
author = {Taco Hoekwater},
url = {http://modules.contextgarden.net/bib},
}
-@booklet{TacoCTXWiki,
+@unpublished{TacoCTXWiki,
title = {{Bibliography}},
author = {Taco Hoekwater},
url = {http://wiki.contextgarden.net/Bibliography},
}
-@booklet{widgets,
+@unpublished{widgets,
title = {{WIDGETS uncovered}},
author = {PRAGMA},
url = {http://pragma-ade.com/general/manuals/mwidget-s.pdf},
}
-@manual{cont-eni,
+@unpublished{cont-eni,
title = {{\ConTeXt the manual}},
author = {PRAGMA},
url = {http://www.pragma-ade.com/general/manuals/cont-eni.pdf},
}
-@manual{ms-cb-en,
+@unpublished{ms-cb-en,
title = {{\ConTeXt an excursion}},
author = {PRAGMA},
url = {http://www.pragma-ade.com/general/manuals/ms-cb-en.pdf},
}
-@manual{metafun,
+@unpublished{metafun,
title = {{METAFUN}},
author = {Hans Hagen},
url = {http://www.pragma-ade.com/general/manuals/metafun-s.pdf},
}
-@manual{lnotes,
+@unpublished{lnotes,
title = {{\LATEX 学习笔记}},
author = {Alpha Huang},
url = {http://www.ctan.org/tex-archive/info/lnotes/lnotes.pdf},
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex
deleted file mode 100644
index a6f1c3ebe06..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/cover.tex
+++ /dev/null
@@ -1,64 +0,0 @@
-\startcomponent cover
-\product ctxnote
-
-\definecolor [BackgroundColor] [h=cccccc]
-\definecolor [OrnamentColor] [h=99ccff]
-\definecolor [TitleColor] [h=336699]
-
-\startMPinclusions
- def random_hash_frame (expr width, height, offset, linewidth ) =
-
- def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
- x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
-
- drawoptions(withpen pencircle scaled linewidth withcolor transparent(1,.8,\MPcolor{BackgroundColor})) ;
- fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
-
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
- draw (x1-delta,y1)--(x2+delta,y1) ;
- draw (x2,y1-delta)--(x2,y2+delta) ;
- draw (x2+delta,y2)--(x1-delta,y2) ;
- draw (x1,y2+delta)--(x1,y1-delta) ;
-
- drawoptions();
- setbounds currentpicture to unitsquare xscaled width yscaled height ;
- enddef ;
-\stopMPinclusions
-
-\startuseMPgraphic{TitleGraphic}
- for i=1 upto 400 :
- offset := uniformdeviate 10pt ;
- width := 2*offset + 40pt + uniformdeviate 30pt ;
- height := 2*offset + 30pt + uniformdeviate 10pt ;
- addto currentpicture also
- image(random_hash_frame(width,height,offset,1pt)) shifted
- (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
- endfor ;
-\stopuseMPgraphic
-
-\defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}]
-
-\setupbackgrounds
- [page]
- [background={TitleGraphic,NextPage}]
-
-\startstandardmakeup
- \startcolor[white]
- \startframedtext[middle][width=.8\textwidth,height=5cm]
- \dontleavehmode
- \blank[.5cm]
- \hfil\bfd\ConTeXt\ 学习笔记\hfil
- \blank[.5cm]
- \hfil\bfc Using MkIV\hfil
- \blank[1cm]
- \hfil\bfa Li Yanrui (lyanry@gmail.com)\hfil
- \stopframedtext
- \stopcolor
-
- \blank[14cm]
-\stopstandardmakeup
-
-\setupbackgrounds[page]
- [background=]
-
-\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
index 67396e5c1a2..87059cd3f56 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/ctxnotes.tex
@@ -1,41 +1,88 @@
-\startproduct ctxnotes
\environment doc-env
+%\startproduct ctxnotes
+\starttext
% 封面
-\component cover
+\startMPinclusions
+ def random_hash_frame (expr width, height, offset, linewidth ) =
+
+ def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
+ x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
+
+ drawoptions(withpen pencircle scaled linewidth withcolor transparent(1,.8,\MPcolor{BackgroundColor})) ;
+ fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
+
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
+ draw (x1-delta,y1)--(x2+delta,y1) ;
+ draw (x2,y1-delta)--(x2,y2+delta) ;
+ draw (x2+delta,y2)--(x1-delta,y2) ;
+ draw (x1,y2+delta)--(x1,y1-delta) ;
+
+ drawoptions();
+ setbounds currentpicture to unitsquare xscaled width yscaled height ;
+ enddef ;
+\stopMPinclusions
+
+\startuseMPgraphic{TitleGraphic}
+ for i=1 upto 400 :
+ offset := uniformdeviate 10pt ;
+ width := 2*offset + 40pt + uniformdeviate 30pt ;
+ height := 2*offset + 30pt + uniformdeviate 10pt ;
+ addto currentpicture also
+ image(random_hash_frame(width,height,offset,1pt)) shifted
+ (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
+ endfor ;
+\stopuseMPgraphic
+
+\defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}]
% 前文
\startfrontmatter
- \setuppagenumbering[conversion=romannumerals]
- \setuppagenumber[number=1]
- \pagereference[Content]
- \title{目\;\;录}\blank
- \placecontent
+\setupbackgrounds [page][background=TitleGraphic]
+\startstandardmakeup
+ \startcolor[white]
+ \startframedtext[middle][width=.8\textwidth,height=5cm]
+ \dontleavehmode
+ \blank[.5cm]
+ \hfil\bfd\ConTeXt\ 学习笔记\hfil
+ \blank[.5cm]
+ \hfil\bfc Using MkIV\hfil
+ \blank[1cm]
+ \hfil\bfa Li Yanrui (liyanrui.m2@gmail.com)\hfil
+ \stopframedtext
+ \stopcolor
+ \blank[14cm]
+\stopstandardmakeup
+\setupbackgrounds [page][background=]
+\setuppagenumbering[conversion=romannumerals]
+\setuppagenumber[number=1]
+\title{目\;\;录}\blank
+\placecontent
\stopfrontmatter
% 正文
\startbodymatter
- \setuppagenumbering[conversion=number]
- \setuppagenumber[number=1]
- \setups{HeaderFooter}
- \component basis
- \component fonts
- \component layout
- \component references
- \component project
- \component metafun
- \component presentation
+\setuppagenumbering[conversion=number]
+\setuppagenumber[number=1]
+\setups{HeaderFooter}
+\component basis
+\component fonts
+\component layout
+\component references
+\component project
+\component metafun
\stopbodymatter
% 附录
\startappendices
- \title{参考文献}
- \placepublications[criterium=all]
+\title{参考文献}
+\placepublications[criterium=all]
\stopappendices
% 后文
\startbackmatter
- 色即是空
+未完成……
\stopbackmatter
-\stopproduct
+%\stopproduct
+\stoptext
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
index b63eab4f4b3..138b60d565c 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/doc-env.tex
@@ -1,35 +1,32 @@
\startenvironment doc-env
+\usemodule[zhfonts]
+
\usemodule[chart]
\usemodule[t][layout]
-\usemodule[bib]
-
-\usetypescriptfile[zhfonts]
-\usetypescript[myfont]
-\setupbodyfont[myfont,rm,11pt]
-\setscript[hanzi]
-\setupcolors[state=start]
\setupcolor[hex]
-\definecolor[mygreen][h=669933]
+\definecolor [BackgroundColor] [h=cccccc]
+\definecolor [OrnamentColor] [h=99ccff]
+\definecolor [TitleColor] [h=336699]
\setupinteraction
[state=start,
- focus=standard,
- color=mygreen,
+ focus=standard,
+ color=darkblue,
title={ConTeXt 学习笔记},
subtitle={Using MkIV},
author={Li Yanrui},
keyword={TeX, ConTeXt, MkIV, LuaTeX}]
-\setupinteractionscreen[option=max]
+%\setupinteractionscreen[option=max]
\setuppapersize[A4][A4]
\setuplayout[width=fit,height=middle,
- leftmargin=3cm,rightmargin=3cm,
- backspace=4cm,topspace=2cm,
+ leftmargin=2cm,rightmargin=2cm,
+ backspace=2.5cm,topspace=2cm,
headerdistance=.5cm,footerdistance=.5cm,
- leftmargindistance=.5cm,rightmargindistance=.5cm,
+ leftmargindistance=.5cm,rightmargindistance=.5cm,
header=1cm,footer=1cm]
\setuppagenumbering[style=\tfx,location=]
@@ -41,17 +38,16 @@
%-------- 标题设置 --------
\setupheads[indentnext=yes]
-\setuphead[title][style=\bfb,header=empty,foote=empty]
-\setuphead[chapter]
- [style=\bfb,header=empty,footer=empty]
+\setuphead[title][style=\bfb,align={broad,middle},header=empty,foote=empty]
+\setuphead[chapter][style=\bfb,header=empty,footer=empty]
\setuphead[section][style=\bfa]
\setuphead[subsubject][style=\bf]
% 代码环境
\setuplinenumbering[color=darkgray,style=small]
\setuptyping[option=color,palet=graypretty,
- before={\blank[.5em]\setupinterlinespace[medium]},
- after={\blank[.5em]}]
+ before={\blank[.5em]\setupinterlinespace[line=1.2em]},
+ after={\blank[.5em]}]
\definetyping[niceTEX][option=TEX]
@@ -67,7 +63,7 @@
\setuplist
[chapter]
[alternative=a,
- before={\page[preference]\blank},
+ before=\blank,
after=\blank,
style=\bf,
width=fit,
@@ -75,7 +71,7 @@
pagenumber=no,
numbercommand=\ChapterNumber]
-\def\PageNumber#1{\color[darkgray]{#1}.}
+\def\PageNumber#1{\underbars{#1}.}
\setuplist
[section]
[alternative=d,
@@ -98,10 +94,7 @@
\setupheadertexts
[\CurrentChapter][pagenumber]
[pagenumber][\CurrentSection]
- \setupfootertexts[{\ConTeXt\ 学习笔记}][{\goto{\bfx 目录}[Content]}]
- [{\goto{\bfx 目录}[Content]}][{\ConTeXt\ 学习笔记}]
\setupheader[style=\bfx,color=darkgray]
- \setupfooter[style=\bfx,color=darkgray]
\stopsetups
% 书签
@@ -110,18 +103,16 @@
% 参考文献
\setupbibtex[database=bibliography]
-\setuppublications[alternative=num]
+\setuppublications[alternative=lyr]
%---- 其它一些零碎设置 ----
-\setupinterlinespace[big]
+\setupinterlinespace[line=1.5em]
\setupwhitespace[big]
-%\setupindenting[always,first,2em]
\setupfloats[indentnext=yes]
\setupcaptions[style=\tfx, headstyle=\normal]
-\definesymbol[1][{\color[darkgray]{\dag}}]
-\setupitemize[each][packed,serried,inmargin][symbol=1,margin=2em]
+\setupitemize[each][packed,serried,inmargin][margin=2em]
\setupfootnotes[way=bychapter]
@@ -130,7 +121,7 @@
\definedescription[definition]
[location=top,hang=20,width=broad,indenting=always,style=\ss,headstyle=\bf]
-\def\mycite#1{\high{\cite[#1]}}
+\def\mycite#1{\cite[#1]}
%% 阴影盒
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/fonts.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/fonts.tex
index 7648cf017a4..c597b23ee57 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/fonts.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/fonts.tex
@@ -128,15 +128,15 @@ Adobe Song Std L:style=L,Regular
我们是在 typescript 环境中定义具体的字体,比如下面定义衬线字样的一组字体:
\startniceTEX
-\starttypescript [serif] [zhfont]
+\starttypescript[serif] [zhfont]
\definefontsynonym
- [Serif][name:Adobe Song Std][features=zh]
+ [Serif][name:adobesongstd]
\definefontsynonym
- [SerifBold][name:Adobe Heiti Std][features=zh]
+ [SerifBold][name:adobeheitistd]
\definefontsynonym
- [SerifItalic][name:Adobe Kaiti Std][features=zh]
+ [SerifItalic][name:adobekaitistd]
\definefontsynonym
- [SerifBoldItalic][name:Adobe Heiti Std][features=zh]
+ [SerifBoldItalic][name:adobeheitistd]
\stoptypescript
\stopniceTEX
@@ -146,8 +146,8 @@ Adobe Song Std L:style=L,Regular
\startniceTEX
\starttypescript[myfont]
- \definetypeface[myfont][rm][serif][zhfont]
- \definetypeface[myfont][ss][sans][zhfont]
+ \definetypeface[myfont][rm][serif][zhfont][features=zh]
+ \definetypeface[myfont][ss][sans][zhfont][features=zh]
\definetypeface[myfont][tt][mono][zhfont]
\stoptypescript
\stopniceTEX
@@ -183,16 +183,14 @@ Adobe Song Std L:style=L,Regular
下面展示一个小例子,用以说明如何使用 MkIV 的混合字体机制:
\startniceTEX
-\definefontfeature
- [zh][mode=node,script=hang,lang=zhs]
\definefontsynonym
- [zhserif][name:Adobe Song Std][features=zh]
+ [zhserif][name:adobesongstd]
\definefontfallback
[serifwhatever][lmroman10-regular][0x0000-0x0400][force=yes]
\definefontsynonym
[ZhSerif][zhserif][fallbacks=serifwhatever]
\definefont[FbSong][ZhSerif at 12pt]
-\definefont[Song][{name:Adobe Song Std} at 12pt][features=zh]
+\definefont[Song][name:adobesongstd at 12pt]
\starttext
\FbSong
@@ -205,30 +203,17 @@ Adobe Song Std L:style=L,Regular
字体切换命令 \tex{ZhSerif} 使用的是混合字体,是 Adobe 宋体的 \type{0x0000-0x0400} 区域中掺入了 lmroman10 字体的对应区域;而 \tex{Song} 命令使用的则是纯的 Adobe 宋体。上面的例子也许看不出来混合字体的优势所在,这主要是因为 Adobe 宋体中的英文部分设计的还算不错。如果将 Adobe 宋体换成 SimSun,对比效果会更明显一些。
-我们可以将这种混合字体机制与 MkIV 的 typescript 机制相结合,在不同风格的中文字体中掺入类似风格的英文字符,这样中英文混合排版的问题就能够得到较好的解决。至于如何在 typescript 文件中设置整套的混合字体,请参考一下 zhfonts.tex 吧。
-
-\section{字体装载加速}
+我们可以将这种混合字体机制与 MkIV 的 typescript 机制相结合,在不同风格的中文字体中掺入类似风格的英文字符,这样中英文混合排版的问题就能够得到较好的解决。
-Wang Yue 在 \CONTEXT\ 邮件列表中询问是否可以加快 MkIV 的字体装载速度,Hans 给出了一个小魔法,我的理解就是在 typescript 文件中添加
+\section{更多阅读……}
-\startniceTEX
-\let\synchronizetext\relax
-\stopniceTEX
+如果上述内容有误或者你认为讲述的不够细致,那么请阅读以下文档:
-\noindent 或者
-
-\startniceTEX
-\synchronizemathfontsfalse
-\stopniceTEX
-
-\noindent 其中内在机理,我不清楚,似乎是一个内存换时间的一个解决方案。Hans 也承认 MkIV 的运行效率还需要继续改进。
-
-\section{数学字体}
-
-To do or not to do, this is a question.
-
-\section{还有一些细节问题}
+\startitemize
+\item “不仅仅是为了中文”,详细介绍了 \CONTEXT\ 的 Typescript 机制:\crlf \hbox{\tt http://liyanrui.is-programmer.com/2009/10/21/not-just-for-chinese.12264.html}
+\item “zhfonts 模块的用法”,zhfonts 模块可支持中文字体加载、标点间距调整等功能:\crlf \hbox{\tt http://garfileo.is-programmer.com/2011/1/10/zhfonts-usage.23740.html}
+\stopitemize
-有一些问题,我不知道如何来解决。比如在中文排版环境中如何设置英文字体的 micro-typography 特征。
+我计划今年年底将这些外部文档归整到这份文档中。
-\stopcomponent \ No newline at end of file
+\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/layout.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/layout.tex
index b91f8ea3429..52691d16d8a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/layout.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/layout.tex
@@ -71,7 +71,7 @@
\type{location} 这个参数让我费解了许久,历经多次尝试,总算知道一点所以然。当我们将版面尺寸与纸张尺寸设为相同时,\type{location} 这个参数无论如何设定都是看不到效果的。当纸张尺寸大于版面尺寸时,\type{location} 的值可以表示版面在纸张的位置,譬如 left、right、middle、singlesided 以及 doublesided。
\page
-%\ShowLayout[digit=1,showmore=0]
+\ShowLayout[digit=1,showmore=0]
\page
\section[HFer]{页眉、页脚}
@@ -213,12 +213,21 @@ $ context --mode=screen ctxnotes
\ConTeXt\ 默认是将段间距设置为 0,这碰巧符合中文的排版规范。如果有设定段间距的需求,就查一下 \tex{setupwhitespace} 命令的用法。
-对文档正文而言,行间距的设置对于排版的美观性是至关重要的:行间距过小则阅读困难;行间距过大又显得版面稀疏,浪费纸张。\ConTeXt\ 默认的文本行间距的值对于中文排版而言过小,可通过 \tex{setupinterlinespace} 命令结合自己的审美嗜好对行间距进行调整。我是这样设置行间距的:
+对文档正文而言,行间距的设置对于排版的美观性是至关重要的:行间距过小则阅读困难;行间距过大又显得版面稀疏,浪费纸张。\ConTeXt\ 默认的文本行间距的值对于中文排版而言过小,可通过 \tex{setupinterlinespace} 命令结合自己的审美嗜好对行间距进行调整。我习惯将行高设为 1.5em:
\startniceTEX
-\setupinterlinespace[big]
+\setupinterlinespace[line=1.5em]
\stopniceTEX
-\noindent 除了 \type{big} 参数之外,\tex{setupinterlinesapce} 命令还可以接受 \type{small}、\type{medium} 参数,但我以为只有 \type{big} 适合作为中文文本行距。值得注意的是,\type{small}、\type{medium} 和 \type{big} 并不表示真正的行间距尺寸,它们分别表示的正文字体尺寸的 1.0、1.25 和 1.5 倍。这份笔记所使用的正文字体是 11pt,那么行间距就是 16.5pt。
+\section{更多阅读……}
+
+如果上述内容有误或者你认为讲述的不够细致,那么请阅读以下文档:
+
+\startitemize
+\item “页面布局控制”:\crlf \hbox{\tt http://garfileo.is-programmer.com/2011/1/19/layout-control.23895.html}
+\item “\CONTEXT\ 文稿的逻辑结构”:\crlf \hbox{\tt http://garfileo.is-programmer.com/2011/1/16/context-manuscript-logic-structure.23826.html}
+\stopitemize
+
+我计划今年年底将这些外部文档归整到这份文档中。
\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/presentation.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/presentation.tex
deleted file mode 100644
index 5ece42ad033..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/presentation.tex
+++ /dev/null
@@ -1,23 +0,0 @@
-\startcomponent presentation
-\product ctxnotes
-
-\chapter{制作演示文档}
-
-似乎很久都没有继续写这份笔记,因为很忙。即使不忙,也总能找到很忙的借口消耗掉继续写下去的动力。现在,开始写有关 \CONTEXT\ 演示文档制作的内容,是因为真正地要用到它。最近,一群领导们来学校视察工作,据说要顺便关怀一下我们的项目,因此我要准备一份 3~5 分钟的项目汇报。感觉有点滑稽,做了快 2 年的项目,只需要不到 5 分钟的时间就能汇报完。且不发牢骚了,利用这个机会学用一下 \CONTEXT\ 演示文档制作。
-
-\section{不用 \CONTEXT\ 的模板}
-\bookmark{不用 ConTeXt 的模板}
-
-不为别的,因为太难看了,我不认为它们中的哪一个适合我这一次的项目报告。
-
-\section{屏幕}
-
-演示文档的版面与用纸尺寸应当根据屏幕的宽高比例进行设置,通常是 4:3,具体情况可根据系统分辨率来确定。推荐的文档版面与用纸尺寸为 \CONTEXT\ 内建的用纸规格 S6,它的宽度接近 A4 纸宽,高度大约是 A4 纸高的一半。
-
-\startniceTEX
-\setuppapersize[S6][S6]
-\stopniceTEX
-
-
-
-\stopcomponent \ No newline at end of file
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/project.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/project.tex
index 2035b49adbe..861c51f1794 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/project.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/project.tex
@@ -54,10 +54,14 @@
也可以直接编译组件文档,因为在组件文档中已经记录了所使用的环境文档信息;在撰写文档的过程中,推荐使用编译组件文档的方式来查看排版效果。
-\section{一个读书笔记项目}
+\section{更多阅读……}
-最近打算认真地学习英文写作。由于我的基础太差,打算先从精读 {The Story of Mankind} 这本书开始。在读书的过程中,需要摘取一些记诵的句子,并尝试去写一些小短文或者总结一些常用的语法、单词知识,另外打算将这次的精读过程记录下来,以作将来缅怀之用。我尝试使用 \CONTEXT\ 来做这件事情,这也是我给自己寻找的学习大文件项目部署的一次机会。
+如果上述内容有误或者你认为讲述的不够细致,那么请阅读以下文档:
+\startitemize
+\item “\CONTEXT\ 文稿的物理结构”:\crlf \hbox{\tt http://garfileo.is-programmer.com/2011/1/12/project-structure.23773.html}
+\stopitemize
+我计划今年年底将这些外部文档归整到这份文档中。
-\stopcomponent \ No newline at end of file
+\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/references.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/references.tex
index d911d63d8cd..2fe85785d9a 100644
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/references.tex
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/references.tex
@@ -223,10 +223,9 @@ Bib\TeX\ 与 \ConTeXt\ 的协同工作时,需要 \ConTeXt\ 文档编译命令
\subsubject{\ConTeXt\ 的 bib 模块}
-\ConTeXt\ 是通过 Taco 写的 bib 模块取得 Bib\TeX\ 的协同,用户可以在 \ConTeXt\ 文档中实现参考文献列表排版样式的设置。下面是一份最为简单的 \ConTeXt\ 参考文献示例文档 \type{example/ex-4.tex}:
+\ConTeXt\ 是通过 Taco 写的 bib 模块取得 Bib\TeX\ 的协同(现已集成至 \CONTEXT\ 中),用户可以在 \ConTeXt\ 文档中实现参考文献列表排版样式的设置。下面是一份最为简单的 \ConTeXt\ 参考文献示例文档 \type{example/ex-4.tex}:
\startTEX
-\usemodule[bib] % 启用 bib 模块
\setupbibtex[database=example]
\starttext
@@ -251,7 +250,6 @@ $ context ex-4 # 完成文档编译
\startTEX
...
-\usemodule[bib] % 启用 bib 模块
\setupbibtex[database=example]
\setuppublications[alternative=num]
...
@@ -349,4 +347,16 @@ Zotero 是 Firefox 的一款扩展 (Extension),号称是下一代研究工具\
\stopTEX
\noindent 本文档目前正是使用这种方法去除书签中出现的格式化文本,勉强对付过去。
+
+\section{更多阅读……}
+
+如果上述内容有误或者你认为讲述的不够细致,那么请阅读以下文档:
+
+\startitemize
+\item “\CONTEXT\ 对参考文献的处理”:\crlf \hbox{\tt http://liyanrui.is-programmer.com/2009/12/17/bibliographic-in-ConTeXt.14078.html}
+\item “\CONTEXT\ 对参考文献的处理——整容篇”,讲述了 \CONTEXT\ Minimals 的安装方法:\crlf\hbox{\tt http://liyanrui.is-programmer.com/2009/12/18/bibliographic-style-in-ConTeXt.14103.html}
+\stopitemize
+
+我计划今年年底将这些外部文档归整到这份文档中。
+
\stopcomponent
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-layout.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-layout.tex
new file mode 100644
index 00000000000..7ca9d6e1b6f
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-layout.tex
@@ -0,0 +1,411 @@
+%% Last Change: Fri Apr 22 11:06:09 2005
+
+%D \module
+%D [ file=t-layout,
+%D version=2003.03.26,
+%D title=\CONTEXT\ User Module,
+%D subtitle=show layout,
+%D author=Patrick Gundlach,
+%D date=\currentdate,
+%D copyright={Patrick Gundlach}]
+
+
+%C filename: t-layout.tex
+%C module layout, shows layout of current page
+
+
+%C copyright 2003,2007 Patrick Gundlach, patrick@gundla.ch
+%C may be distributed under the terms of the GNU General Public License
+%C URL: http://levana.de/context/
+
+%D \subject{Introduction}
+%D This third-party module \quote{layout} draws a representation of
+%D the of the layout of the
+%D current page and displays the sizes of the widths and heights of the
+%D margins, header, footer and text body.
+
+%D \subject{Usage}
+%D Include this module into your ConTeXt files:
+%D \type{\usemodule[t][layout]} and show the layout with \type{\ShowLayout}.
+
+%D You can set some parameters using \type{\SetupShowLayout}. The
+%D parameters are: units, digits, round, showmore and graphonly.
+%D If graphonly (0/1) is 0, this module shows the lenghts of some text areas.
+%D units (cm, mm, in or pt) sets the unit in which the lengths will be
+%D displayed, digits (any number $\geq 0$)
+%D sets the number of digits after the decimal period, round (any
+%D number $\neq 0$) states
+%D the place where rounding of the displayed numbers should occur
+%D (\TeX\ is bad at calculating such things) and showmore (0/1) tells
+%D this module to display information about the edge and top/bottom.
+
+%D Example:
+%D \starttyping
+%D \ShowLayout
+%D [units=cm,
+%D digits=2,
+%D round=0.1,
+%D showmore=1,
+%D graphonly=1]
+%D
+%D \stoptyping
+
+%D The idea was taken from the \type{\layout} command from the layout LaTeX
+%D package. (Kent McPherson and others)
+
+%C the following settings will be recognized:
+%C units = cm, mm, in or pt
+%C digits = any number >= 0, those are the digits after the decimal period
+%C round = any number != 0, just play with it, example 0.1 or 0.01.
+%C Explanation will be done later
+
+%D \subject{The code}
+
+%D This section is not meant as documentation
+
+\newdimen\ShowLayoutdimen
+
+\setvalue{Layoutmm}{0.351459804} % 2.54/72.27 * 10
+\setvalue{Layoutcm}{0.0351459804} % 2.54/72.27
+\setvalue{Layoutin}{0.0138370001} % 1/72.27
+\setvalue{Layoutpt}{1}
+
+\def\ShowLayoutB(#1.#2)#3{%
+ \counttokens #2\to\scratchcounter
+ #1\ifnum#3>0%
+ \ifnum#3 > \the\scratchcounter \else \scratchcounter=#3 \fi
+ \splitofftokens \scratchcounter \from #2 \to\test .\test \fi}
+
+% taken from ConTeXt source
+\def\LayoutConvert#1#2#3%
+ {\ShowLayoutdimen=\getvalue{ShowLayoutround}pt
+ \begingroup
+ \scratchdimen#1\relax
+ \scratchdimen\getvalue{Layout#2}\scratchdimen
+ \advance\scratchdimen by 0.5\ShowLayoutdimen
+ \divide\scratchdimen by \ShowLayoutdimen
+ \multiply\scratchdimen by \ShowLayoutdimen
+ \expandafter\ShowLayoutB\expandafter(\number\withoutpt{\the\scratchdimen}){#3}\thinspace #2
+ \endgroup}
+
+\def\ShowLayoutA#1{%
+ \LayoutConvert{#1}%
+ {\getvalue{ShowLayoutunits}}%
+ {\getvalue{ShowLayoutdigits}}}%
+
+\startuniqueMPgraphic{ShowLayout}{showmore}
+% make sure that the label is on the same side as the posa
+vardef swapifnecessary (suffix posa, posb)(expr labelpos) =
+ if ( (labelpos < posa) and (posa > posb))
+ or ( (labelpos > posa) and (posa < posb)) :
+ save c; %swap 'em
+ c:=posa;
+ posa:=posb;
+ posb:= c;
+ fi
+enddef;
+% num: labelnumber
+% vertical: horizontal or vertical label?
+% pos: for horizontal the y coord, for vertical the x corrd
+% posa, posb: positions of the borders (x coord for horizontal)
+% labelpos: position for label, only for outer labels, given in the
+% same direction as posa, posb
+def layoutshowmark(expr num, vertical, pos, posa, posb, labelpos) =
+ save b,e,c,p,arrow;
+ numeric b,e; pair p[]; path arrow[],c;
+
+ b:=posa;
+ e:=posb;
+
+ % p0 is labelposition
+ % p1 is from
+ % p2 is to
+ % p3 is opposite arrow in outer marking
+
+ if labelpos = 0 : % inner label |<----(n)---->|
+ p0 := (.5[b,e], pos);
+ else: % outer label --->| |<----(n)
+ swapifnecessary (b,e, labelpos);
+ p0 := (labelpos, pos);
+ p3 := ( if b < labelpos: e-5mm else: e+5mm fi ,pos);
+ fi
+
+ p1 := (b,pos);
+ p2 := (e,pos);
+
+ if vertical:
+ p0:=(ypart p0,xpart p0);
+ p1:=(ypart p1,xpart p1);
+ p2:=(ypart p2,xpart p2);
+ p3:=(ypart p3,xpart p3);
+ fi
+ c:= fullcircle scaled .7cm shifted p0;
+
+ if (center(c) -- p1) intersectiontimes c = (-1,-1):
+ % don't draw the arrows, because there is not enough room for them.
+ else:
+ arrow1 :=center(c) -- p1 cutbefore (center(c) -- p1) intersectionpoint c ;
+ arrow2 :=
+ if labelpos = 0 : % inner
+ center(c) -- p2 cutbefore (center(c) -- p2) intersectionpoint c
+ else:
+ p3 -- p2
+ fi;
+
+ label (decimal (num), center(c));
+ draw c;
+ drawarrow arrow1;
+ drawarrow arrow2;
+ fi
+
+enddef;
+
+
+
+StartPage;
+numeric xpos,ypos;
+
+path body,leftmargin,header,footer,rightmargin;
+
+
+% backspace:
+draw llcorner Page shifted (BackSpace,0) --
+ ulcorner Page shifted (BackSpace,0) dashed evenly;
+
+%topspace
+draw urcorner Page shifted (0,-TopSpace) --
+ ulcorner Page shifted (0,-TopSpace) dashed evenly;
+
+
+header := Field [Header] [Text];
+footer := Field [Footer] [Text];
+leftmargin := Field [LeftMargin] [Text];
+rightmargin:= Field [RightMargin][Text];
+body := Field [Text] [Text];
+
+pickup pencircle scaled 2pt;
+
+draw Page;
+draw leftmargin;
+draw rightmargin;
+draw header;
+draw footer;
+draw body;
+
+
+
+label ("Body", center (body));
+label ("Header",center (header));
+label ("Left Margin", center (leftmargin));
+label ("Right Margin", center (rightmargin));
+label ("Footer", center (footer));
+%% label (textext("\tfb Body"), center (body));
+%% label (textext("\tfa Header"),center (header));
+%% label (textext("Left Margin"), center (leftmargin));
+%% label (textext("Right Margin"), center (rightmargin));
+%% label (textext("\tfa Footer"), center (footer));
+
+
+if \MPvar{showmore}=1:
+ path top, bot, leftedge, rightedge;
+
+ top := Field [Top] [Text];
+ bot := Field [Bottom] [Text];
+ leftedge := Field [LeftEdge] [Text];
+ rightedge := Field [RightEdge][Text];
+
+ draw top;
+ draw bot;
+ draw leftedge;
+ draw rightedge;
+fi
+
+pickup pencircle scaled 1pt;
+
+% (num, vertical, pos, from, to, labelpos)
+
+%backspace
+layoutshowmark (1, false, .5[ypart(ulcorner Page),Vstep[Top]], 0,BackSpace,0)
+
+
+ypos := Vstep[HeaderSeparator] -1cm;
+
+% leftmargin
+layoutshowmark (2, false, ypos,
+ Hstep[LeftMargin],
+ Hstep[LeftMargin]+Hsize[LeftMargin],0);
+
+% leftmargindistance
+layoutshowmark (3, false, ypos -1cm,
+ Hstep[LeftMarginSeparator],
+ Hstep[Text],
+ Hstep[Text]+1cm);
+
+% makeupwidth
+layoutshowmark (4, false, Vstep[Text]+2cm,
+ Hstep[Text], Hstep[Text]+Hsize[Text],0);
+
+% rightmargin
+layoutshowmark (5, false, ypos,
+ Hstep[RightMargin],
+ Hstep[RightMargin]+Hsize[RightMargin],0);
+
+% rightmargindistance
+layoutshowmark (6, false, ypos-1cm,
+ Hstep[RightMargin],
+ Hstep[RightMarginSeparator],
+ Hstep[RightMarginSeparator] -1cm);
+
+
+%topspace
+
+xpos:=xpart(ulcorner Page)+BackSpace+1cm;
+layoutshowmark (7, true, xpos, PaperHeight,PaperHeight-TopSpace,0)
+
+%header
+xpos:=xpos+1cm;
+ypos:=.5[PaperHeight,PaperHeight-TopSpace];
+layoutshowmark (8, true, xpos ,
+ Vstep[Header],
+ Vstep[Header]+Vsize[Header],ypos);
+
+%headerseparator
+xpos:=xpos+1cm;
+layoutshowmark (9, true,xpos,
+ Vstep[HeaderSeparator],
+ Vstep[HeaderSeparator]+Vsize[HeaderSeparator],ypos);
+
+xpos:=xpos+1cm;
+
+if \MPvar{showmore}=1:
+ % top
+ layoutshowmark (17, true, xpos,
+ Vstep[Top],
+ Vstep[Top]+Vsize[Top], ypos);
+
+ xpos:=xpos+1cm;
+ layoutshowmark (18, true, xpos,
+ Vstep[TopSeparator],
+ Vstep[TopSeparator]+Vsize[TopSeparator], ypos);
+
+fi
+
+% makeupheight
+layoutshowmark (10, true,Hstep[RightMarginSeparator]-2cm,
+ Vstep[Header]+Vsize[Header],
+ Vstep[Footer],0);
+
+
+%footerseparator
+xpos:=xpart(ulcorner Page)+BackSpace+2cm;
+ypos:=.5(Vstep[Footer]);
+
+layoutshowmark (11, true,xpos,
+ Vstep[FooterSeparator],
+ Vstep[FooterSeparator]+Vsize[FooterSeparator],ypos);
+
+%footer
+xpos:=xpos+1cm;
+layoutshowmark (12, true,xpos,
+ Vstep[Footer],Vstep[Footer]+Vsize[Footer],ypos);
+
+xpos:=xpos+1cm;
+
+if \MPvar{showmore}=1:
+ % bottom
+ layoutshowmark (19, true, xpos,
+ Vstep[Bottom],
+ Vstep[Bottom]+Vsize[Bottom], ypos);
+ xpos:=xpos+1cm;
+ layoutshowmark (20, true, xpos,
+ Vstep[BottomSeparator],
+ Vstep[BottomSeparator]+Vsize[BottomSeparator], ypos);
+
+fi
+
+if \MPvar{showmore}=1:
+
+ ypos := Vstep[HeaderSeparator] -3cm;
+
+ % LeftEdge
+ layoutshowmark (13, false, ypos,
+ Hstep[LeftEdge],
+ Hstep[LeftEdge]+Hsize[LeftEdge],Hstep[Text]+1cm);
+ ypos := ypos-1cm;
+ % LeftEdgeSeparator
+ layoutshowmark (14, false, ypos,
+ Hstep[LeftEdgeSeparator],
+ Hstep[LeftEdgeSeparator]+Hsize[LeftEdgeSeparator],
+ Hstep[Text]+1cm);
+
+ ypos := Vstep[HeaderSeparator] -3cm;
+
+ layoutshowmark (15, false, ypos,
+ Hstep[RightEdge],
+ Hstep[RightEdge]+Hsize[RightEdge],
+ Hstep[RightMarginSeparator] -1cm);
+
+ ypos := ypos-1cm;
+
+ layoutshowmark (16, false, ypos,
+ Hstep[RightEdge],
+ Hstep[RightEdgeSeparator],
+ Hstep[RightMarginSeparator] -1cm);
+
+
+
+fi
+
+currentpicture := currentpicture scaled .5;
+
+\stopuniqueMPgraphic
+\defineoverlay[ShowLayout][\uniqueMPgraphic{ShowLayout}]
+
+\def\SetupShowLayout{\dosingleempty\getparameters[ShowLayout]}
+\SetupShowLayout[units=pt,digits=1,round=0.1,showmore=0,graphonly=0]
+
+\def\ShowLayout{\dosingleempty\doShowLayout}
+
+
+\def\doShowLayout[#1]{%
+ \getparameters[ShowLayout][#1]
+ \setMPvariables[ShowLayout][showmore=\getvalue{ShowLayoutshowmore}]
+ \framed[width=.5\paperwidth,
+ height=.5\paperheight,
+ background=ShowLayout,
+ frame=off,
+% frame=on,
+ ]{}%
+\ifnum\getvalue{ShowLayoutgraphonly}=0
+ \bgroup\tfxx
+\startcolumns[n=2]
+\starttabulate[|r|l|]
+\NC 1 \NC backspace \ShowLayoutA{\the\backspace} \NR
+\NC 2 \NC leftmargin \ShowLayoutA{\the\leftmarginwidth}\NR
+\NC 3 \NC leftmargindistance \ShowLayoutA{\the\leftmargindistance}\NR
+\NC 4 \NC width \ShowLayoutA{\the\makeupwidth}\NR
+\NC 5 \NC rightmargin \ShowLayoutA{\the\rightmarginwidth}\NR
+\NC 6 \NC rightmargindistance \ShowLayoutA{\the\rightmargindistance}\NR
+\NC 7 \NC topspace \ShowLayoutA{\the\topspace}\NR
+\NC 8 \NC header \ShowLayoutA{\the\headerheight}\NR
+\NC 9 \NC headerdistance \ShowLayoutA{\the\headerdistance}\NR
+\NC 10\NC height \ShowLayoutA{\the\makeupheight}\NR
+\NC 11\NC footerdistance \ShowLayoutA{\the\footerdistance}\NR
+\NC 12\NC footer \ShowLayoutA{\the\footerheight}\NR
+\ifnum\getvalue{ShowLayoutshowmore}=1%
+\NC 13\NC leftedge \ShowLayoutA{\the\leftedgewidth}\NR
+\NC 14\NC leftedgedistance \ShowLayoutA{\the\leftedgedistance}\NR
+\NC 15\NC rightedge \ShowLayoutA{\the\rightedgewidth}\NR
+\NC 16\NC rightedgedistance \ShowLayoutA{\the\rightedgedistance}\NR
+\NC 17\NC top \ShowLayoutA{\the\topheight}\NR
+\NC 18\NC topdistance \ShowLayoutA{\the\topdistance}\NR
+\NC 19\NC bottom \ShowLayoutA{\the\bottomheight}\NR
+\NC 20\NC bottomdistance \ShowLayoutA{\the\bottomdistance}\NR
+\fi
+\NC \NC paperwidth \ShowLayoutA{\the\paperwidth}\NR
+\NC \NC paperheight \ShowLayoutA{\the\paperheight}\NR
+\stoptabulate
+\stopcolumns
+\egroup
+\fi
+}
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.lua b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.lua
new file mode 100644
index 00000000000..c40219febfb
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.lua
@@ -0,0 +1,272 @@
+zhfonts = {}
+
+local function init_fonts_table ()
+ local f = {}
+ f.serif, f.sans, f.mono = {}, {}, {}
+ for k in pairs (f) do
+ f[k] = {regular = {},bold = {}, italic = {}, bolditalic = {}}
+ end
+ return f
+end
+
+local cjkfonts, latinfonts = init_fonts_table (), init_fonts_table ()
+
+cjkfonts.serif.regular = {name = 'adobesongstd', rscale = '1.0'}
+cjkfonts.serif.bold = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.serif.italic = {name = 'adobesongstd', rscale = '1.0'}
+cjkfonts.serif.bolditalic = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.sans.regular = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.sans.bold = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.sans.italic = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.sans.bolditalic = {name = 'adobeheitistd', rscale = '1.0'}
+cjkfonts.mono.regular = {name = 'adobesongstd', rscale = '1.0'}
+cjkfonts.mono.bold = {name = 'adobesongstd', rscale = '1.0'}
+cjkfonts.mono.italic = {name = 'adobesongstd', rscale = '1.0'}
+cjkfonts.mono.bolditalic = {name = 'adobesongstd', rscale = '1.0'}
+
+latinfonts.serif.regular = {name = 'texgyrepagellaregular'}
+latinfonts.serif.bold = {name = 'texgyrepagellabold'}
+latinfonts.serif.italic = {name = 'texgyrepagellaitalic'}
+latinfonts.serif.bolditalic = {name = 'texgyrepagellabolditalic'}
+latinfonts.sans.regular = {name = 'texgyreherosregular'}
+latinfonts.sans.bold = {name = 'texgyreherosbold'}
+latinfonts.sans.italic = {name = 'texgyreherositalic'}
+latinfonts.sans.bolditalic = {name = 'texgyreherosbolditalic'}
+latinfonts.mono.regular = {name = 'lmmono10regular'}
+latinfonts.mono.bold = {name = 'lmmonolt10bold'}
+latinfonts.mono.italic = {name = 'lmmono10italic'}
+latinfonts.mono.bolditalic = {name = 'lmmonolt10boldoblique'}
+
+local mathfonts = {roman = {}}
+mathfonts.roman.name = 'xitsmathregular'
+mathfonts.roman.feature = 'math\mathsizesuffix'
+mathfonts.roman.goodies = 'xits-math'
+
+local function strsplit(str, sep)
+ local start_pos = 1
+ local split_pos = 1
+ local result = {}
+ local stop_pos = nil
+ while true do
+ stop_pos = string.find (str, sep, start_pos)
+ if not stop_pos then
+ result[split_pos] = string.sub (str, start_pos, string.len(str))
+ break
+ end
+ result[split_pos] = string.sub (str, start_pos, stop_pos - 1)
+ start_pos = stop_pos + string.len(sep)
+ split_pos = split_pos + 1
+ end
+ return result
+end
+
+local function strtrim (str)
+ return string.gsub (str, "^%s*(.-)%s*$", "%1")
+end
+
+local function str_split_and_trim (str, sep)
+ local strlist = strsplit (str, sep)
+ local result = {}
+ for i, v in ipairs (strlist) do
+ result[i] = strtrim (v)
+ end
+ return result
+end
+
+local function gen_cjk_typescript (ft)
+ local fb = '\\definefontfallback'
+ local fb_area = '[0x00400-0x2FA1F]'
+ local s1 = nil
+
+ context ('\\starttypescript[serif][zhfonts]')
+ context ('\\setups[font:fallbacks:serif]')
+ s = ft.serif.regular
+ context (fb..'[zhSerif][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.serif.bold
+ context (fb..'[zhSerifBold][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.serif.italic
+ context (fb..'[zhSerifItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.serif.bolditalic
+ context (fb..'[zhSerifBoldItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[sans][zhfonts]')
+ context ('\\setups[font:fallbacks:sans]')
+ s = ft.sans.regular
+ context (fb..'[zhSans][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.sans.bold
+ context (fb..'[zhSansBold][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.sans.italic
+ context (fb..'[zhSansItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.sans.bolditalic
+ context (fb..'[zhSansBoldItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[mono][zhfonts]')
+ context ('\\setups[font:fallbacks:mono]')
+ s = ft.mono.regular
+ context (fb..'[zhMono][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.mono.bold
+ context (fb..'[zhMonoBold][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.mono.italic
+ context (fb..'[zhMonoItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ s = ft.mono.bolditalic
+ context (fb..'[zhMonoBoldItalic][name:'..s.name..']'..fb_area..'[rscale='..s.rscale..']')
+ context ('\\stoptypescript')
+end
+
+local function gen_latin_typescript (ft)
+ local la = '\\definefontsynonym[latin'
+
+ context ('\\starttypescript[serif][zhfonts]')
+ context (la..'Serif][name:' .. ft.serif.regular.name .. ']')
+ context (la..'SerifBold][name:' .. ft.serif.bold.name .. ']')
+ context (la..'SerifItalic][name:' .. ft.serif.italic.name .. ']')
+ context (la..'SerifBoldItalic][name:' .. ft.serif.bolditalic.name .. ']')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[sans][zhfonts]')
+ context (la..'Sans][name:' .. ft.sans.regular.name .. ']')
+ context (la..'SansBold][name:' .. ft.sans.bold.name .. ']')
+ context (la..'SansItalic][name:' .. ft.sans.italic.name .. ']')
+ context (la..'SansBoldItalic][name:' .. ft.sans.bolditalic.name .. ']')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[mono][zhfonts]')
+ context (la..'Mono][name:' .. ft.mono.regular.name .. ']')
+ context (la..'MonoBold][name:' .. ft.mono.bold.name .. ']')
+ context (la..'MonoItalic][name:' .. ft.mono.italic.name .. ']')
+ context (la..'MonoBoldItalic][name:' .. ft.mono.bolditalic.name .. ']')
+ context ('\\stoptypescript')
+end
+
+local function gen_fallback_typescript ()
+ context ('\\starttypescript[serif][zhfonts]')
+ context ('\\setups[font:fallbacks:serif]')
+ context ('\\definefontsynonym[zhSeriffallback][latinSerif][fallbacks=zhSerif]')
+ context ('\\definefontsynonym[Serif][zhSeriffallback]')
+ context ('\\definefontsynonym[zhSerifBoldfallback][latinSerifBold][fallbacks=zhSerifBold]')
+ context ('\\definefontsynonym[SerifBold][zhSerifBoldfallback]')
+ context ('\\definefontsynonym[zhSerifItalicfallback][latinSerifItalic][fallbacks=zhSerifItalic]')
+ context ('\\definefontsynonym[SerifItalic][zhSerifItalicfallback]')
+ context ('\\definefontsynonym[zhSerifBoldItalicfallback][latinSerifBoldItalic][fallbacks=zhSerifBoldItalic]')
+ context ('\\definefontsynonym[SerifBoldItalic][zhSerifBoldItalicfallback]')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[sans][zhfonts]')
+ context ('\\setups[font:fallbacks:sans]')
+ context ('\\definefontsynonym[zhSansfallback][latinSans][fallbacks=zhSans]')
+ context ('\\definefontsynonym[Sans][zhSansfallback]')
+ context ('\\definefontsynonym[zhSansBoldfallback][latinSansBold][fallbacks=zhSansBold]')
+ context ('\\definefontsynonym[SansBold][zhSansBoldfallback]')
+ context ('\\definefontsynonym[zhSansItalicfallback][latinSansItalic][fallbacks=zhSansItalic]')
+ context ('\\definefontsynonym[SansItalic][zhSansItalicfallback]')
+ context ('\\definefontsynonym[zhSansBoldItalicfallback][latinSansBoldItalic][fallbacks=zhSansBoldItalic]')
+ context ('\\definefontsynonym[SansBoldItalic][zhSansBoldItalicfallback]')
+ context ('\\stoptypescript')
+
+ context ('\\starttypescript[mono][zhfonts]')
+ context ('\\setups[font:fallbacks:mono]')
+ context ('\\definefontsynonym[zhMonofallback][latinMono][fallbacks=zhMono]')
+ context ('\\definefontsynonym[Mono][zhMonofallback]')
+ context ('\\definefontsynonym[zhMonoBoldfallback][latinMonoBold][fallbacks=zhMonoBold]')
+ context ('\\definefontsynonym[MonoBold][zhMonoBoldfallback]')
+ context ('\\definefontsynonym[zhMonoItalicfallback][latinMonoItalic][fallbacks=zhMonoItalic]')
+ context ('\\definefontsynonym[MonoItalic][zhMonoItalicfallback]')
+ context ('\\definefontsynonym[zhMonoBoldItalicfallback][latinMonoBoldItalic][fallbacks=zhMonoBoldItalic]')
+ context ('\\definefontsynonym[MonoBoldItalic][zhMonoBoldItalicfallback]')
+ context ('\\stoptypescript')
+end
+
+local function gen_math_typescript (ft)
+ if mathfonts.roman.name then
+ local s = ft.roman
+ context ('\\starttypescript[math][zhfonts]')
+ context ('\\setups[font:fallbacks:math]')
+ context ('\\definefontsynonym[MathRoman][name:'..s.name..'][features='..s.feature..', goodies='..s.goodies..']')
+ context ('\\stoptypescript')
+ end
+end
+
+local function gen_typeface ()
+ context ('\\starttypescript[zhfonts]')
+ context ('\\definetypeface[zhfonts][rm][serif][zhfonts][default][features=zh]')
+ context ('\\definetypeface[zhfonts][ss][sans][zhfonts][default][features=zh]')
+ context ('\\definetypeface[zhfonts][tt][mono][zhfonts][default]')
+ if mathfonts.roman.name then
+ context ('\\definetypeface[zhfonts][mm][math][zhfonts]')
+ end
+ context ('\\stoptypescript')
+end
+
+function zhfonts.gen_typescript ()
+ gen_cjk_typescript (cjkfonts)
+ gen_latin_typescript (latinfonts)
+ gen_fallback_typescript ()
+ gen_math_typescript (mathfonts)
+ gen_typeface ()
+end
+
+local function setup_cjkfonts (meta, fontlist)
+ local f, g = nil, nil
+ for i, v in ipairs (fontlist) do
+ f = str_split_and_trim (v, '=')
+ g = str_split_and_trim (f[2], '@')
+ if g[1] ~= '' then cjkfonts[meta][f[1]].name = g[1] end
+ if g[2] then cjkfonts[meta][f[1]].rscale = g[2] end
+ end
+end
+
+local function setup_latinfonts (meta, fontlist)
+ local f, g = nil, nil
+ for i, v in ipairs (fontlist) do
+ f = str_split_and_trim (v, '=')
+ latinfonts[meta][f[1]].name = f[2]
+ end
+end
+
+local function setup_mathfonts (fontlist)
+ local f, g = nil, nil
+ for i, v in ipairs (fontlist) do
+ f = str_split_and_trim (v, '=')
+ if f[2] ~= '' then
+ mathfonts[f[1]].name = f[2]
+ else
+ mathfonts[f[1]].name = nil
+ end
+ end
+end
+
+
+local fontfeatures = "mode=node,protrusion=myvector,liga=yes,"
+local function setup_fontfeatures (s)
+ fontfeatures = fontfeatures .. s
+ print (fontfeatures)
+end
+
+function zhfonts.setup (metainfo, fontinfo)
+ local m = str_split_and_trim (metainfo, ',')
+ local f = str_split_and_trim (fontinfo, ',')
+ if #m == 1 and m[1] == 'feature' then setup_fontfeatures (fontinfo) end
+ if #m == 1 and cjkfonts[m[1]] then setup_cjkfonts (m[1], f) end
+ if #m == 1 and m[1] == 'math' then setup_mathfonts (f) end
+ if #m == 2 then
+ if m[1] == 'latin' and latinfonts[m[2]] then setup_latinfonts (m[2], f) end
+ if m[2] == 'latin' and latinfonts[m[1]] then setup_latinfonts (m[1], f) end
+ end
+end
+
+function zhfonts.use (param)
+ context ('\\setscript[hanzi]')
+ zhspuncs.opt ()
+ context ('\\definefontfeature[zh][default][' .. fontfeatures .. ']')
+ context ('\\setupalign[hz,hanging]')
+ local f = strtrim (param)
+ if f ~= "none" then
+ zhfonts.gen_typescript ()
+ if f ~= "hack" then
+ context ('\\usetypescript[zhfonts]')
+ context ('\\setupbodyfont[zhfonts, ' .. param .. ']')
+ end
+ end
+end
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.mkiv b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.mkiv
new file mode 100644
index 00000000000..5549845cce5
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhfonts.mkiv
@@ -0,0 +1,37 @@
+%D \module
+%D [ file=t-zhfonts,
+%D version=2010.01.06,
+%D title=\CONTEXT\ User Module,
+%D subtitle=zhfonts,
+%D author=Li Yanrui,
+%D date=\currentdate,
+%D copyright=Li Yanrui,
+%D email=liyanrui.m2@gmail.com,
+%D license=Public Domain]
+
+\writestatus{loading}{ConTeXt User Module / zhfonts}
+\startmodule[zhfonts]
+\unprotect
+\setupmodule[style=rm,size=11pt]
+
+%D Lua code
+\ctxloadluafile{t-zhfonts}
+\ctxloadluafile{t-zhspuncs}
+
+\def\setupzhfonts{\dodoubleempty\dosetupzhfonts}
+\def\dosetupzhfonts[#1][#2]{%
+ \ctxlua{zhfonts.setup ('#1', '#2')}
+}
+
+\def\zhfonts[#1]{%
+ \ctxlua{zhfonts.use ("#1")}
+}
+
+\edef\@@@@??style{\currentmoduleparameter{style}}
+\edef\@@@@??size{\currentmoduleparameter{size}}
+\prependtoks \zhfonts[\@@@@??style, \@@@@??size] \to \everystarttext
+
+\protect
+\stopmodule
+\endinput
+
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhspuncs.lua b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhspuncs.lua
new file mode 100644
index 00000000000..a739bf4c03d
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/t-zhspuncs.lua
@@ -0,0 +1,178 @@
+zhspuncs = zhspuncs or {}
+
+local glyph = nodes.pool.register (node.new ("glyph", 0))
+
+local glyph_flag = node.id ('glyph')
+local glue_flag = node.id ('glue')
+local hlist_flag = node.id ('hlist')
+local kern_flag = node.id ('kern')
+local penalty_flag = node.id ('penalty')
+local math_flag = node.id ('math')
+
+local fonthashes = fonts.hashes
+local fontdata = fonthashes.identifiers
+local quaddata = fonthashes.quads
+
+local node_count = node.count
+local node_dimensions = node.dimensions
+local node_traverse_id = node.traverse_id
+local node_slide = node.slide
+local list_tail = node.tail
+local insert_before = node.insert_before
+local insert_after = node.insert_after
+local new_glue = nodes.pool.glue
+local new_kern = nodes.pool.kern
+local new_glue_spec = nodes.pool.glue_spec
+local new_penalty = nodes.pool.penalty
+local new_rule = nodes.pool.rule
+
+local tasks = nodes.tasks
+
+
+local puncs = {
+ [0x2018] = {0.5, 0.1, 1.0, 1.0}, -- ‘
+ [0x201C] = {0.5, 0.1, 0.5, 1.0}, -- “
+ [0x3008] = {0.5, 0.1, 1.0, 1.0}, -- 〈
+ [0x300A] = {0.5, 0.1, 1.0, 1.0}, -- 《
+ [0x300C] = {0.5, 0.1, 1.0, 1.0}, -- 「
+ [0x300E] = {0.5, 0.1, 1.0, 1.0}, -- 『
+ [0x3010] = {0.5, 0.1, 1.0, 1.0}, -- 【
+ [0x3014] = {0.5, 0.1, 1.0, 1.0}, -- 〔
+ [0x3016] = {0.5, 0.1, 1.0, 1.0}, -- 〖
+ [0xFF08] = {0.5, 0.1, 1.0, 1.0}, -- (
+ [0xFF3B] = {0.5, 0.1, 1.0, 1.0}, -- [
+ [0xFF5B] = {0.5, 0.1, 1.0, 1.0}, -- {
+ [0x2019] = {0.1, 0.5, 1.0, 0.0}, -- ’
+ [0x201D] = {0.1, 0.5, 1.0, 0.0}, -- ”
+ [0x3009] = {0.1, 0.5, 1.0, 0.5}, -- 〉
+ [0x300B] = {0.1, 0.5, 1.0, 0.5}, -- 》
+ [0x300D] = {0.1, 0.5, 1.0, 0.5}, -- 」
+ [0x300F] = {0.1, 0.5, 1.0, 0.5}, -- 』
+ [0x3011] = {0.1, 0.5, 1.0, 0.5}, -- 】
+ [0x3015] = {0.1, 0.5, 1.0, 0.5}, -- 〕
+ [0x3017] = {0.1, 0.5, 1.0, 0.5}, -- 〗
+ [0xFF09] = {0.1, 0.5, 1.0, 0.5}, -- )
+ [0xFF3D] = {0.1, 0.5, 1.0, 0.5}, -- ]
+ [0xFF5D] = {0.1, 0.5, 1.0, 0.5}, -- }
+ -- 需要特殊处理
+ [0x2014] = {0.0, 0.0, 1.0, 1.0}, -- —
+ [0x2026] = {0.1, 0.1, 1.0, 1.0}, -- …
+ [0x2500] = {0.0, 0.0, 1.0, 1.0}, -- ─
+ [0x3001] = {0.15, 0.5, 1.0, 0.5}, -- 、
+ [0x3002] = {0.15, 0.6, 1.0, 0.3}, -- 。
+ [0xFF01] = {0.15, 0.5, 1.0, 0.5}, -- !
+ [0xFF05] = {0.0, 0.0, 1.0, 0.5}, -- %
+ [0xFF0C] = {0.15, 0.5, 1.0, 0.3}, -- ,
+ [0xFF0E] = {0.15, 0.5, 1.0, 0.5}, -- .
+ [0xFF1A] = {0.15, 0.5, 1.0, -0.1}, -- :
+ [0xFF1B] = {0.15, 0.5, 1.0, 0.5}, -- ;
+ [0xFF1F] = {0.15, 0.5, 1.0, 0.5}, -- ?
+}
+
+local function is_zhcnpunc_node (n)
+ local n_is_punc = 0
+ if puncs[n.char] then
+ return true
+ end
+ return false
+end
+
+local function is_zhcnpunc_node_group (n)
+ local n_is_punc = 0
+ if puncs[n.char] then
+ n_is_punc = 1
+ end
+ local nn = n.next
+ local nn_is_punc = 0
+ -- 还需要穿越那些非 glyph 结点
+ while nn_is_punc == 0 and nn and n_is_punc == 1 do
+ if nn.id == glyph_flag then
+ if puncs[nn.char] then nn_is_punc = 1 end
+ break
+ end
+ nn = nn.next
+ end
+ return n_is_punc + nn_is_punc
+end
+
+local function is_cjk_ideo (n)
+ -- CJK Ext A
+ if n.char >= 13312 and n.char <= 19893 then
+ return true
+ -- CJK
+ elseif n.char >= 19968 and n.char <= 40891 then
+ return true
+ -- CJK Ext B
+ elseif n.char >= 131072 and n.char <= 173782 then
+ return true
+ else
+ return false
+ end
+end
+
+local function quad_multiple (font, r)
+ local quad = quaddata[font]
+ return r * quad
+end
+
+local function process_punc (head, n, punc_flag, punc_table)
+ local desc = fontdata[n.font].descriptions[n.char]
+ if not desc then return end
+ local quad = quad_multiple (n.font, 1)
+
+ -- 像 $\ldots$ 这样的符号竟然没有边界盒,只好忽略并返回
+ -- if desc.boundingbox == nil then return end
+
+ local l_space = desc.boundingbox[1] / desc.width
+ local r_space = (desc.width - desc.boundingbox[3]) / desc.width
+ local l_kern, r_kern = 0.0, 0.0
+
+ if punc_flag == 1 then
+ l_kern = (punc_table[n.char][1] - l_space) * quad
+ r_kern = (punc_table[n.char][2] - r_space) * quad
+ elseif punc_flag == 2 then
+ l_kern = (punc_table[n.char][1] * punc_table[n.char][3] - l_space) * quad
+ r_kern = (punc_table[n.char][2] * punc_table[n.char][4] - r_space) * quad
+ end
+
+ insert_before (head, n, new_kern (l_kern))
+ insert_after (head, n, new_kern (r_kern))
+end
+
+local function compress_punc (head)
+ for n in node_traverse_id (glyph_flag, head) do
+ local n_flag = is_zhcnpunc_node_group (n)
+ if n_flag ~= 0 then
+ process_punc (head, n, n_flag, puncs)
+ end
+ end
+end
+
+function zhspuncs.my_linebreak_filter (head, is_display)
+ compress_punc (head)
+ return head, true
+end
+
+function zhspuncs.opt ()
+ tasks.appendaction("processors","after","zhspuncs.my_linebreak_filter")
+end
+
+fonts.protrusions.vectors['myvector'] = {
+ [0xFF0c] = { 0, 0.60 }, -- ,
+ [0x3002] = { 0, 0.60 }, -- 。
+ [0x2018] = { 0.60, 0 }, -- ‘
+ [0x2019] = { 0, 0.60 }, -- ’
+ [0x201C] = { 0.60, 0 }, -- “
+ [0x201D] = { 0, 0.60 }, -- ”
+ [0xFF1F] = { 0, 0.60 }, -- ?
+ [0x300A] = { 0.60, 0 }, -- 《
+ [0x300B] = { 0, 0.60 }, -- 》
+ [0xFF08] = { 0.50, 0 }, -- (
+ [0xFF09] = { 0, 0.50 }, -- )
+ [0x3001] = { 0, 0.50 }, -- 、
+ [0xFF0E] = { 0, 0.50 }, -- .
+}
+fonts.protrusions.classes['myvector'] = {
+ vector = 'myvector', factor = 1
+}
+
diff --git a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex b/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex
deleted file mode 100644
index ce98d3cef9d..00000000000
--- a/Master/texmf-dist/doc/context/third/context-notes-zh-cn/src/zhfonts.tex
+++ /dev/null
@@ -1,99 +0,0 @@
-% engine=luatex
-% \ctxlua{fonts.collections.trace = true}
-\definefontfeature[zh][mode=node,script=hang,lang=zhs]
-
-\starttypescript [serif] [zhfont]
- \definefontsynonym [zhserif]
- [AdobeSongStd-Light][features=zh]
- \definefontsynonym [zhserifbold]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontsynonym [zhserifitalic][AdobeKaitiStd-Regular]
- [features=zh]
- \definefontsynonym [zhserifbolditalic]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontfallback[serifwhatever]
- [lmroman10-regular][0x0000-0x0400][force=yes]
- \definefontfallback[serifboldwhatever]
- [lmroman10-bold][0x0000-0x0400][force=yes]
- \definefontfallback[serifitalicwhatever]
- [lmroman10-italic][0x0000-0x0400][force=yes]
- \definefontfallback[serifbolditalicwhatever]
- [lmroman10-bolditalic][0x0000-0x0400][force=yes]
-\stoptypescript
-
-\starttypescript [serif][zhfont][name]
- \definefontsynonym[Serif]
- [zhserif][fallbacks=serifwhatever]
- \definefontsynonym[SerifBold]
- [zhserifbold][fallbacks=serifboldwhatever]
- \definefontsynonym[SerifItalic]
- [zhserifitalic][fallbacks=serifitalicwhatever]
- \definefontsynonym[SerifBoldItalic]
- [zhserifbolditalic][fallbacks=serifbolditalicwhatever]
-\stoptypescript
-
-\starttypescript [sans][zhfont]
- \definefontsynonym [zhsans]
- [AdobeKaitiStd-Regular][features=zh]
- \definefontsynonym [zhsansbold]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontsynonym [zhsansitalic]
- [AdobeKaitiStd-Regular][features=zh]
- \definefontsynonym [zhsansbolditalic]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontfallback[sanswhatever]
- [lmsans10-regular][0x0000-0x0400][force=yes]
- \definefontfallback[sansboldwhatever]
- [lmsans10-Bold][0x0000-0x0400][force=yes]
- \definefontfallback[sansitalicwhatever]
- [lmsans10-italic][0x0000-0x0400][force=yes]
- \definefontfallback[sansbolditalicwhatever]
- [lmsans10-bolditalic][0x0000-0x0400][force=yes]
-\stoptypescript
-
-\starttypescript [sans][zhfont][name]
- \definefontsynonym[Sans]
- [zhsans][fallbacks=sanswhatever]
- \definefontsynonym[SansBold]
- [zhsansbold][fallbacks=sansboldwhatever]
- \definefontsynonym[SansItalic]
- [zhsansitalic][fallbacks=sansitalicwhatever]
- \definefontsynonym[SansBoldItalic]
- [zhsansbolditalic][fallbacks=sansbolditalicwhatever]
-\stoptypescript
-
-\starttypescript [mono][zhfont]
- \definefontsynonym [zhmono]
- [AdobeKaitiStd-Regular][features=zh]
- \definefontsynonym [zhmonobold]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontsynonym [zhmonoitalic]
- [AdobeKaitiStd-Regular][features=zh]
- \definefontsynonym [zhmonobolditalic]
- [AdobeHeitiStd-Regular][features=zh]
- \definefontfallback[monowhatever]
- [lmmono10-regular][0x0000-0x0400][force=yes]
- \definefontfallback[monoboldwhatever]
- [lmmonolt10-bold][0x0000-0x0400][force=yes]
- \definefontfallback[monoitalicwhatever]
- [lmmono10-italic][0x0000-0x0400][force=yes]
- \definefontfallback[monobolditalicwhatever]
- [lmmonolt10-boldoblique][0x0000-0x0400][force=yes]
-\stoptypescript
-
-\starttypescript [mono][zhfont][name]
- \definefontsynonym[Mono]
- [zhmono][fallbacks=monowhatever]
- \definefontsynonym[MonoBold]
- [zhmonobold][fallbacks=monoboldwhatever]
- \definefontsynonym[MonoItalic]
- [zhmonoitalic][fallbacks=monoitalicwhatever]
- \definefontsynonym[MonoBoldItalic]
- [zhmonobolditalic][fallbacks=monobolditalicwhatever]
-\stoptypescript
-
-\starttypescript[myfont]
- \definetypeface[myfont][rm][serif][zhfont]
- \definetypeface[myfont][ss][sans][zhfont]
- \definetypeface[myfont][tt][mono][zhfont]
-\stoptypescript