<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{éčŚ zhfonts ĺďź}

ĺşäşçŹŹ \in[chinese-fonts] çŤ&nbsp;äťçťçćąĺ­ĺ­ä˝çčŽžĺŽćšćłďźä˝żç¨ \CONTEXT\ čśłäťĽćçä¸­ćććĄŁďźä˝ćŻĺ­ĺ¨ćąĺ­ć&nbsp;çšçŹŚĺˇçé´čˇčżĺ¤§ä¸ć&nbsp;ćłä¸ć­ŁćĺˇŚĺłčžšçĺŻšé˝ç­éŽé˘ăčĽä˝&nbsp;ĺŻšć­¤ć&nbsp;ćłĺżĺďźĺŻäťĽččä˝żç¨ćĺç zhfonts ć¨ĄĺďźĺŚĺ¤čŻĽć¨ĄĺćžčçŽĺäşä¸­ćĺ­ä˝çčŽžĺŽă

\section{zhfonts ĺĺ°čąĄ}

ć&nbsp;šćŽç°ĺ¨ä˝&nbsp;ĺˇ˛çťććĄç \CONTEXT\ çĽčŻďźçč§ŁäťĽä¸äťŁç&nbsp;ďźćłĺżĺˇ˛ä¸ĺ¨čŻä¸ďź

\starttyping[option=TEX]
\definefallbackfamily
  [foo][rm][latinmodernroman][range={0x0000-0x0400},force=yes]
\definefontfamily[myfonts][rm][nsimsun][bf=simhei,it=kaiti,bi=simhei]
\setscript[hanzi]
\setupbodyfont[foo,12pt]
\setuppapersize[S4]
\setuplayout[width=middle]
\showglyphs  % ćžç¤şĺ­ĺ˝˘čžšçç
\starttext
ĺ°çĽä¸ĺĺ¤§çĽďźĺ°ĺš´ä¸ĺĺ¤§ĺš´ăĺĽäťĽçĽĺśçśäšďźćčä¸çĽćŚćďźčŞčä¸çĽćĽç§ďźć­¤ĺ°ĺš´äšăćĽäšĺćĺĽçľčďźäťĽäşçžĺ˛ä¸şćĽďźäşçžĺ˛ä¸şç§ďźä¸ĺ¤ćĺ¤§ć¤żčďźäťĽĺŤĺĺ˛ä¸şćĽďźĺŤĺĺ˛ä¸şç§ďźć­¤ĺ¤§ĺš´äšăčĺ˝­çĽäšäťäťĽäšçšéťďźäźäşşĺšäšďźä¸äşŚć˛äšďźćą¤äšéŽćŁäšćŻĺˇ˛ăçŠˇĺäšĺďźćĺĽćľˇčďźĺ¤Šćą&nbsp;äšăćéąźçďźĺśĺšżć°ĺéďźćŞćçĽĺśäżŽčďźĺśĺä¸şé˛˛ăćé¸çďźĺśĺä¸şéšďźččĽćł°ĺąąďźçżźčĽĺĺ¤Šäšäşďźććśćçžč§čä¸čäšä¸éďźçťäşć°ďźč´éĺ¤Šďźçśĺĺžĺďźä¸éĺĺĽäšăćĽé´łçŹäšć°ďźâĺ˝źä¸ĺĽéäšďźćčžčˇčä¸ďźä¸čżć°äťčä¸ďźçżąçżčŹčżäšé´ďźć­¤äşŚéŁäščłäšăčĺ˝źä¸ĺĽéäšďźâć­¤ĺ°ĺ¤§äščžŠäšă
\stoptext
\stoptyping
\noindent ĺŻšĺşçćççťćĺŚĺž \in[none-zhfonts] ćç¤şă

čĽä˝żç¨ zhfonts ć¨Ąĺďźĺä¸čż°ç¤şäžĺŻćšĺä¸ş

\starttyping[option=TEX]
\usemodule[zhfonts][size=12pt]
\setuppapersize[S4]
\setuplayout[width=middle]
\showglyphs  % ćžç¤şĺ­ĺ˝˘čžšçç
\starttext
ĺ°çĽä¸ĺĺ¤§çĽďźĺ°ĺš´ä¸ĺĺ¤§ĺš´ [... ççĽĺžĺ¤ĺ­ ...] ć­¤ĺ°ĺ¤§äščžŠäšă
\stoptext
\stoptyping
\noindent ĺŻšĺşçćççťćĺŚĺž \in[zhfonts] ćç¤şă

čĽčŽ¤çĺŻšćŻĺž \in[none-zhfonts] ĺĺž \in[zhfonts] ä¸­çć&nbsp;çšçŹŚĺˇçćççťćďźĺä¸éžĺç° zhfonts ć¨Ąĺč§ŁĺłçéŽé˘ćŻć&nbsp;çšé´čˇĺžŽč°ă

\placefigure[here][none-zhfonts]{ćŞä˝żç¨ zhfonts çä¸­ćć&nbsp;çšćçćć}{%
  \clip[width=\textwidth,height=5cm,voffset=1.8cm]{%
    \externalfigure[zhfonts/none-zhfonts.pdf][width=\textwidth]}}
\placefigure[here][zhfonts]{ä˝żç¨ zhfonts çä¸­ćć&nbsp;çšćççťć}{%
  \clip[width=\textwidth,height=4.25cm,voffset=1.8cm]{%
    \externalfigure[zhfonts/zhfonts.pdf][width=\textwidth]}}

\section{ĺŽčŁ zhfonts}

\useURL[zhfonts][https://github.com/liyanrui/zhfonts/archive/refs/heads/master.zip]
ä¸č˝˝ zhfonts-master.zip ĺďźç˝çťéžćĽä¸ş\\
\blueframed{\from[zhfonts]}\\
č§ŁĺĺĺŻĺžçŽĺ˝ zhfonts-masterďźĺ°ĺść´ĺä¸ş zhfonts ĺšśç§ťĺ¨čł
\starttyping
$TEXROOT/texmf-local/tex/context/third
\stoptyping
\noindent čĽć&nbsp;čŻĽçŽĺ˝\footnote{\type{$TEXROOT} çĺŤäščŻŚč§ \in[fonts-installation] čă}ďźĺŻčŞčĄĺĺťşă

çśĺć§čĄäťĽä¸ĺ˝äť¤ĺˇć° \CONTEXT\ ćäťśçłťçťďź

\starttyping
$ context --generate
\stoptyping

\noindent äťĽä˝ż \CONTEXT\ č˝ĺ¤éčż \type{\usemodule[zhfonts]} ćç´˘ĺšśĺ&nbsp;č˝˝ zhfonts ć¨Ąĺçç¸ĺłćäťśă

zhfonts ć¨ĄĺéťčŽ¤ä˝żç¨ simsun.ttcďźsimhei.ttfďźsimkai.ttf čżä¸ćŹžćąĺ­ĺ­ä˝ââćłĺżä˝&nbsp;ćŠĺˇ˛ćç§ \in[fonts-installation] čçäťçťĺŽčŁäşĺŽäťŹââďźčĽżćĺ­ä˝éťčŽ¤ä˝żç¨é \CONTEXT\ ĺčĄç Latin Modern çłťĺĺ­ä˝ă

\section{ĺşćŹç¨ćł}

zhfonts éťčŽ¤ä˝żç¨ 11 pt ć­Łä˝ĺ­ďźĺŽä˝ + Latin Modern Serifďźä˝ä¸şć­Łćĺ­ä˝ďź

\starttyping[option=TEX]
\usemodule[zhfonts]  % éťčŽ¤ć­Łćĺ­ĺˇä¸ş 11 pt
\startTEXpage[frame=on,offset=4pt,width=12cm]
ćč˝ĺä¸çťçčä¸äź¤čşŤä˝ăI can eat glass, it does not hurt me.
\stopTEXpage
\stoptyping
\placefigure[none]{}{\externalfigure[zhfonts/01.pdf]}

ä˝żç¨ć¨Ąĺĺć° \type{style=ss} ć \type{style=tt}ďźĺŻĺ°ć­Łćĺ­ä˝ĺć˘ä¸şć¨Ąĺĺć° \type{size} ćčŽžĺŽĺ¤§ĺ°çć&nbsp;čĄŹçşżĺ­ä˝ćç­ĺŽ˝ĺ­ä˝ăäžĺŚ

\starttyping[option=TEX]
% äťĽ 12 pt çć&nbsp;čĄŹçşżĺ­ä˝ä˝ä¸şć­Łćĺ­ä˝ 
\usemodule[zhfonts][style=ss,size=12pt]
\startTEXpage[frame=on,offset=4pt,width=12cm]
ćč˝ĺä¸çťçčä¸äź¤čşŤä˝ăI can eat glass, it does not hurt me.
\stopTEXpage
\stoptyping
\placefigure[none]{}{\externalfigure[zhfonts/02.pdf]}

\section{\type{\setupzhfonts}}

ä˝żç¨ \type{\setupzhfonts} ĺŻćżć˘ zhfonts éťčŽ¤çä¸­ćĺčĽżćĺ­ä˝ăäžĺŚďźĺ°éťčŽ¤çćąĺ­çčĄŹçşżĺ­ćçç˛ä˝ć´ć˘ä¸ş NotoSerifCJK-Bold.ttc\footnote{Google ĺźĺç Noto ĺ­ä˝ä¸­çä¸ćŹžďźéčŚä˝&nbsp;ĺťç˝çťä¸ćç´˘čˇĺĺšśćç§ \in[fonts-installation] čćäťçťçćšĺźäşäťĽĺŽčŁă}ďź

\starttyping[option=TEX]
\setupzhfonts
  [serif]
  [bold=notoserifcjkscbold,
   bolditalic=notoserifcjkscbold]
\stoptyping

äşŚĺŻĺ°éťčŽ¤çćąĺ­ĺ­ćĺ¨é¨ćżć˘ä¸şĺśäťĺ­ä˝ďźäžĺŚćżć˘čĄŹçşżĺ­ćďź

\starttyping[option=TEX]
\setupzhfonts
  [serif]
  [regular=notoserifcjkscregular,
   bold=notoserifcjkscbold,
   italic=notoserifcjkscregular,
   bolditalic=notoserifcjkscbold]
\stoptyping

čĽżćĺ­ä˝çćżć˘ćšĺźä¸ş

\starttyping[option=TEX]
\setupzhfonts
  [latin,serif|sans|mono]
  [regular=...,
   bold=...,
   italic=...,
   bolditalic=...]
\stoptyping

ĺŻšäşć°ĺ­Śĺ­ä˝ďźzhfonts ä˝żç¨ \CONTEXT\ éťčŽ¤çć°ĺ­Śĺ­ä˝ăĺŚćä˝&nbsp;ćłć´ć˘ĺśäťçć°ĺ­Śĺ­ä˝ďźčŻˇĺč \CONTEXT\ wiki éĄľăMath fontsă\cite[math-fonts]ďźäžĺŚĺć˘ä¸ş antykwa ĺ­ä˝ďźĺŞé

\starttyping[option=TEX]
\setupzhfonts[math][antykwa]
\stoptyping

zhfonts ĺšśćŞä˝żç¨ćąĺ­ĺ­ä˝ä¸­çčĽżćĺ­ĺ˝˘ďźčćŻćŻĺ°ćąĺ­ĺ­ä˝ä˝ä¸ş Fallback ĺ­ä˝ăćł¨ĺĽăĺ°čĽżćĺ­ä˝ďźäťčĺ°ćąĺ­ĺ­ä˝ä¸čĽżćĺ­ä˝çťćäşćˇˇĺĺ­ä˝ďźĺˇä˝ĺĺ&nbsp;ĺˇ˛ĺ¨ \in[fallback-fonts] čçťĺşäşčŻ´ćă

ä¸¤ç§ä¸ĺçĺ­ä˝ďźćˇˇĺĺ°ä¸čľˇďźĺŻč˝äźĺşç°ĺ­ĺ˝˘ĺ°şĺŻ¸ä¸ä¸č´çćĺľăčĽéĺ°čżç§ćĺľďźĺŻä˝żç¨ \type{\setupzhfonts} ç \type{fontname@n.n} çĺć°ĺ˝˘ĺźčŽžç˝Žćąĺ­ççźŠćžćŻäžăäžĺŚ

\starttyping[option=TEX]
\usemodule[zhfonts][size=16pt]
\setupzhfonts
  [serif]
  [regular=@1.5, % čŽžç˝ŽéťčŽ¤ĺ­ä˝ç rscale ĺć°ĺź
   bold=notoserifcjkscbold@0.5]
\startTEXpage[frame=on,offset=4pt]
čżćŻćąĺ­ďźThese are English characters.\par
\bf čżćŻćąĺ­ďźThese are English characters.
\stopTEXpage
\stoptyping
\placefigure[none]{}{\externalfigure[zhfonts/03.pdf]}

\section{ĺ°çť}

zhfonts ć¨ĄĺćŻĺşäş \CONTEXT\ çäź&nbsp;çťç Typescript ćşĺśĺŽç°çćąĺ­ĺ­ä˝ĺčąćĺ­ä˝çćˇˇĺăčĽćłč§čŻä¸ä¸ Typescript çććäšĺ¤ďźĺŞéçźčŻäťĽä¸ĺĺŽšç \CONTEXT\ ćşćäťśďź

\starttyping[option=TEX]
\usemodule[zhfonts]
\starttext
\showzhfonts
\stoptext
\stoptyping</pre></body></html>