typo-wrp.mkxl /size: 1935 b    last modification: 2023-12-21 09:44
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}{autosuffix}
19
20\definesystemattribute[crlf]
21
22\permanent\protected\def\crlf
23  {\ifhmode
24     \expandafter\spac_crlf
25   \fi}
26
27\protected\def\spac_crlf
28  {\clf_enablecrlf % once
29   \unskip
30   \wordboundary
31   \spac_crlf_placeholder % box
32   \ifcase\raggedstatus\hfil\or\or\or\hfil\fi
33   % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [glue (filler)]
34   \break
35   \begingroup
36   \c_attr_crlf\plusone
37   \wordboundary
38   \endgroup
39   % which we then remove (maybe we should flag the wordboundary with an attribute but not now
40   \ignorespaces}
41
42\protected\def\spac_crlf_placeholder
43  {\strut} % or \endstrut
44
45\protected\def\spac_crlf_placeholder_show
46  {\hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
47
48\permanent\protected\def\settestcrlf
49  {\let\spac_crlf_placeholder\spac_crlf_placeholder_show}
50
51\permanent\protected\def\crlfplaceholder % for old times sake
52  {\wordboundary\strut}
53
54\appendtoks
55    \lettonothing\spac_crlf_placeholder
56\to \everysetnostrut
57
58\appendtoks
59    \let\spac_crlf\space
60\to \everysimplifycommands
61
62% experiment, triggered by MS:
63%
64% \type{f\kern\tightfitcompensation\high{x}}
65% \type{f\tightfitboundary         \high{x}}
66
67% \tightfitcompensation : defined at the lua end
68
69\newboundary\c_tightfit_boundary
70
71\permanent\protected\def\tightfitboundary
72  {\clf_enabletighten
73   \boundary\c_tightfit_boundary}
74
75\protect \endinput
76