diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-07-02 16:09:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-07-02 16:09:16 +0200 |
commit | 847821faaecf92833f1e1564e1ef9377758d4d45 (patch) | |
tree | 7a033668d823e231478c055daeb47c4582883059 /tex/context/base/mkiv/spac-ali.mkiv | |
parent | 052a096e160508ddbbbfcbf1522eb8ddbfc3b1cd (diff) | |
download | context-847821faaecf92833f1e1564e1ef9377758d4d45.tar.gz |
2018-07-02 14:46:00
Diffstat (limited to 'tex/context/base/mkiv/spac-ali.mkiv')
-rw-r--r-- | tex/context/base/mkiv/spac-ali.mkiv | 78 |
1 files changed, 28 insertions, 50 deletions
diff --git a/tex/context/base/mkiv/spac-ali.mkiv b/tex/context/base/mkiv/spac-ali.mkiv index ac24cb43c..ee4cfa8bc 100644 --- a/tex/context/base/mkiv/spac-ali.mkiv +++ b/tex/context/base/mkiv/spac-ali.mkiv @@ -64,6 +64,9 @@ %D We will not use bodydir and pagedir so we disable them. That way we get %D normal hyperlink support. We back on it (too hard to fake \type {\the}). +\chardef\directionlefttoright\zerocount +\chardef\directionrighttoleft\plusone + \unexpanded\def\syst_fatal_dir_error#1% {\writestatus{fatal error}{\string#1\space is forbidden}% \wait} @@ -71,6 +74,9 @@ \def\pagedir {\syst_fatal_dir_error\pagedir} \let\normalpagedir\pagedir \def\bodydir {\syst_fatal_dir_error\bodydir} \let\normalbodydir\bodydir +\def\pagedirection{\syst_fatal_dir_error\pagedirection} \let\normalpagedirection\pagedirection +\def\bodydirection{\syst_fatal_dir_error\bodydirection} \let\normalbodydirection\bodydirection + % This will become a more advanced layout controller soon: \newconditional\layoutlefttoright \settrue\layoutlefttoright @@ -94,14 +100,14 @@ \unexpanded\def\spac_directions_lefttoright_vmode {\settrue\displaylefttoright \settrue\inlinelefttoright - \textdir TLT\relax - \pardir TLT\relax} + \textdirection\directionlefttoright + \pardirection \directionlefttoright} \unexpanded\def\spac_directions_righttoleft_vmode {\setfalse\displaylefttoright \setfalse\inlinelefttoright - \textdir TRT\relax - \pardir TRT\relax} + \textdirection\directionrighttoleft + \pardirection \directionrighttoleft} % % keep this as reference % @@ -136,11 +142,11 @@ % \setfalse\inlinelefttoright} \unexpanded\def\spac_directions_lefttoright_hmode - {\linedir TLT\relax % linedir keeps subtype of skip + {\linedirection\directionlefttoright % linedir keeps subtype of skip \settrue\inlinelefttoright} \unexpanded\def\spac_directions_righttoleft_hmode - {\linedir TRT\relax % linedir keeps subtype of skip + {\linedirection\directionrighttoleft % linedir keeps subtype of skip \setfalse\inlinelefttoright} % \def\currentdirectionparameters @@ -167,16 +173,17 @@ \def\spac_directions_synchronize_lr {\settrue\inlinelefttoright - \textdir TLT\relax - \pardir TLT\relax} + \textdirection\directionlefttoright + \pardirection \directionlefttoright} \def\spac_directions_synchronize_rl {\setfalse\inlinelefttoright - \textdir TRT\relax - \pardir TRT\relax} + \textdirection\directionrighttoleft + \pardirection \directionrighttoleft} \unexpanded\def\synchronizeinlinedirection - {\textdir T\ifconditional\inlinelefttoright L\else R\fi T\relax} + {% why not \linedirection here + \textdirection\ifconditional\inlinelefttoright\directionlefttoright\else\directionrighttoleft\fi} \unexpanded\def\checkedlefttoright {\ifvmode @@ -210,49 +217,20 @@ \unexpanded\def\usebidiparameter#1% {\begincsname\??bidi#1\c!bidi\endcsname} -% maybe some day: -% -% \newcount\postdirpenalty % \zerocount -% \newcount\predirpenalty % \zerocount -% -% \def\spac_directions_post_break -% {\ifhmode -% \removeunwantedspaces -% \penalty\postdirpenalty -% \fi} -% -% \def\spac_directions_pre_break -% {\ifhmode -% \penalty\predirpenalty -% \ignorespaces -% \fi} -% -% \unexpanded\def\spac_directions_lefttoright_hmode -% {\settrue\inlinelefttoright -% \textdir TLT\relax -% \aftergroup\spac_directions_post_break -% \spac_directions_pre_break} -% -% \unexpanded\def\spac_directions_righttoleft_hmode -% {\textdir TRT\relax -% \setfalse\inlinelefttoright -% \aftergroup\spac_directions_post_break -% \spac_directions_pre_break} - \unexpanded\def\showdirections {\dontleavehmode - \begingroup\infofont\textdir TLT[\space - layout:\ifconditional \layoutlefttoright l2r\else r2l\fi\space - display:\ifconditional\displaylefttoright l2r\else r2l\fi\space - inline:\ifconditional \inlinelefttoright l2r\else r2l\fi\space + \begingroup\infofont\textdirection\directionlefttoright[\space + layout: \ifconditional\layoutlefttoright l2r\else r2l\fi\space + display: \ifconditional\displaylefttoright l2r\else r2l\fi\space + inline: \ifconditional\inlinelefttoright l2r\else r2l\fi\space ]\endgroup} -\unexpanded\def\righttolefthbox#1#{\hbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlhbox\righttolefthbox -\unexpanded\def\lefttorighthbox#1#{\hbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrhbox\lefttorighthbox -\unexpanded\def\righttoleftvbox#1#{\vbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvbox\righttoleftvbox -\unexpanded\def\lefttorightvbox#1#{\vbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvbox\lefttorightvbox -\unexpanded\def\righttoleftvtop#1#{\vtop dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvtop\righttoleftvtop -\unexpanded\def\lefttorightvtop#1#{\vtop dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvtop\lefttorightvtop +\unexpanded\def\righttolefthbox#1#{\hbox bdir\plusone #1\bgroup\righttoleft\let\next} \let\rtlhbox\righttolefthbox +\unexpanded\def\lefttorighthbox#1#{\hbox bdir\zerocount#1\bgroup\lefttoright\let\next} \let\ltrhbox\lefttorighthbox +\unexpanded\def\righttoleftvbox#1#{\vbox bdir\plusone #1\bgroup\righttoleft\let\next} \let\rtlvbox\righttoleftvbox +\unexpanded\def\lefttorightvbox#1#{\vbox bdir\zerocount#1\bgroup\lefttoright\let\next} \let\ltrvbox\lefttorightvbox +\unexpanded\def\righttoleftvtop#1#{\vtop bdir\plusone #1\bgroup\righttoleft\let\next} \let\rtlvtop\righttoleftvtop +\unexpanded\def\lefttorightvtop#1#{\vtop bdir\zerocount#1\bgroup\lefttoright\let\next} \let\ltrvtop\lefttorightvtop \unexpanded\def\autodirhbox#1#{\hbox#1\bgroup\synchronizeinlinedirection\let\next} \unexpanded\def\autodirvbox#1#{\vbox#1\bgroup\synchronizeinlinedirection\let\next} % maybe also pardir or maybe just a \vbox |