<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter[chinese-fonts]{ćąĺ­}

čŽŠ \TeX\ çłťçťćŻććąĺ­ďźčżä¸ŞäťťĺĄćžçťĺžĺŽšćĺŻšć°ćĺ­Śäš&nbsp;ĺä˝żç¨ \TeX\ çç­ćé&nbsp;ććŻç­ć§ćĺťăĺćĽďźéç \XeTeX\ ĺ \LuaTeX\ ç­ç°äťŁ \TeX\ ĺźćçĺşç°ďźčżéĄšäťťĺĄçéžĺşŚĺˇ˛çťĺ¤§ĺšéä˝äşă\ConTeXt\ LMTX ćç¨ç \TeX\ ĺźććŻ \LuaMetaTeXďźĺŻš \LuaTeX\ čżčĄäşç˛žçŽĺšśä˝ä¸şĺŽççť§äťťččçť§çť­ĺĺąăĺŻč˝ä˝&nbsp;ç°ĺ¨ĺšśä¸çč§ŁčżäşćŻčŻ­ďźä˝äšä¸ĺżćĺżďźĺŚĺéŠžéŠśä¸čž \ConTeXt\ ćą˝č˝Śďźć&nbsp;éçĽéĺŽçĺźćďźĺĺ¨ćşďźćŻĺŞä¸ŞĺˇĽĺçäş§çďźĺść§č˝ĺć°ĺćŻĺŚä˝ă

\section[fonts-installation]{ĺŽčŁĺ­ä˝}

éŚĺďźéčŚćžĺ°ä¸ćŹžćąĺ­ĺ­ä˝ćäťśďźĺŚĺĺŞćĺ­Śäťé˘ďźčŞĺˇąé&nbsp;ĺ­ăĺčĽä˝&nbsp;ćä˝&nbsp;çćĺçčŽĄçŽćşä¸­čŁć Windows çłťçťďźĺŻäťĺŚĺž \in[msfonts] ćç¤şç \type{C:\Windows\Fonts} çŽĺ˝ä¸čˇĺžĺŽä˝ďźsimsun.ttcďźăéťä˝ďźsimhei.ttfďźĺćĽˇä˝ďźsimkai.ttfďźç­ĺ­ä˝ćäťśăćäşĺŽäťŹďźčśłäťĽčäťťĺ¸¸č§çćçĺˇĽä˝ă

\placefigure
  [here,force]
  [msfonts]
  {\type{C:\Windows\Fonts}}
  {\externalfigure[03/msfonts.png][width=.6\textwidth]}

ĺ¨ĺźĺ§ĺŽčŁĺ­ä˝äšĺďźéčŚçťĺşä¸ä¸ŞćŻčŻ­ďź\TeX\ ć&nbsp;šçŽĺ˝ăäťĽ Windows çłťçťä¸şäžďźčĽ \ConTeXt\ ĺŽčŁĺ¨ \type{D:\context} çŽĺ˝ďźĺčŻĽçŽĺ˝ä¸­çĺ­çŽĺ˝ĺćäťśĺ˝ĺŚĺž \in[tex-root] ćç¤şăĺ¨čżç§ćĺľä¸ďź\type{D:\context\tex} çŽĺ˝ĺłä¸ş \TeX\ ć&nbsp;šçŽĺ˝ăĺçďźĺŻšäş Linux ĺ macOS çłťçťďźčĽ \ConTeXt\ ĺŽčŁĺ¨ \type{$HOME/context} çŽĺ˝ďźĺ \type{$HOME/context/tex} ä¸ş \TeX\ ć&nbsp;šçŽĺ˝ă

\placefigure
  [here,force]
  [tex-root]
  {\TeX\ ć&nbsp;šçŽĺ˝}
  {\externalfigure[03/tex-root.png][width=.6\textwidth]}

ä¸şäşäžżäşćčż°ďźäťç°ĺ¨ĺźĺ§ďźäťĽčćççąť Unix çŻĺ˘ĺééŁć&nbsp;źç \type{$TEXROOT} ćäťŁ \TeX\ ć&nbsp;šçŽĺ˝ďźä¸ĺä˝żç¨ĺˇä˝čˇŻĺžďźĺ&nbsp;ä¸şĺčä¸Ľéäžčľäşćä˝çłťçťĺç¨ćˇĺĺĽ˝čçźşäšä¸č´ć§ăć­¤ĺ¤ďźčˇŻĺžä¸­ççŽĺ˝é´éçŹŚäšçťä¸ä˝żç¨çąť Unix éŁć&nbsp;źčżčĄčĄ¨ç¤şďźĺłä˝żç¨ă\type{/}ăčé Windows éŁć&nbsp;źçă\type{\}ăďźäžĺŚ \type{$TEXROOT/texmf} čĄ¨ç¤ş \TeX\ ć&nbsp;šçŽĺ˝çĺ­çŽĺ˝ \type{texmf}ă

äťĽä¸ĺłäş \TEX\ ć&nbsp;šçŽĺ˝çčŽ¨čŽşďźäťéĺŻš \CONTEXT\ ĺźĺčćäžç \CONTEXT\ ĺăĺŻšäş \TEX\ Live čč¨ďźĺŻĺ° \type{texmf-local} çŽĺ˝çä¸çş§çŽĺ˝ä˝ä¸ş \type{$TEXROOT}ă

ä¸ş \ConTeXt\ ĺŽčŁĺŽä˝ďźsimsun.ttcďźăéťä˝ďźsimhei.ttfďźĺćĽˇä˝ďźsimkai.ttfďźçĺˇä˝čżç¨ĺŚä¸ďź

\startitemize[n,packed][stopper=,left=(,right=)]
\item ĺ°ä¸čż°ĺ­ä˝ćäťśĺ¤ĺśĺ° \type{$TEXROOT/texmf-local/fonts/truetype/msfonts} çŽĺ˝ďźčĽčŻĽçŽĺ˝ä¸ĺ­ĺ¨ďźĺčŞčĄĺĺťşďź
\item ć§čĄă\type{context --generate}ăĺ˝äť¤ďźĺˇć° \ConTeXt\ çćäťść°ćŽĺşďź
\item ć§čĄă\type{mtxrun --script fonts --reload --force}ăĺ˝äť¤ďźč˝˝ĺĽć°ćˇťĺ&nbsp;çĺ­ä˝ďź
\stopitemize

ĺ­ä˝ĺŽčŁĺŽćŻĺďźĺŻäťĽéčżćĽčŻ˘ĺ­ä˝ćäťśĺçĄŽčŽ¤ĺ­ä˝ćŻĺŚĺŽčŁćĺďźäžĺŚćĽčŻ˘ simhei.ttfďź

\starttyping
$ mtxrun --script fonts --list --file simhei.ttf
familyname   weight   style    width    variant   fontname   filename     ...
simhei       normal   normal   normal   normal    simhei     simhei.ttf
\stoptyping

\noindent ćĽčŻ˘çťćä¸­ç \type{fontname} ć&nbsp;ĺžéčŚďźĺ&nbsp;ä¸şĺ¨ćçćśďźéĺ¸¸čŚä˝żç¨ĺ­ä˝ĺĺ­ćäťŁćä¸Şĺ­ä˝ăä¸čż°ĺ˝äť¤äšĺŻç¨äşćĽčŻ˘ simkai.ttf çäżĄćŻďźä˝ćŻć&nbsp;ćłç¨äşćĽčŻ˘ TTC ĺ­ä˝ simsun.ttcďźĺŻč˝ćŻĺ&nbsp; TTC ĺ­ä˝ćäťśčžä¸şçšćŽďźä˝ć&nbsp;čŽşĺŚä˝ďźčżćŻ \type{mtxrun} ç \type{fonts} čćŹçä¸ä¸Ş bugďźĺ¸ććĽĺč˝č˘ŤäżŽĺ¤ă

ćĽčŻ˘ simsun.ttc ĺŻšĺşçĺ­ä˝ĺďźĺŻäťĽä˝żç¨äťĽä¸ĺ˝äť¤ďź

\starttyping
$ mtxrun --script fonts --list --all simsun
identifier       familyname   fontname   filename     subfont   instances
nsimsunnormal    nsimsun      nsimsun    simsun.ttc   2
nsimsunregular   nsimsun      nsimsun    simsun.ttc   2
simsun           simsun       simsun     simsun.ttc   1
simsunnormal     simsun       simsun     simsun.ttc   1
simsunregular    simsun       simsun     simsun.ttc   1
\stoptyping

\noindent\type{subfont} ć&nbsp;čĄ¨ć simsun.ttc éĺĺŤäşä¸¤ç§ĺ­ä˝ďźä¸ç§ćŻ \type{simsun}ďźĺŽä˝ďźďźĺŚä¸ç§ćŻ \type{nsimsun}ďźć°ĺŽä˝ďźăć­¤ĺ¤ďźčŻˇĺŻš \type{identifier} ĺ \type{familyname} ć&nbsp;çĽĺ&nbsp;çćďź\in[define-family] čéčŚčżäşäżĄćŻă

éčŚćł¨ćďźä¸čż°čżç¨ĺŽčŁçĺ­ä˝é˝ćŻćçćçďźĺčĽä˝ĺä¸ç¨éďźéčŚĺĺźĺčżäşĺ­ä˝çĺŹĺ¸ćŻäťććč´šç¨ăćŹććĄŁäšćäťĽéćŠä˝żç¨ĺŽäťŹďźä¸ťčŚćŻä¸şäşĺźĺŽšĺ˝ĺĺ¨ććĄŁĺ­ä˝éç¨ä¸çç§Żäš&nbsp;ăç˝çťä¸č˝ĺ¤ćžĺ° Google ĺŹĺ¸ĺźĺçä¸çłťĺĺč´šçćąĺ­ĺ­ä˝ďźäžĺŚ Noto çłťĺďźĺśĺŽčŁćšĺźĺŻĺčä¸čż°čżç¨ďźć&nbsp;éĄťčľčż°ăć­¤ĺ¤ďźčĽĺŽčŁćŠĺąĺä¸şă\type{.otf}ăçĺ­ä˝ďźĺł OpenType ĺ­ä˝ďźĺťşčŽŽĺ°ĺŽäťŹĺŽčŁĺ° \type{$TEXROOT/texmf-local/fonts/opentype} çŽĺ˝ďźčĽć&nbsp;čŻĽçŽĺ˝ďźĺŻčŞčĄĺĺťşă

\section{ĺ­ä˝çĺŽäšä¸ä˝żç¨}

ç¤şäž \in[hello-hanzi] ćźç¤şäşĺŚä˝ĺ¨ć°ććéä¸ş \ConTeXt\ ĺŽäšĺ¤§ĺ°ä¸ş 12 pt çĺŽä˝ďźéťä˝ĺćĽˇä˝ç­ĺ­ä˝ĺć˘ĺ˝äť¤ďźĺšśä˝żç¨ĺŽäťŹĺćçä¸čĄćĺ­ă

\startsample
\startTEXpage[frame=on,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\definefont[heiti][name:simhei at 12pt]
\definefont[kaiti][name:kaiti at 12pt]
\songti ć˝éžĺżç¨ă\\
\heiti č§éžĺ¨ç°ďźĺŠč§ĺ¤§äşşă\\
\kaiti ĺĺ­çťćĽäšžäšžďźĺ¤ćčĽĺďźć&nbsp;ĺă
\stopTEXpage
\stopsample
\sample[option=TEX][hello-hanzi]{ä¸ç§ćąĺ­ĺ­ä˝}{\externalfigure[03/qian.pdf]}

éčŚćł¨ćçćŻďźçŹŹä¸ćŹĄĺ¨ \ConTeXt\ ä¸­ä˝żç¨ć°ĺŽčŁçćąĺ­ĺ­ä˝ďźćşćäťśçźčŻčżç¨äźčžä¸şçźć˘ďźĺ&nbsp;ä¸ş \ConTeXt\ éčŚč§Łćĺ­ä˝ćäťśä¸­çä¸äşçźç&nbsp;äżĄćŻĺšśĺ°č§Łćçťćĺ­ĺ°ĺŽçĺ­ä˝çźĺ­çŽĺ˝ăĺžä¸ä¸ćŹĄä˝żç¨çťčżçźĺ­ĺĺ­ä˝ćśďźçźčŻéĺşŚäžżäźć­Łĺ¸¸ďźĺ&nbsp;ć­¤ä¸ĺşćĽĺĺŽŁĺ¤ \ConTeXt\ ä¸éĺĺ¤çä¸­ćććĄŁăćçčŽĄçŽćş CPU ćŻ \type{Intel i5-4300U @ 1.90GHz}ăčżäť˝ććĄŁĺčłć­¤ĺ¤ďźĺˇ˛ć 20 éĄľĺĺŽšďźĺśćşćäťśĺćŹĄçźčŻćśé´ä¸ĺ° 3 ç§ăććč§ \ConTeXt\ ĺ¤çä¸­ćććĄŁďźĺšśä¸ćŻĺžć˘ďźä˝ćŻĺşĺ˝ćżčŽ¤ďźčŻĺŽćŻćŻĺşäş \pdfTeX ć \XeTeX ç­ĺźćç \TeX\ čŚć˘ä¸äşă

\section[breaking-lines]{ä¸­ćć­čĄ}

ç°ĺ¨ĺ°čŻç¨ĺŽä˝ĺ­ćçä¸ćŽľä¸­ćďźč§ç¤şäž \in[ć&nbsp;ćłć­čĄ]ăçťćčĄ¨ćďźäťäťč˝ĺ¨ \ConTeXt\ ä¸­ä˝żç¨ćąĺ­ĺ­ä˝ćŻä¸ĺ¤çďźĺ&nbsp;ä¸ş \ConTeXt\ ć­¤ĺťĺ°ä¸çĽĺ¨éĺŽĺŽ˝ĺşŚççé˘ĺĺŚä˝ĺŻšćąĺ­čżčĄć­čĄďźäťĽč´ćĺ­čśĺşçé˘ăçŠśĺśĺĺ&nbsp;ďźćŻćąĺ­äšé´ä¸ĺčĽżćĺčŻäťĽçŠşć&nbsp;źä˝ä¸şé´éďźĺ&nbsp;ć­¤ĺ¨ \ConTeXt\ çćĽďźä¸ćŽľćąĺ­ćĺ­ç­ĺäşä¸ä¸ŞĺžéżçčĽżćĺčŻďźćŻä¸ä¸Şć&nbsp;ćłĺéçĺĺă

\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
ć˝éžĺżç¨ăč§éžĺ¨ç°ďźĺŠč§ĺ¤§äşşă%
ĺĺ­çťćĽäšžäšžďźĺ¤ćčĽĺďźć&nbsp;ĺă
\stopTEXpage
\stopsample
\sample[option=TEX][ć&nbsp;ćłć­čĄ]{ä¸­ććŽľč˝ć&nbsp;ćłć­čĄ}{\externalfigure[03/breakinglines-1.pdf]}

éčŚćł¨ćç¤şäž \in[ć&nbsp;ćłć­čĄ] ä¸­çćł¨éçŹŚçç¨ćłăč˝çśćł¨éĺĺŽšä¸şçŠşďźä˝ćł¨éçŹŚĺŻäť¤ \TeX\ ĺźćĺż˝çĽĺśĺçććçŠşç˝ĺ­çŹŚďźĺćŹć˘čĄçŹŚďźăĺčĽĺ°čŻĽç¤şäžä¸­çćł¨éçŹŚĺťćďźçŹŹä¸čĄćąĺ­ĺçŹŹäşčĄćąĺ­äšé´çć˘čĄçŹŚäźč˘Ť \TeX\ ĺźćč§ä¸şçŠşç˝ĺ­çŹŚďźäťččŽŠ \ConTeXt\ č§ĺžďźĺŽé˘ĺŻšçćŻä¸¤ä¸ŞčžéżçĺčŻďźĺŽäťŹäšé´ĺŻäťĽć­čĄďźçťćč§ç¤şäž \in[ĺ°éĺ°ąé]ďźĺŻäťĽć­čĄďźä˝ĺąäşčŻŻćčŻŻćă

\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
ć˝éžĺżç¨ăč§éžĺ¨ç°ďźĺŠč§ĺ¤§äşşă
ĺĺ­çťćĽäšžäšžďźĺ¤ćčĽĺďźć&nbsp;ĺă
\stopTEXpage
\stopsample
\sample[option=TEX][ĺ°éĺ°ąé]{ä¸­ććŽľč˝ć&nbsp;ćłć­čĄ}{\externalfigure[03/breakinglines-2.pdf]}

ç°ĺ¨ďźćäťŹĺŻäťĽçľćşä¸ĺ¨ďźć˘çść˘čĄçŹŚč˘Ť \TeX\ ĺźćč§ä¸şçŠşç˝ĺ­çŹŚäťčä˝żĺž \ConTeXt\ čŻŻćčŻŻćĺŻšćąĺ­čżčĄäşä¸ćŹĄć­čĄďźéŁäšĺčĽĺ¨ćąĺ­äšé´ćĺˇĽćĺĽçŠşć&nbsp;źĺ­çŹŚďź\ConTeXt\ č˝ĺŚĺŽç°ćąĺ­ć­čĄĺ˘ďźç­ćĄćŻďźĺŻčĄďźč§ćşććĄŁćžç°äşçŠşć&nbsp;źĺ­çŹŚďźäťĽ \type[space=on]{ } čĄ¨ç¤şďźçç¤şäž \in[ćĺˇĽć­čĄ]ďźĺŞćŻçŠşć&nbsp;źçĺ­ĺ¨ďźĺŻźč´ćççťćä¸­çćąĺ­ĺĺ¸čžä¸şčŹćžă

\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\songti
ć˝ éž ĺż ç¨ă č§ éž ĺ¨ ç°ďź ĺŠ č§ ĺ¤§ äşşă
ĺ ĺ­ çť ćĽ äšž äšžďź ĺ¤ ć čĽ ĺďź ć&nbsp; ĺă
\stopTEXpage
\stopsample
\sample[option=TEX,space=on][ćĺˇĽć­čĄ]{ä¸­ććŽľč˝ćĺˇĽćĺĽçŠşć&nbsp;źčżčĄć­čĄ}{\externalfigure[03/breakinglines-3.pdf]}

ä˝äş \ConTeXt\ ĺşĺąç \TeX\ çłťçťćäžäşç˛čżďźGlueďźćşĺśďźćäťŹĺŻäťĽç¨ĺŽĺŽäšçťĺŽĺŽ˝ĺşŚä¸ćäşčŽ¸ĺźšć§ççŠşć&nbsp;źăäžĺŚďźĺŽäšä¸ä¸ŞĺŽ˝ĺşŚä¸ş 0ďźćĺ¤§ĺŻäź¸ĺą 2 pt ä¸ä¸ĺŻćśçźŠçç˛čżďź

\starttyping[option=TEX]
\def\foo{\hskip 0pt plus 2pt minus 0pt}
\stoptyping

\noindent çśĺç¨čŻĽç˛čżäťŁćżçŠşć&nbsp;źďźćĺĽĺ°ćąĺ­äšé´ďźäžżĺşćŹĺŻĺŽç°ćąĺ­ć­čĄďźçťćč§ç¤şäž \in[ćĺˇĽćĺĽç˛čżć­čĄ]ďźéčŚćł¨ćçćŻďź\TeX\ äźčŞĺ¨ĺż˝çĽćçĺ˝äť¤äšĺĺ°žéççŠşć&nbsp;źďźĺ&nbsp;ć­¤ \type{\foo} äšĺč˝çśćä¸ä¸ŞçŠşć&nbsp;źďźä˝čŻĽçŠşć&nbsp;źä¸äźĺ¨ćççťćéĺşç°ă

\startsample
\startTEXpage[frame=on,width=5cm,offset=4pt]
\definefont[songti][name:simsun at 12pt]
\def\foo{\hskip 0pt plus 2pt minus 0pt}
\songti
ć˝\foo éž\foo ĺż\foo ç¨ă%
\foo č§\foo éž\foo ĺ¨\foo ç°ďź\foo ĺŠ\foo č§%
\foo ĺ¤§\foo äşşă%
\foo ĺ\foo ĺ­\foo çť\foo ćĽ\foo äšž\foo äšžďź%
\foo ĺ¤\foo ć\foo čĽ\foo ĺďź\foo ć&nbsp;\foo ĺă
\stopTEXpage
\stopsample
\sample[option=TEX,space=on][ćĺˇĽćĺĽç˛čżć­čĄ]{ä¸­ććŽľč˝ćĺˇĽćĺĽç˛čżčżčĄć­čĄ}{\externalfigure[03/breakinglines-4.pdf]}

çąäşć˛Ąćäşşćżćĺç¤şäž \in[ćĺˇĽćĺĽç˛čżć­čĄ] éŁć&nbsp;ˇćçćąĺ­ďźĺ&nbsp;ć­¤ \ConTeXt\ ćäžäşä¸ä¸ŞĺŻäťĽčŞĺ¨ĺ¨ćąĺ­äšé´ćĺĽç˛čżçĺ˝äť¤ďźĺł

\starttyping[option=TEX]
\setscript[hanzi]
\stoptyping

\noindent ä¸čż°čżç¨ĺ¤§č´šĺ¨çŤ&nbsp;ďźäťäťćŻčŽŠä˝&nbsp;ćç˝ \type{\setscript[hanzi]} çĺçăć­¤ĺ¤ďźä˝&nbsp;çčłĺ­ŚäźäşĺŚä˝ĺŽäšä¸ä¸Ş \TeX\ ĺŽďźĺł \type{\foo}ďźäťčéżĺäşĺä¸é˘čżć&nbsp;ˇčžĺĽçšççćçĺ˝äť¤ďź

\starttyping[option=TEX]
ć˝\hskip 0pt plus 2pt minus 0pt éž\hskip 0pt plus 2pt minus 0pt ĺżâŚâŚ
\stoptyping

\noindent ĺčĽä˝&nbsp;ćéżĺŽäšä˝&nbsp;ćéčŚç \TeX\ ĺŽďźäžżĺŻäťĽčŞĺˇąĺé&nbsp;ä¸ä¸ŞĺŻä¸ \ConTeXt\ ĺŞ˛çžçĺŽĺăç°ĺ¨ďźĺˇ˛çťééçĽéäş\ConTeXt\ çä¸äşçç¸äşĺ§ă

\section{ĺä¸ĺ°çć­ŁçäżĄ}

\startsample
\startTEXpage[frame=on,width=6cm,offset=6pt]
\definefont[songti][name:simsun at 10.5pt]
\setscript[hanzi] % ä¸­ćć­čĄćŻć
\songti
\setupindenting[always,first,2em]
\setupinterlinespace[1.5]
\noindent äş˛çąçćĺďź\par
ä˝&nbsp;äťŹĺĽ˝ĺďź\par
ç°ĺ¨ĺˇĽä˝ĺžĺżĺ§ďźčşŤä˝ĺĽ˝ĺďźćç°ĺ¨äşćĺąąćşĺĽ˝çă
č˝çśćĺžĺ°ĺäżĄďźĺśĺŽćĺžćĺżľčąćĺąąă\par
äşçžĺš´ĺçćĽčďźćä¸ĺŽĺĺąąă
ĺĽ˝äşďźĺĺĺ°čżĺ§ă\par
ć­¤č´\par
\noindent ćŹç¤ź\par
\rightaligned{ĺ­ćçŠş}
\rightaligned{2035.10.1}
\stopTEXpage
\stopsample
\sample[option=TEX][ĺ­ćçŠşçäżĄ]{ĺ­ćçŠşçäżĄ}{\externalfigure[03/breakinglines-5.pdf]}

äťç°ĺ¨ĺźĺ§ďźĺ¨ćäžç¤şäžćśďźä¸şäşčççŻĺšďźćććśäźççĽä¸é¨ĺçťĺ¸¸éĺ¤ä˝żç¨çäťŁç&nbsp;ďźäťçťĺşĺłéŽäťŁç&nbsp;äťĽçŞĺşéçšďźĺ¨ćĺ´č´ĺ¨ćčŻéŞčżäşäťŁç&nbsp;ćśďźéčŚä˝&nbsp;čŞĺˇąĺ¨ććˇťĺ&nbsp;č˘ŤççĽçäťŁç&nbsp;ă

\section{ĺ­ć}

ĺŚĺćäťŹäš&nbsp;ćŻäşĺ°ćąĺ­ĺä¸şčŽ¸ĺ¤äšŚä˝ďźčŻ¸ĺŚĺ¸¸ç¨çĺŽä˝ăćĽˇä˝ăäťżĺŽăéśäšŚăĺšźĺăéťä˝ç­ďźčĽżćšäşşĺŻšäťäťŹçĺ­ä˝äšćŻćçä¸ĺĽĺçąťä˝çłťă\TeX\ çłťçťĺćŹćŻéĺŻščĽżćšćĺ­ćçččŽžčŽĄĺĺźĺçďźĺ&nbsp;ć­¤ćäťŹéčŚĺäşč§ŁčĽżćšäşşĺŻšĺ­ä˝çĺçąťďźçśĺĺ°ćąĺ­ĺ­ä˝ćčŞĺˇąçéčŚä¸äšç¸ĺşă

ĺĺżä¸ä¸ďźĺ¨ĺ­ŚäźĺŽčŁĺä˝żç¨ćąĺ­ĺ­ä˝äšĺďźç¨ \ConTeXt\ ćçčąćĺĺŽšďźćäťŹĺšśćŞčŽžç˝Žäťťä˝čĽżćĺ­ä˝ďź\ConTeXt\ äžçśč˝ĺŽććçăčżćĺłç \ConTeXt\ ĺˇ˛çťä¸şç¨ćˇĺŽäšäşä¸ĺĽčĽżćĺ­ä˝ďźä¸ĺ¨ćççŻĺ˘ä¸­éťčŽ¤ĺŻç¨äşăčżĺĽĺ­ä˝çąĺĺ¤ç§ĺ­ä˝çťćďźçťç§°ä¸ş Computer Modern RomanďźçŽç§° cmrďźĺ­ä˝ďźĺŻĺä¸şĺćďźčĄŹçşżďźSerifďźăć&nbsp;čĄŹçşżďźSans Serifďźăç­ĺŽ˝ďźMonospaceďźäťĽĺć°ĺ­Śăĺä¸ä¸Şĺ­ćĺşćŹä¸ĺĺĺŤçťĺä¸şć­Łä˝ďźRegular ć Normalďźăç˛ä˝ďźBoldďźăćä˝ďźItalicďźĺç˛ćä˝ďźBoldItalicďźă

\ConTeXt\ éťčŽ¤ĺŻç¨çć­Łćĺ­ä˝ćŻčĄŹçşżĺ­ćä¸­çć­Łä˝ă\type{\rm}ďź\type{\ss} ĺ \type{\tt} ĺŻĺĺŤç¨äşĺ°ĺ­ä˝ĺć˘ä¸şčĄŹçşżăć&nbsp;čĄŹçşżĺç­ĺŽ˝ĺ­ćçć­Łä˝ă\type{\tf}ďź\type{\bf}ďź\type{\it} ĺ {\type{\bi}} ĺŻĺĺŤç¨äşĺć˘ćŻä¸Şĺ­ćä¸­çć­Łä˝ăç˛ä˝ăćä˝ĺç˛ćä˝ç­ĺ­ä˝ăç¤şäž \in[éťčŽ¤ĺ­ä˝] ćźç¤şäşĺŚä˝ĺć˘ĺç§ĺ­ä˝äťĽĺ \type{{...}} çç¨ćłăĺ¨éťčŽ¤ćĺľä¸ďź\TeX\ ĺźćĺ°ä¸ĺŻščąćŹĺˇćĺĺŤçĺĺŽšč§ä¸şä¸ä¸Şć´ä˝ďź\TeX\ ćŻčŻ­ç§°äšä¸şçźçťďźGroupďźăçźçťĺé¨çćçĺ˝äť¤ä¸äźĺŻšçźçťĺ¤é¨äş§çäťťä˝ĺ˝ąĺďźä˝çźçťĺ¤é¨çćçĺ˝äť¤äźĺ˝ąĺçźçťĺé¨ă

\startsample
% čĄŹçşżĺ­ä˝
Hello. {\bf Hello.}
{\it Hello.} {\bi Hello.}\\
% ć&nbsp;čĄŹçşżĺ­ä˝
\ss Hello. {\bf Hello.}
{\it Hello.} {\bi Hello.}\\
% ç­ĺŽ˝ĺ­ä˝
\tt Hello. {\bf Hello.}
{\it Hello.} {\bi Hello.}\\
% ĺ°ĺ­ä˝ĺć˘ä¸şčĄŹçşżĺ­ä˝
\rm
% ć°ĺ­Śĺ­ä˝
Math in text mode: $\int_a^b f(x)dx$\\
Math in display mode:
\startformula
\int_a^b f(x)dx
\stopformula
\stopsample
\sample[option=TEX][éťčŽ¤ĺ­ä˝]{\ConTeXt\ éťčŽ¤ĺ­ä˝}{\externalfigure[03/defaultfonts.pdf]}

\ConTeXt\ éťčŽ¤ć­Łćĺ­ä˝çĺ¤§ĺ°ä¸ş 12 ptďźĺšśäťĽčŻĽĺ°şĺŻ¸ä¸şĺşĺďźĺŽäšäş 6 ç§ä¸ĺçş§ĺŤçĺ­ä˝ĺ°şĺŻ¸ďźäťĺ°ĺ°ĺ¤§äžĺşä¸şďź\type{xx}ďź\type{x}ďź\type{a}ďź\type{b}ďź\type{c}ďź\type{d}ă\type{x} çş§ćŻć­Łćĺ­ä˝ĺ°ďź\type{a} çş§ćŻć­Łćĺ­ä˝ĺ¤§ăç¤şäž \in[fontsize-level] ćźç¤şäşć&nbsp;čĄŹçşżĺ­ćçć­Łä˝ĺ­ä˝ 7 ç§ĺ¤§ĺ°çş§ĺŤçĺć˘ă

\startsample
\ss {\tfxx A} {\tfx A} A or {\tf A}
{\tfa A} {\tfb A} {\tfc A} {\tfd A}
\stopsample
\sample[option=TEX][fontsize-level]{ĺ­ä˝ĺ¤§ĺ°ç 7 ç§çş§ĺŤ}{\externalfigure[03/fontsize-level.pdf]}

ć­¤ĺ¤ďźčżéčŚćł¨ćçćŻďźĺ°şĺŻ¸ĺä˝ em çĺŤäšăäšĺćĺŻšĺŽçťĺşč§ŁéćŻĺ­ćŻ \type{M} ĺŽ˝ĺşŚďźć°ĺĽ˝ç­äş 1 ä¸Şćąĺ­çĺŽ˝ĺşŚďźčżćŻéĺŻšĺ˝ĺćçĺ­ä˝çŻĺ˘čč¨çăäžĺŚďźĺ¨ç¤şäž \in[em-1] ĺ \in[em-2] ä¸­ďźćŽľč˝éŚčĄçźŠčżčŽžĺŽĺ˝äť¤ĺşç°çä˝ç˝Žä¸ĺďźĺŻźč´ćŽľč˝çźŠčżčˇçŚťäş§çäşĺˇŽĺźăčżćŻĺ&nbsp;ä¸şďźĺ¨ç¤şäž \in[em-1] ä¸­ďźčŽžĺŽćŽľč˝éŚčĄçźŠčżćśďźem çĺźćŻĺşäş \ConTeXt\ éťčŽ¤çć­Łćĺ­ä˝ĺ°şĺŻ¸çĄŽĺŽçďźĺśĺźä¸ş 12 ptďźčĺ¨ ç¤şäž \in[em-1] ä¸­ďźem çĺźćŻĺşäşćäťŹčŞĺŽäšçĺ­ä˝ \type{\songti} çĺ°şĺŻ¸çĄŽĺŽçďźĺśĺźä¸ş 9 ptă

\startsample
\setscript[hanzi]
\definefont[songti][name:simsun at 9pt]
\setupindenting[always,first,2em]
\songti
ćç°ĺ¨äşćĺąąćşĺĽ˝çă
č˝çśćĺžĺ°ĺäżĄďźĺśĺŽćĺžćĺżľčąćĺąąă
\stopsample
\sample[option=TEX][em-1]{ćŽľč˝çźŠčżčˇçŚťćŻ 24 pt}{\externalfigure[03/indenting-1.pdf]}

\startsample
\setscript[hanzi]
\definefont[songti][name:simsun at 9pt]
\songti
\setupindenting[always,first,2em]
ćç°ĺ¨äşćĺąąćşĺĽ˝çă
č˝çśćĺžĺ°ĺäżĄďźĺśĺŽćĺžćĺżľčąćĺąąă
\stopsample
\sample[option=TEX][em-2]{ćŽľč˝çźŠčżčˇçŚťćŻ 18 pt}{\externalfigure[03/indenting-2.pdf]}

\section[define-family]{ĺŽäšćąĺ­ĺ­ć}

ä˝żç¨ \type{\definefontfamily} ĺŻĺ°ä˝&nbsp;ĺćŹ˘çä¸äşćąĺ­ĺ­ä˝ĺŽäšä¸şĺ­ćďźç¨äťĽäťŁćż \ConTeXt\ çéťčŽ¤ĺ­ćďźçśĺä˝żç¨ \type{\setupbodyfont} ĺŻç¨ä˝&nbsp;ĺŽäšçĺ­ćăç¤şäž \in[setupbodyfont] ĺ° 10.5 pt çĺŽä˝ä˝ä¸şć­ŁćéťčŽ¤ĺ­ä˝\footnote{10.5 pt ĺŻĺŻšĺş MicroSoft Word ä¸­çäşĺˇĺ­ă}ăćł¨ćďźĺ­ćçĺŽäšĺĺŻç¨ďźéĺ¨ć°ććäšĺ¤čżčĄďźĺŚĺć&nbsp;ćăä¸čżďź\type{\setupindenting} ĺ´ĺŞč˝ĺ¨ć°ććäšĺčľˇćďźčżčŽŠććäşä¸č§Łďźä˝ćŻčżĺ°ąćŻć°ććçč§çŠďźĺŞč˝ćĽĺă

\startsample
\definefontfamily[myfonts][rm][nsimsun]
\setupbodyfont[myfonts,10.5pt]
\setscript[hanzi]
\startTEXpage[frame=on,width=6cm,offset=6pt]
\setupindenting[always,first,2em]
ćç°ĺ¨äşćĺąąćşĺĽ˝çă
č˝çśćĺžĺ°ĺäżĄďźĺśĺŽćĺžćĺżľčąćĺąąă
\stopTEXpage
\stopsample
\sample[option=TEX][setupbodyfont]{ĺŽäšć­Łćĺ­ä˝ĺšśĺŻç¨}{\externalfigure[03/setupbodyfont.pdf]}

ç¤şäž \in[setupbodyfont] äťĺŽäšäş \type{myfonts} çčĄŹçşżĺ­ćďź\type{rm}ďźä¸ş \type{nsimsun}ďźä¸éčŚćł¨ćçćŻďźć­¤ĺ¤ç \type{nsimsun} ĺšśéĺ­ä˝ĺďźčćŻĺ­ćĺăĺ¨ \in[fonts-installation] čä¸­ďźĺ° simsun.ttc ĺŽčŁčł \ConTeXt\ çŻĺ˘äšĺďźćäťŹćžćĽčŻ˘čżĺŽçç¸ĺłäżĄćŻďźĺśä¸­ćä¸ć&nbsp;äżĄćŻćŻ \type{familyname}ďźĺśä¸­ç˝ĺçäžżćŻĺ­ä˝ćĺąçĺ­ćĺă\ConTeXt\ äźć&nbsp;šćŽĺ­ćĺčŞĺ¨ćç´˘ĺ­ä˝ç \type{identifier} äżĄćŻďźčĽćĺ­ä˝ďźĺś identifier çćŤĺ°žćŻ \type{regular} ć \type{normal}\footnote{identifier ĺçćŤĺ°žä¸ş regular ĺ normal çĺ­ä˝éĺ¸¸ćŻĺä¸ä¸Şĺ­ä˝ă}ďźĺčŻĽĺ­ä˝äźč˘Ť \ConTeXt\ čŞĺ¨ä˝ä¸şčŻĽĺ­ä˝ćĺąĺ­ćçć­Łä˝ăĺçďźčĽćĺ­ä˝ç identifier çćŤĺ°žćŻ \type{bold}ďź\type{italic} ć \type{bolditalic}ďźĺčŻĽĺ­ä˝äźč˘Ť \ConTeXt\ čŞĺ¨ä˝ä¸şčŻĽĺ­ä˝ćĺąĺ­ćçç˛ä˝ăćä˝ćç˛ćä˝ă

çąäşćäťŹç \ConTeXt\ çŻĺ˘éç \type{nsimsun} ĺ­ćĺŞćć­Łä˝ \type{nsimsunregular}ďźć˛Ąćĺśäťĺ­ä˝ďźĺ&nbsp;ć­¤ĺčĽĺ¨ç¤şäž \in[setupbodyfont] ä¸­ďźä˝żç¨ \type{\bf} ĺć˘ĺ­ä˝ćśďźĺł

\starttyping[option=TEX]
\bf ćç°ĺ¨äşćĺąąćşĺĽ˝çă
č˝çśćĺžĺ°ĺäżĄďźĺśĺŽćĺžćĺżľčąćĺąąă
\stoptyping

\noindent \ConTeXt\ äźĺ&nbsp;ćžä¸ĺ°ç¸ĺşçĺ­ä˝čćĺşçŠşéĄľăčĽčŚč§ŁĺłčŻĽéŽé˘ďźéčŚä˝żç¨ \type{\definefontfamily} ççŹŹĺä¸Şĺć°ďźéčżĺ­ä˝ĺćĺŽĺśäťĺ­ä˝äťĽčĄĽĺĺ­ćçźşĺ¤ąçĺ­ä˝ăäžĺŚďźĺŻäťĽä˝żç¨éťä˝ĺćĽˇä˝ä˝ä¸şćĽčĄĽĺ \type{nsimsun} ĺ­ćççźşĺ¤ąĺ­ä˝ďź

\starttyping[option=TEX]
\definefontfamily[myfonts][rm][nsimsun][bf=simhei,it=kaiti,bi=simhei]
\stoptyping

ĺçďźäšĺŻäťĽç¨ĺŽä˝ďźéťä˝ĺćĽˇä˝ĺŽäšéčĄŹçşżĺç­ĺŽ˝ĺ­ćďź

\starttyping[option=TEX]
\definefontfamily[myfonts][ss][simhei][bf=simhei,it=simhei,bi=simhei]
\definefontfamily[myfonts][tt][kaiti][bf=simhei,it=kaiti,bi=simhei]
\stoptyping

ä¸şćąĺ­ĺŽäšĺ­ćčżćä¸ç§äź&nbsp;çťćšćłďźä˝żç¨ \ConTeXt\ ç typescript ćşĺśďźä˝ćŻéčŚĺčŽ¸ĺ¤äťŁç&nbsp;ďźä˝äťĽĺĺŞćčżä¸ç§ćšćłăç°ĺ¨ćäťŹĺŻäťĽĺŻšĺŽčŻ´ďźĺč§ďźtypescriptďź

\section[fallback-fonts]{ĺ­ĺ˝˘ćżć˘}

äščŽ¸ä˝&nbsp;ç°ĺ¨č§ĺžčŞĺˇąĺ¨ć°ććéĺˇ˛çťčąčć˘éŞ¨ďźĺŻäťĽćŹçĺć°äşďźĺ&nbsp;ä¸şä˝&nbsp;ĺˇ˛çťč˝ĺ¤čŞçąĺ°ĺ¨ \ConTeXt\ ä¸çéä˝żç¨ćąĺ­ăćŻçďźä˝&nbsp;ĺŻäťĽĺŚć­¤č§ĺžďźĺŞčŚä˝&nbsp;çćçĺĺŽšć˛ĄćčĽżćšćĺ­ă

ćçĺĺŽšéćčĽżćšćĺ­äźćć&nbsp;ˇçďźĺž \in[bad-latin] çťĺşäşééĄšďźĺ¨ćççťćä¸­ďźćŻä¸é˘éŁčĄćĺ­éçčąćĺčŻçžč§ďźčżćŻä¸é˘éŁčĄďźĺčćŻ simsun.ttc ä¸­çčĽżćĺ­ĺ˝˘ďźĺčćŻ \ConTeXt\ éťčŽ¤ç cmr ĺ­ä˝éçčĄŹçşżć­Łä˝ä¸­çčĽżćĺ­ĺ˝˘ăčĽä˝&nbsp;éćŠĺčďźĺćŹčĺĺŽšĺŻčłć­¤ĺŽĺ¨ĺż˝çĽďźĺŚĺčŻˇçť§çť­éčŻťă

\placefigure
  [here,force][bad-latin]
  {čąćĺ­ĺ˝˘ćŻčž}
  {\externalfigure[03/bad-latin.pdf][width=.4\textwidth]}

\type{\definefallbackfamily} ĺŻç¨ä¸ç§ĺ­ä˝ä¸­çé¨ĺĺ­ĺ˝˘ćżć˘ĺŚä¸ç§ĺ­ä˝çç¸ĺşĺ­ĺ˝˘ăç¤şäž \in[fallbacks] ä˝żç¨ latinmodernroman ĺ­ćéçćŻç§ĺ­ä˝ç Unicode ç&nbsp;ä˝ĺşé´ $[0\mathrm{x}0000, 0\mathrm{x}0400]$ ä¸­çććĺ­ĺ˝˘ĺźşčĄćżć˘ nsimsun ĺ­ćä¸­ćŻç§ĺ­ä˝ďźĺćŹćżčĄĽĺ­ä˝ďźçç¸ĺşĺ­ĺ˝˘ăäšĺŻäťĽä˝żç¨ \ConTeXt\ ĺˇ˛çťĺŽäšäşĺĺ­ç Unicode ç&nbsp;ä˝ĺşé´äťŁćż 16 čżĺść°ĺ­ĺ˝˘ĺźçĺşé´ăäžĺŚďź

\starttyping[option=TEX]
\definefallbackfamily[myfonts][rm][latinmodernroman]
                     [range={basiclatin,latinsupplement},force=yes]
\stoptyping

\noindent ćĺŽäş Unicode ç&nbsp;ä˝ĺşé´ $\mathrm{[0x0000, 0x00FF]}$ ä¸­çĺ­ĺ˝˘ä˝ä¸şćżć˘ĺ­ĺ˝˘ăUnicode ç&nbsp;ä˝ĺşé´çĺĺ­č§ććĄŁăList of Unicode blocksă\cite[unicode-blocks]ă

\startsample
\definefallbackfamily
  [myfonts][rm][latinmodernroman]
  [range={0x0000-0x0400},force=yes]
\definefontfamily
  [myfonts][rm][nsimsun]
  [bf=simhei,it=kaiti,bi=simhei]
\setupbodyfont[myfonts,16pt]
\setscript[hanzi]
\startTEXpage[frame=on,offset=4pt]
çąĺ&nbsp;ćŻĺŚ Einstein\\ \bf çąĺ&nbsp;ćŻĺŚ Einstein\\
\it çąĺ&nbsp;ćŻĺŚ Einstein\\ \bi çąĺ&nbsp;ćŻĺŚ Einstein
\stopTEXpage
\stopsample
\sample[option=TEX][fallbacks]{ĺ­ĺ˝˘ćżć˘}{\externalfigure[03/fallbacks.pdf]}

\section{ĺ°çť}

ĺ˝ä˝&nbsp;čŻťĺ°ć­¤ĺ¤ďźććłććĺčŻä˝&nbsp;ďź\ConTeXt\ éćéžççĽčŻďźä˝&nbsp;ĺˇ˛ĺşćŹććĄăç°ĺ¨ďźä˝&nbsp;ĺŽĺ¨ĺŻäťĽĺ¨ć°ććçćĽĺ¤ŠéćŹçĺć°äşă

čżé¨ĺçĽčŻćĺ¤éžĺ˘ďźéžĺ° Hans Hagen éčŚä¸şäšć°ĺä¸ćŹéżčžž 228 éĄľçćĺďźčĽćĺ´čśŁďźä¸ĺŚ¨ćčŻťăćĺŻäťĽĺžčŻĺŽĺ°čŻ´ďźčŻĽćĺćĺŞčŻťčżĺŻĽĺŻĽć°éĄľăçąäşä˝&nbsp;ĺˇ˛çťĺŽčŁäş \ConTeXtďźčżäť˝ćĺĺ°ąĺ¨ä˝&nbsp;ç \ConTeXt\ çŻĺ˘éďźć§čĄäťĽä¸ĺ˝äť¤ĺŻäťĽćžĺ°ĺŽďź

\starttyping
$ mtxrun --script base --find-file fonts-mkiv.pdf
\stoptyping

\noindent čŻˇéĄşäžżćľč§ä¸çŞčżäť˝ćĺćĺ¨ççŽĺ˝éçĺśäť PDF ćäťśĺ§ă
</pre></body></html>