[metapost] glyph headache

Laurent Méhats laurent.mehats at gmail.com
Sun Dec 20 15:51:32 CET 2009


Hello,

I'm experimenting a very strange behaviour using the glyph operator. I'm
running metapost 1.208 from texlive 2009 updated yesterday; here is some
code that won't compile on my system (Ubuntu 9.10, kernel 2.6.31-16-generic):


----%<----%<---- test.mp ----%<----%<----%<----%<----%<----%<----%<----
def d_=enddef;
def e_=enddef;
def f_=enddef;
def g_=enddef;

def h_=
  string str;
  str:=
    "aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&
    "aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&"aa"&
    "aa"&"aa"&"aa"&"aa"&"aa";
enddef;

beginfig(0)
picture rightarrow;
rightarrow:=glyph "arrowright" of "cmsy10";
draw rightarrow;
endfig;

end
----%<----%<---- test.mp ----%<----%<----%<----%<----%<----%<----%<----


Here is the associated log file:


----%<----%<---- test.log ---%<----%<----%<----%<----%<----%<----%<----
This is MetaPost, version 1.208 (kpathsea version 5.0.0) (mem=mpost
2009.12.19)  20 DEC 2009 15:42
**test.mp
(./test.mp{pdftex.map}<cmsy10.pfb> [0
! This can't happen (string).
endfig->scantokens.extra_endfig;shipit;
                                       endgroup
l.18 endfig
           ;
I'm broken. Please show this to someone who can fix can fix


----%<----%<---- test.log ---%<----%<----%<----%<----%<----%<----%<----


However, the code WILL compile if I:
- change `glyph "arrowright" of "cmsy10"' into, say,
  `glyph "g" of "cmr10"' or (this is where it gets really strange)
- remove any of the `d_', `e_', `f_' or `g_' definition or
- change `d_', `e_', `f_'or `g_' into `a_', `b_' or `c_' or
- remove an `a' in the definition of `str' or
- replace an explicit concatenation `"aa"&"aa"' with `"aaaa"'.

Do you experiment the same behaviour?

Best regards,
Laurent Méhats



More information about the metapost mailing list