summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/spac-ali.mkiv
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-26 13:38:18 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-26 13:38:18 +0100
commit788487819ccf38a8478cc2afd88e0c0b088d0ec1 (patch)
tree215addbe3b9e293c2958227e7fc8923880b2e71f /tex/context/base/mkiv/spac-ali.mkiv
parentadfe72d5a0c9d7bdc1bd7bc8faabb4d05e21d70a (diff)
downloadcontext-788487819ccf38a8478cc2afd88e0c0b088d0ec1.tar.gz
2016-03-26 13:07:00
Diffstat (limited to 'tex/context/base/mkiv/spac-ali.mkiv')
-rw-r--r--tex/context/base/mkiv/spac-ali.mkiv67
1 files changed, 45 insertions, 22 deletions
diff --git a/tex/context/base/mkiv/spac-ali.mkiv b/tex/context/base/mkiv/spac-ali.mkiv
index e896b3910..e7d4137a0 100644
--- a/tex/context/base/mkiv/spac-ali.mkiv
+++ b/tex/context/base/mkiv/spac-ali.mkiv
@@ -288,6 +288,7 @@
\newconstant\c_spac_align_state_horizontal
\newconstant\c_spac_align_state_broad
+\newconstant\c_spac_align_state_par_fill
\def\v_spac_align_fill_amount {\plusone fil}
\def\v_spac_align_fill_amount_negative {\minusone fil}
@@ -472,7 +473,8 @@
\spac_align_set_horizontal_centered_last_line
\or
\parfillskip\zeropoint
- \fi}
+ \fi
+ \relax}
% Page spacing:
@@ -542,6 +544,7 @@
\c_spac_align_state_vertical \zerocount
\c_spac_align_state_direction \zerocount % what is default ?
\c_spac_align_state_page \zerocount
+ \c_spac_align_state_par_fill \zerocount
\ifcsname\??aligncommand\m_spac_align_asked\endcsname
\lastnamedcs
\else
@@ -555,6 +558,7 @@
\spac_align_flush_vertical
\spac_align_flush_direction
\spac_align_flush_page
+ \spac_align_flush_parfill
}}% kept, nice for tracing
\edef\raggedcommand {\the\t_spac_align_collected }%
\edef\updateraggedskips{\spac_align_flush_horizontal}%
@@ -631,7 +635,7 @@
\unexpanded\def\installalign#1#2% beware: commands must be unexpandable!
{\ifcsname\??aligncommand#1\endcsname \else
- \setvalue{\??aligncommand#1}{\t_spac_align_collected\expandafter{\the\t_spac_align_collected#2}}%
+ \setvalue{\??aligncommand#1}{\toksapp\t_spac_align_collected{#2}}%
\fi}
% beware, toks stuff and states are set at a differt time, so installalign is
@@ -639,7 +643,7 @@
%
% \setvalue{\??aligncommand whatever}%
% {\c_spac_align_state_horizontal\plushundred
-% \t_spac_align_collected\expandafter{\the\t_spac_align_collected .....}}
+% \toksapp\t_spac_align_collected{.....}}
%
% this one could deal with both
%
@@ -648,7 +652,7 @@
% \setvalue{\??aligncommand#1}%
% {\spac_align_set_horizontal_none
% \c_spac_align_state_horizontal\plushundred % don't set
-% \t_spac_align_collected\expandafter{\the\t_spac_align_collected#2}}%
+% \toksapp\t_spac_align_collected{#2}}%
% \fi}
%
% \installalignoption
@@ -665,7 +669,7 @@
\setvalue{\??aligncommand\v!height }{\c_spac_align_state_page \plustwo }
\setvalue{\??aligncommand\v!line }{\c_spac_align_state_page \plusthree
% this will become another keyword (undocumented anyway)
- \t_spac_align_collected\expandafter{\the\t_spac_align_collected\settrue\raggedonelinerstate}}
+ \toksapp\t_spac_align_collected{\settrue\raggedonelinerstate}}
\setvalue{\??aligncommand\v!high }{\c_spac_align_state_vertical \plusthree}
\setvalue{\??aligncommand\v!low }{\c_spac_align_state_vertical \plustwo }
@@ -702,23 +706,42 @@
\c_spac_align_state_broad \plusone
\c_spac_align_state_horizontal\plustwo }
-\setvalue{\??aligncommand\v!lesshyphenation}{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\lesshyphens}}
-\setvalue{\??aligncommand\v!morehyphenation}{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\morehyphens}}
-
-\setvalue{\??aligncommand\v!hanging }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\font_protruding_enable }}
-\setvalue{\??aligncommand\v!nothanging }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\font_protruding_disable}}
-\setvalue{\??aligncommand\v!hz }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\font_expansion_enable }}
-\setvalue{\??aligncommand\v!fullhz }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\font_expansion_enable_k}}
-\setvalue{\??aligncommand\v!nohz }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\font_expansion_disable }}
-%setvalue{\??aligncommand\v!spacing }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\normalspacing\zerocount}} % not yet
-%setvalue{\??aligncommand\v!nospacing }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\normalspacing\plusone}} % not yet
-\setvalue{\??aligncommand\v!hyphenated }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\dohyphens}}
-\setvalue{\??aligncommand\v!nothyphenated }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\nohyphens}}
-
-\setvalue{\??aligncommand\v!tolerant }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\spac_align_set_tolerant}}
-\setvalue{\??aligncommand\v!verytolerant }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\spac_align_set_very_tolerant}}
-\setvalue{\??aligncommand\v!stretch }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\spac_align_set_stretch}}
-\setvalue{\??aligncommand\v!extremestretch }{\t_spac_align_collected\expandafter{\the\t_spac_align_collected\spac_align_set_extreme_stretch}}
+\setvalue{\??aligncommand\v!lesshyphenation}{\toksapp\t_spac_align_collected{\lesshyphens}}
+\setvalue{\??aligncommand\v!morehyphenation}{\toksapp\t_spac_align_collected{\morehyphens}}
+
+\setvalue{\??aligncommand\v!hanging }{\toksapp\t_spac_align_collected{\font_protruding_enable }}
+\setvalue{\??aligncommand\v!nothanging }{\toksapp\t_spac_align_collected{\font_protruding_disable}}
+\setvalue{\??aligncommand\v!hz }{\toksapp\t_spac_align_collected{\font_expansion_enable }}
+\setvalue{\??aligncommand\v!fullhz }{\toksapp\t_spac_align_collected{\font_expansion_enable_k}}
+\setvalue{\??aligncommand\v!nohz }{\toksapp\t_spac_align_collected{\font_expansion_disable }}
+%setvalue{\??aligncommand\v!spacing }{\toksapp\t_spac_align_collected{\normalspacing\zerocount}} % not yet
+%setvalue{\??aligncommand\v!nospacing }{\toksapp\t_spac_align_collected{\normalspacing\plusone}} % not yet
+\setvalue{\??aligncommand\v!hyphenated }{\toksapp\t_spac_align_collected{\dohyphens}}
+\setvalue{\??aligncommand\v!nothyphenated }{\toksapp\t_spac_align_collected{\nohyphens}}
+
+\setvalue{\??aligncommand\v!tolerant }{\toksapp\t_spac_align_collected{\spac_align_set_tolerant}}
+\setvalue{\??aligncommand\v!verytolerant }{\toksapp\t_spac_align_collected{\spac_align_set_very_tolerant}}
+\setvalue{\??aligncommand\v!stretch }{\toksapp\t_spac_align_collected{\spac_align_set_stretch}}
+\setvalue{\??aligncommand\v!extremestretch }{\toksapp\t_spac_align_collected{\spac_align_set_extreme_stretch}}
+
+\setvalue{\??aligncommand \v!final}{\c_spac_align_state_par_fill\plusone}
+\setvalue{\??aligncommand2*\v!final}{\c_spac_align_state_par_fill\plustwo} % hardcoded multiplier
+\setvalue{\??aligncommand3*\v!final}{\c_spac_align_state_par_fill\plusthree}
+\setvalue{\??aligncommand4*\v!final}{\c_spac_align_state_par_fill\plusfour}
+
+\definehspace [\v!final] [\emspaceamount]
+
+\def\spac_align_flush_parfill
+ {\ifcase\c_spac_align_state_par_fill\else
+ \spac_align_flush_parfill_indeed{\number\c_spac_align_state_par_fill}%
+ \fi}
+
+\unexpanded\def\spac_align_flush_parfill_indeed#1%
+ {\parfillskip
+ #1\directhspaceamount\v!final
+ % plus \dimexpr\availablehsize-#1\directhspaceamount\v!final\relax
+ plus 1fill
+ \relax}
%D For Wolfgang: