summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/typo-brk.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/typo-brk.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/typo-brk.mkiv46
1 files changed, 31 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/context/base/typo-brk.mkiv b/Master/texmf-dist/tex/context/base/typo-brk.mkiv
index 90561fc9e09..38afbb454b6 100644
--- a/Master/texmf-dist/tex/context/base/typo-brk.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-brk.mkiv
@@ -17,19 +17,17 @@
\registerctxluafile{typo-brk}{1.001}
-\definesystemattribute[breakpoint]
+\definesystemattribute[breakpoint] \chardef\breakpointattribute \dogetattributeid{breakpoint}
% compound stuff (under construction)
\newbox\breakpointbox
-\definesystemvariable {bp} % BreakPoint
-
-\exhyphenchar=\minusone % we use a different order then base tex, so we really need this
+\exhyphenchar\minusone % we use a different order then base tex, so we really need this
\newcount \maxbreakpointsid
-\def\definebreakpoints
+\unexpanded\def\definebreakpoints
{\dosingleargument\dodefinebreakpoints}
\def\dodefinebreakpoints[#1]%
@@ -42,32 +40,50 @@
{\dotripleempty\doinstallbreakpoint}
% hm, we cannot prebuild lists, font dependent
+%
+% -- type nleft nright language left right middle
+%
+% -- we might eventually stick to only method 5
\def\doinstallbreakpoint[#1][#2][#3]%
{\ifcsname\??bp:#1\endcsname
\begingroup
- \getparameters[\??bp][\c!type=1,\c!nleft=3,\c!nright=3,\s!language=,#3]%
- \ctxlua{breakpoints.setreplacement(\csname\??bp:#1\endcsname,#2,\@@bptype,\@@bpnleft,\@@bpnright,"\@@bplanguage")}%
+ \getparameters[\??bp][\c!type=1,\c!nleft=3,\c!nright=3,\s!language=,\c!left=,\c!right=,\c!middle=,#3]%
+ \ctxlua{breakpoints.setreplacement(\csname\??bp:#1\endcsname, "#2", "\@@bplanguage", {
+ kind = \@@bptype,
+ nleft = "\@@bpnleft",
+ nright = "\@@bpnright",
+ right = "\@@bpright",
+ left = "\@@bpleft",
+ middle = "\@@bpmiddle"
+ } )}% todo: table
\endgroup
\fi}
\def\setbreakpoints
- {\ctxlua{breakpoints.enabled=true}%
- \gdef\setbreakpoints[##1]{\dosetattribute{breakpoint}{\csname\??bp:##1\endcsname}}%
+ {\ctxlua{breakpoints.enable()}%
+ \gdef\setbreakpoints[##1]{\attribute\breakpointattribute\csname\??bp:##1\endcsname\relax}%
\setbreakpoints}
\letvalue{\??bp:\s!reset}\attributeunsetvalue
\definebreakpoints[compound]
-\installbreakpoint [compound] [\number`+] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`-] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`/] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`(] [\c!left=3,\c!right=3,\c!type=2]
-\installbreakpoint [compound] [\number`)] [\c!left=3,\c!right=3,\c!type=3]
+\installbreakpoint [compound] [+] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [-] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [/] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [(] [\c!nleft=3,\c!nright=3,\c!type=2] % type=5,middle=(,left=(-,right=
+\installbreakpoint [compound] [)] [\c!nleft=3,\c!nright=3,\c!type=3] % type=5,middle=),left=,right=-)
+
+% \start \hsize 1.5cm \setbreakpoints[compound]
+% \installbreakpoint [compound] [-] [nleft=3,nright=3,type=5,left=,right={-},middle={-}]
+% \installbreakpoint [compound] [(] [nleft=3,nright=3,type=5,left=,right={(-},middle={(}]
+% \installbreakpoint [compound] [)] [nleft=3,nright=3,type=5,left={-)},right=,middle={)}]
+% composed-word\par composed(word)\par
+% \stop
% \mainlanguage[czech]
-% \installbreakpoint [compound] [\number`-] [language=cs,left=3,right=3,type=4]
+% \installbreakpoint [compound] [\number`-] [language=cs,nleft=3,nright=3,type=4]
% \setbreakpoints[compound]
% \start \hsize 1mm test-test \par \stop