In the following example, I get unwanted line breaks for text "Dest-Addr". The result is correct for text "Hello-World". The result is also correct if I change font size to 10pt or 12pt. Pdflatex and Luatex don't have this bug.
\documentclass[11pt]{article} \parindent=0pt \begin{document} \setbox0=\hbox{Hello-World} \setbox2=\vbox{\hsize=\wd0 Hello-World} \box2 \setbox2=\vbox{\hsize=\wd0 \raggedright Hello-World} \box2 \setbox2=\vbox{\hsize=\wd0 \centering Hello-World} \box2 \setbox2=\vbox{\hsize=\wd0 \raggedleft Hello-World} \box2 \setbox0=\hbox{Dest-Addr} \setbox2=\vbox{\hsize=\wd0 Dest-Addr} \box2 \setbox2=\vbox{\hsize=\wd0 \raggedright Dest-Addr} \box2 \setbox2=\vbox{\hsize=\wd0 \centering Dest-Addr} \box2 \setbox2=\vbox{\hsize=\wd0 \raggedleft Dest-Addr} \box2 \end{document}
Anonymous
A plaintex example
The condition to reproduce the problem is so narrow that makes me guess it's caused by some rounding error.
This is a rounding issue where D2Fix rounds the double by addiing 0.5 before it converted into an integer, effectively rounding the number, rather than just truncating it. If the +0.5 is removed (so it just (int)(d * 65556.0) then this issue (and a number of issues I've had with tblr environments) goes away. I suspect (and this is a guess) that the rounding up exceding the size of the box calculated somewhere else.
Just adding references to other/original reports:
https://github.com/lvjr/tabularray/issues/16
https://tex.stackexchange.com/q/600010/2388
Here is a version of the test document that runs under -ini, and also runs with both xetex and luatex. Reply posted to the thread following https://tug.org/pipermail/tex-live/2024-February/049883.html ...
Hello Karl,
I noticed there is an error in your example where the problem size is 10.95pt but the example has 10.90pt, which works.
\fi
at 10.90pt
\loggingall
\1
\test{Dest-Addr} % unwanted line breaks right after hyphen char
% none of 10.94pt nor 10.96pt can reproduce the problem with xetex.
I did find where a rounding error does happen in XeTeX_err.c.
At 10.95pt in the function measure_native_mode (around line 2100)
This is less than sum(advances) by 1. Setting node_width(node) = sum(D2Fix(advances[i])) does result in the 10.95pt example no longer breaking. My test code if ugly but I could clean it up
I've noticed if I'm not running without -ini it will break the line on the hypen regardless (tested with 10pt, 10.95pt and 11pt), tested on a new TL install on a CentOS 7 system. This behaviour is in line with pdftex (using cmr10 rather than lmr10).