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

Hans Hagen j.hagen at xs4all.nl
Fri Jul 5 10:59:06 CEST 2019


On 7/5/2019 8:32 AM, Zhichu wrote:
> Hi everyone,
> 
> I was using metapost to generate some symbols, as in "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex"

How do you use these symbols in a document? Do you call them up by 
number somehow? Using some glyph interface doesn't make much sense I 
think, as the font stuff comes from mf which is 8 bit. So, these 
character numbers (and simensions) are not really saying much, other 
than that they're properties of a figure.

(In context lmtx there will likely be some module for mp fonts. We can 
already do a lot but there is some more potential.)

Hans


> 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.
> 
> 
> 
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list