latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.82k stars 251 forks source link

missing character warnings from \xetex \showhyphens #1380

Open davidcarlisle opened 2 weeks ago

davidcarlisle commented 2 weeks ago

Brief outline of the bug

xelatex warns of missing characters from \showhyphens despite lltfssbas documentation saying they are suppressed, adding \tracinglostchars\z@ would fix

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass[12pt]{article}

\usepackage{fontspec}
\setmainfont{FreeSans}
\begin{document}

\makeatletter
\DeclareRobustCommand\Xshowhyphens[1]{% remove the X to see fix
  \setbox0\vbox{%
    \usefont{TU}{lmr}{m}{n}%
    \hsize 1sp %
    \hbadness\@M
    \hfuzz\maxdimen
    \tracingonline\z@
    \tracinglostchars\z@%%%%%%%%%%<<<<<<<
    \everypar={}%
    \leftskip\z@skip
    \rightskip\z@skip
    \parfillskip\z@skip
    \hyphenpenalty=-\@M
    \pretolerance\m@ne
    \interlinepenalty\z@
    \clubpenalty\z@
    \widowpenalty\z@
    \brokenpenalty1127 %
    \setbox\z@\hbox{}%
    \noindent
    \hskip\z@skip
    #1%
    \par
     \loop
     \@tempswafalse
     \ifnum\lastnodetype=11\unskip\@tempswatrue\fi
     \ifnum\lastnodetype=12\unkern\@tempswatrue\fi
     \ifnum\lastnodetype=13 %
      \count@\lastpenalty
      \unpenalty\@tempswatrue
    \fi
    \ifnum\lastnodetype=\@ne
     \setbox\tw@\lastbox\@tempswatrue
     \setbox0\hbox{\unhbox\tw@\unskip\unskip\unpenalty
                   \ifnum\count@=1127 \else\ \fi
                   \unhbox0}%
     \count@\z@
    \fi
    \if@tempswa
    \repeat
   \hbadness\z@
   \hsize\maxdimen
   \showboxdepth\z@
   \tolerance\m@ne
   \hyphenpenalty\z@
   \noindent\unhbox\z@
}}

\showhyphens{ինչու ինչպես որտեղ հիվանդանոց հիվանդանոցում Երևան Երևանում Նամակ Երևանիս ԵՐԵՎԱՆ
ԵՐԵՎԱՆՈՒՄ ԵՐԵՎԱՆԻՍ շնորհակալություն անպայման այրվել անգին անձրևանոց ԱՆՁՐԵՎԱՆՈՑ հիվանդանոցու՞մ}

\end{document}

latexbug also needs an update as it says fontspec is still under Will's account:

! Package latexbug Error: Third-party file(s)
(latexbug)                
(latexbug)                This test file uses third-party file(s)
(latexbug)                
(latexbug)                ==============
(latexbug)                fontspec.sty  ->  Will Robertson 
(latexbug)                    https://github.com/wspr/fontspec/issues 
(latexbug)                ==============
FrankMittelbach commented 2 weeks ago

I'll think this classifies as a bug in LaTeX. I have updated latexbug, @davidcarlisle are you going to do this one?

davidcarlisle commented 2 weeks ago

@FrankMittelbach yes I'll make a PR to dev