[NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

Zhichu chenzhichu at zjlab.org.cn
Fri Jul 5 08:32:27 CEST 2019


Hi everyone,

I was using metapost to generate some symbols, as in "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex"

Occasionally, I want to customize a glyph whose charcode is a little large, say the character "院":
========================================
~~~IPython
In [1]: for c in u'院': print(ord(c))
38498
========================================

so I wrote:
========================================
beginglyph(38498,2,4,0) ; % high voltage
    interim ahlength := 1 ;
    drawarrow (1,4) -- (0,2) -- (2,3) -- (1,0) withcolor darkred ;
endglyph ;
========================================

and I got:
========================================
! Enormous number has been reduced.
l.60 beginzhglyph(38498
);
I can't handle numbers bigger than 32767.99998;
so I've changed your constant to that maximum amount.
========================================

So charcode is a 15-bit integer?

Currently, I use `beginglyph(32767,2,4,0) ;` and call it with \char"7FFF. Not an elegant way I think.

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.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20190705/f660843f/attachment.html>


More information about the ntg-context mailing list