<div class="__aliyun_email_body_block"><div  style="line-height:1.7;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><div  style="clear:both;">Hi Hans,<br ></div><div  style="clear:both;"><br ></div><div  style="clear:both;">I simply put the unicode character there and everything works pretty well.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">I was using only 5 Chinese characters in a document: <span >中國科學院, which means Chinese Academy of Sciences. Looked up their unicode number:</span></div><div  style="clear:both;"><br ></div><div  style="clear:both;"><span >for c in u'中國科學院': print(ord(c))</span><div  style="clear:both;">20013</div><div  style="clear:both;">22283</div><div  style="clear:both;">31185</div><div  style="clear:both;">23416</div><div  style="clear:both;">38498</div><div  style="clear:both;"><br ></div><div  style="clear:both;">and draw every glyph carefully in a metapost file "cas-chars.mp":</div><div  style="clear:both;"><br ></div><div  style="clear:both;"><span >beginglyph(20013,1000,1000,0);</span><div  style="clear:both;">  % a lot of fillings and drawings</div><span >endglyph;</span></div><div  style="clear:both;"><span ><br ></span></div><div  style="clear:both;"><span >then call them in a test file:</span></div><div  style="clear:both;"><span ><br ></span></div><div  style="clear:both;"><span ></span><span >\definemetafont[cas-logo][cas-chars.mp]</span><div  style="clear:both;">\startTEXpage</div><div  style="clear:both;">\definefont[cas][cas@cas-logo]</div><div  style="clear:both;">    \cas 中國科學<span >院</span></div><span >\stopTEXpage</span><span ></span><span ><br ></span></div><div  style="clear:both;"><span ><br ></span></div><div  style="clear:both;">If I remove the <span >beginglyph(<span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;">38498</span>,1000,1000,0) part in the mp file and “<span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;">\cas 中國科學” will generate the correct output. or if I change <span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;">beginglyph(</span><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;text-decoration-style:initial;text-decoration-color:initial;background-color:#ffffff;float:none;display:inline;">38498</span><span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;">,1000,1000,0) to </span><span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;"> </span><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;">beginglyph(<span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;"></span></span></span></span><span >32767</span><span ><span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;"><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;">,1000,1000,0) and “<span >\cas 中國科學\char"7FFF” also gives the right output.</span></span></span></span></div><div  style="clear:both;"><span ><span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;"><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;"><span ><br ></span></span></span></span></div><div  style="clear:both;"><span ><span  style="color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;"><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;"><span >I'm looking forward to “some” module :-)</span></span></span></span></div></div><blockquote  style="margin-right:.0px;margin-top:.0px;margin-bottom:.0px;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><div  style="clear:both;">------------------------------------------------------------------</div><div  style="clear:both;">From:Hans Hagen <j.hagen@xs4all.nl></div><div  style="clear:both;">Send Time:2019 Jul. 5 (Fri.) 17:03</div><div  style="clear:both;">To:陈之初 <chenzhichu@zjlab.org.cn>; mailing list for ConTeXt users <ntg-context@ntg.nl></div><div  style="clear:both;">Subject:Re: [NTG-context] I (metapost) can't handle numbers bigger than 32767.99998</div><div  style="clear:both;"><br ></div><div  style="clear:both;">On 7/5/2019 8:32 AM, Zhichu wrote:<br >> Hi everyone,<br >> <br >> I was using metapost to generate some symbols, as in "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex"<br ><br >How do you use these symbols in a document? Do you call them up by <br >number somehow? Using some glyph interface doesn't make much sense I <br >think, as the font stuff comes from mf which is 8 bit. So, these <br >character numbers (and simensions) are not really saying much, other <br >than that they're properties of a figure.</div><div  style="clear:both;"><br >(In context lmtx there will likely be some module for mp fonts. We can <br >already do a lot but there is some more potential.)<br ><br >Hans<br ><br ><br >> Occasionally, I want to customize a glyph whose charcode is a little large, say the character " <br >> 院":<br >> ========================================<br >> ~~~IPython<br >> In [1]: for c in u'院': print(ord(c))<br >> 38498<br >> ========================================<br >> <br >> so I wrote:<br >> ========================================<br >> beginglyph(38498,2,4,0) ; % high voltage<br >>      interim ahlength := 1 ;<br >>      drawarrow (1,4) -- (0,2) -- (2,3) -- (1,0) withcolor darkred ;<br >> endglyph ;<br >> ========================================<br >> <br >> and I got:<br >> ========================================<br >> ! Enormous number has been reduced.<br >> l.60 beginzhglyph(38498<br >> );<br >> I can't handle numbers bigger than 32767.99998;<br >> so I've changed your constant to that maximum amount.<br >> ========================================<br >> <br >> So charcode is a 15-bit integer?<br >> <br >> Currently, I use `beginglyph(32767,2,4,0) ;` and call it with \char"7FFF. Not an elegant way I think.<br >> <br >> Is there a fix? I checked the metapost manual and found that charcode is only used to set the filename to something like %{jobname}.%{charcode} I can't see why there's a limit for charcode.<br >> <br >> <br >> <br >> <br >> <br >> <br >> ___________________________________________________________________________________<br >> If your question is of interest to others as well, please add an entry to the Wiki!<br >> <br >> maillist : ntg-context@ntg.nl / <a  href="http://www.ntg.nl/mailman/listinfo/ntg-context" target="_blank">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br >> webpage  : <a  href="http://www.pragma-ade.nl" target="_blank">http://www.pragma-ade.nl</a> / <a  href="http://context.aanhet.net" target="_blank">http://context.aanhet.net</a><br >> archive  : <a  href="https://bitbucket.org/phg/context-mirror/commits/" target="_blank">https://bitbucket.org/phg/context-mirror/commits/</a><br >> wiki     : <a  href="http://contextgarden.net" target="_blank">http://contextgarden.net</a><br >> ___________________________________________________________________________________<br >> <br ><br ><br >-- <br ><br >-----------------------------------------------------------------<br >                                           Hans Hagen | PRAGMA ADE<br >               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands<br >        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl<br >-----------------------------------------------------------------<br >___________________________________________________________________________________<br >If your question is of interest to others as well, please add an entry to the Wiki!<br ><br >maillist : ntg-context@ntg.nl / <a  href="http://www.ntg.nl/mailman/listinfo/ntg-context" target="_blank">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br >webpage  : <a  href="http://www.pragma-ade.nl" target="_blank">http://www.pragma-ade.nl</a> / <a  href="http://context.aanhet.net" target="_blank">http://context.aanhet.net</a><br >archive  : <a  href="https://bitbucket.org/phg/context-mirror/commits/" target="_blank">https://bitbucket.org/phg/context-mirror/commits/</a><br >wiki     : <a  href="http://contextgarden.net" target="_blank">http://contextgarden.net</a><br >___________________________________________________________________________________<br ></div></blockquote><div  style="line-height:20.0px;clear:both;"><br ></div></div></div>