typo-wrp.mkiv /size: 1954 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=typo-wrp,
3%D        version=2014.11.09,
4%D          title=\CONTEXT\ Typesetting Macros,
5%D       subtitle=Wrappers,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Typesetting Macros / Wrapping}
15
16\unprotect
17
18\registerctxluafile{typo-wrp}{}
19
20%D This definition has moved from page-lin.tex to spac-hor.tex (due to
21%D visualization added in august 2003) and now to here (november 2014)
22%D due to cacthing border cases in dirty and messy \XML\ sources).
23
24% \unexpanded\def\crlf
25%   {\ifhmode
26%      \unskip
27%      \prewordbreak\crlfplaceholder
28%      \ifcase\raggedstatus\hfil\or\or\or\hfil\fi
29%      \break
30%    \else
31%      \crlfplaceholder
32%      \endgraf
33%    \fi}
34
35\unexpanded\def\crlf
36  {\ifhmode
37     \expandafter\spac_crlf
38   \fi}
39
40\unexpanded\def\spac_crlf
41  {\clf_enablecrlf % once
42   \unskip
43   \spac_crlf_placeholder
44   \ifcase\raggedstatus\hfil\or\or\or\hfil\fi
45   % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [parfillskip]
46   \break
47   \wordboundary
48   % which we then remove (maybe we should flag the wordboundary with an attribute but not now
49   \ignorespaces}
50
51\unexpanded\def\spac_crlf_placeholder
52  {\wordboundary\strut} % or \endstrut
53
54\unexpanded\def\spac_crlf_placeholder_show
55  {\wordboundary
56  %\nobreak
57   \hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
58
59\unexpanded\def\settestcrlf
60  {\let\spac_crlf_placeholder\spac_crlf_placeholder_show}
61
62\unexpanded\def\crlfplaceholder % for old times sake
63  {\spac_crlf_placeholder}
64
65\appendtoks
66    \let\spac_crlf_placeholder\empty
67\to \everysetnostrut
68
69\appendtoks
70    \let\spac_crlf\space
71\to \everysimplifycommands
72
73\protect \endinput
74