[XeTeX] Follow-up to previous mail about hyphenation

Philip Taylor P.Taylor at Hellenic-Institute.Uk
Thu Mar 25 14:03:29 CET 2021


And now, thanks to Jonathan, only one page —

% !TeX Program=Ini-XeTeX

\catcode `\ = 10
\catcode `\{ = 1
\catcode `\} = 2
\catcode `\# = 6
\catcode `\^ = 7
\catcode `\^^I = 10
\catcode `\% = 14

\let \bgroup = {
\let \egroup = }
\let \endgraf = \par

\tracingonline = 1
\tracinglostchars = 2

\dimen 10 = 16383.99998 pt

\input showhyphens
\message {\meaning \showhyphens}

\font \tenrm = "Amiri"
\tenrm
\hyphenchar \font = `\‐

\lccode "200D = "200D
\catcode "200D = 11
\patterns {^^^^200d1^^^^200d}

\def \text {foo^^^^200d^^^^200dbar}
\hsize = 0 pt
\vsize = \dimen 10
\noindent \ \text
\showhyphens \text
\end
-- 
/** Phil./
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20210325/ebbf205d/attachment.html>
-------------- next part --------------
\def \loop #1\pool {\def \body {#1}\iterate}
\def \iterate {\body \let \next = \iterate \else \let \next = \relax \fi \next}
\let \pool = \fi

\def \showhyphenspace #1 
	{%
		\ifx \valign #1\valign
		\else
			#1\vadjust {\penalty 1 } \expandafter \showhyphenspace
		\fi
	}

\def \showhyphens #1%
	{%
		\begingroup
			\showboxbreadth =\dimen 10 
			\showboxdepth =\dimen 10 
			\pretolerance = -1 
			\tolerance = -1 
			\setbox 2 = \hbox {}%
			\setbox 0 = \vbox
			\bgroup
				\pretolerance = -1 
				\tolerance = -1 
				\hbadness = 0
				\parfillskip = 0 pt 
				\hsize = 1 sp
				\noindent
				\hskip 0 pt
				\hfuzz =\dimen 10 
				\hbadness =\dimen 10 
				\showhyphenspace #1 {} \endgraf
				\loop
					\count 0 = 1 
					\ifnum \lastnodetype = 1 
						\setbox 4 = \lastbox
						\setbox 2 = \hbox {\unhbox 4 \unhbox 2}%
						\count 0 = 0 
					\fi
					\ifnum \lastnodetype = 11 \unskip \count 0 = 0 \fi
					\ifnum \lastnodetype = 13
						 \count 2 = \lastpenalty
						 \unpenalty
						 \count 0 = 0 
						 \ifnum \count 2 = 1 \setbox 2 = \hbox { \unhbox 2 }\count 0 = 0 \fi
					\fi
				\ifnum \count 0 = 0
				\pool
				\hsize =\dimen 10 
				\hfuzz = 0 pt
				\hbadness 0
				\par
				\unhbox 2
				\par
			\egroup
		\endgroup
}


More information about the XeTeX mailing list.