<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Jul 2021, at 13:24, Hans Hagen <<a href="mailto:j.hagen@xs4all.nl" class="">j.hagen@xs4all.nl</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 7/29/2021 1:16 PM, Toby Thurston wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">consider the following MP program, which is trying to print the Greek alphabet in the default font using the default TeX encoding, which puts Gamma at position zero<br class="">prologues := 3;<br class="">outputtemplate := "%j%c.eps";<br class="">beginfig(1);<br class="">string AB;<br class="">AB = ("AB" & char 0 & char 1 & "EZH" & char 2 & "IK"<br class="">         <span class="Apple-converted-space"> </span>& char 3 & "MNO" & char 4 & char 5 & "P"<br class="">         <span class="Apple-converted-space"> </span>& char 6 & "T"   & char 7 & char 8 & "X"<br class="">         <span class="Apple-converted-space"> </span>& char 9 & char 10);<br class="">draw AB infont "cmmi10" shifted 10 up;<br class="">draw AB infont "eurm10" shifted 10 down;<br class="">draw bbox currentpicture;<br class="">endfig;<br class="">end.<br class="">if I run this through `mpost`  (MetaPost 2.00 (TeX Live 2021) (kpathsea version 6.3.3)) I get two lines with the expected 24 Greek characters in each, with a box around them.<br class="">But if I change the program to wrap it up with luamplib like this:<br class="">\documentclass{standalone}<br class="">\usepackage{luamplib}<br class="">\begin{document}<br class="">\begin{mplibcode}<br class="">beginfig(1);<br class="">string AB;<br class="">AB = ("AB" & char 0 & char 1 & "EZH" & char 2 & "IK"<br class="">         <span class="Apple-converted-space"> </span>& char 3 & "MNO" & char 4 & char 5 & "P"<br class="">         <span class="Apple-converted-space"> </span>& char 6 & "T"   & char 7 & char 8 & "X"<br class="">         <span class="Apple-converted-space"> </span>& char 9 & char 10);<br class="">draw AB infont "cmmi10" shifted 10 up;<br class="">draw AB infont "eurm10" shifted 10 down;<br class="">draw bbox currentpicture;<br class="">endfig;<br class="">\end{mplibcode}<br class="">\end{document}<br class="">and run it through `lualatex` (This is LuaHBTeX, Version 1.13.0 (TeX Live 2021) then all I get are the first two characters in each string.   In other words it stops at char 0 (Gamma).<br class="">Oddly the bbox is still large enough for the whole string…<br class="">any thoughts?<br class=""></blockquote><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">just avoid 0 chars (\nul) in a luatex related workflow ... data gets passed through c string handling so it can indicate an end of string; using "infont' is anyway worse that btex ... etex where you can use \char 0</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hans</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div></div>That’s not really the point.   Sure there are plenty of work-arounds and clearly c string handling is the likely culprit, but the point is that the current support of “infont” is very good apart from this bug and it is still useful, and still widely used in existing code, and since `char 0` is a valid MP string, I think this should be fixed.     Or at least documented as a limitation of `luamplib` compared to plain `mpost`.<div class=""><br class=""></div><div class="">Toby</div></body></html>