diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-11-05 16:37:55 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-11-05 16:37:55 +0100 |
commit | 70deb1dc5cd7c0546dd864ca91a8fa0b97e31533 (patch) | |
tree | 2396272ea506d3e4f0b19084ee85a7134a96e571 /tex | |
parent | ce22f093d2d9af63927792e2a821e81a49a2ca10 (diff) | |
download | context-70deb1dc5cd7c0546dd864ca91a8fa0b97e31533.tar.gz |
2021-11-05 15:56:00
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/mkii/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkii/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkii/mult-pe.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 24744 -> 24741 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 253975 -> 253969 bytes | |||
-rw-r--r-- | tex/context/base/mkxl/cont-new.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/typo-adj.lmt | 90 | ||||
-rw-r--r-- | tex/context/base/mkxl/typo-adj.mkxl | 62 | ||||
-rw-r--r-- | tex/context/interface/mkii/keys-pe.xml | 2 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
13 files changed, 163 insertions, 7 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index bf9af64df..86bc7834d 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2021.11.05 12:33} +\newcontextversion{2021.11.05 15:54} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 31a4e6a86..78d89a9a5 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2021.11.05 12:33} +\edef\contextversion{2021.11.05 15:54} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii index f8a7617df..410fa7590 100644 --- a/tex/context/base/mkii/mult-pe.mkii +++ b/tex/context/base/mkii/mult-pe.mkii @@ -315,6 +315,7 @@ \setinterfacevariable{lefthanging}{آویزانچپ} \setinterfacevariable{leftmargin}{حاشیهچپ} \setinterfacevariable{leftpage}{صفحهچپ} +\setinterfacevariable{lefttext}{متنچپ} \setinterfacevariable{lefttoright}{lefttoright} \setinterfacevariable{legend}{راهنما} \setinterfacevariable{less}{less} @@ -476,6 +477,7 @@ \setinterfacevariable{righthanging}{آویزانکردنراست} \setinterfacevariable{rightmargin}{حاشیهراست} \setinterfacevariable{rightpage}{صفحهراست} +\setinterfacevariable{righttext}{متنراست} \setinterfacevariable{righttoleft}{righttoleft} \setinterfacevariable{roman}{رومن} \setinterfacevariable{romannumerals}{شمارهلاتین} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 61b417145..3c7eca483 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.11.05 12:33} +\newcontextversion{2021.11.05 15:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 4b88b06e9..3b3d9368f 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.11.05 12:33} +\edef\contextversion{2021.11.05 15:54} %D Kind of special: diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex c75fcc69f..6bab9c707 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 102012b26..64c280124 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 727f63268..9c3cde2c5 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.11.05 12:33} +\newcontextversion{2021.11.05 15:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 11cd22e91..c009461ed 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2021.11.05 12:33} +\immutable\edef\contextversion{2021.11.05 15:54} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/typo-adj.lmt b/tex/context/base/mkxl/typo-adj.lmt new file mode 100644 index 000000000..53abe4f1d --- /dev/null +++ b/tex/context/base/mkxl/typo-adj.lmt @@ -0,0 +1,90 @@ +if not modules then modules = { } end modules ['typo-adj'] = { + version = 1.001, + optimize = true, + comment = "companion to typo-adj.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local nodecodes = nodes.nodecodes +local hlist_code = nodecodes.hlist +local penalty_code = nodecodes.penalty + +local nuts = nodes.nuts +local getprev = nuts.getprev +local getid = nuts.getid +----- getattr = nuts.getattribute +local getdepth = nuts.getdepth +local newglue = nuts.pool.glue +local insertafter = nuts.insert_after + +----- a_adjuster = attributes.system("adjuster") + +local function correct_depth(head,tail) + local prev = getprev(tail) + if getid(prev) == penalty_code then -- linebreakpenalty + prev = getprev(prev) + end + if getid(prev) == hlist_code then -- line + local delta = getdepth(tail) - getdepth(prev) + if delta > 0 then + head = insertafter(head,prev,newglue(delta)) + end + tex.prevdepth = getdepth(tail) + end + return head +end + +local function block_baselineskip(head,tail) + tex.prevdepth = -1000 * 65536 -- ignoredepth + return head +end + +local preactions = { + [1] = correct_depth, + [2] = block_baselineskip, +} + +local postactions = { + [1] = correct_depth, + [2] = block_baselineskip, +} + +-- function nodes.handlers.adjusters(head,where,tail) +-- if where == "pre_adjust" then +-- local a = getattr(tail,a_adjuster) +-- if a then +-- a = preactions[a] +-- if a then +-- head = a(head,tail) +-- end +-- end +-- elseif where == "post_adjust" then +-- local a = getattr(tail,a_adjuster) +-- if a then +-- a = postactions[a] +-- if a then +-- head = a(head,tail) +-- end +-- end +-- else +-- -- can't happen +-- end +-- return head +-- end + +function nodes.handlers.adjusters(head,where,tail,index) + if where == "pre_adjust" then + local a = preactions[index] + if a then + head = a(head,tail) + end + else -- if where == "post_adjust" then + local a = postactions[index] + if a then + head = a(head,tail) + end + end + return head +end diff --git a/tex/context/base/mkxl/typo-adj.mkxl b/tex/context/base/mkxl/typo-adj.mkxl new file mode 100644 index 000000000..9a85b3009 --- /dev/null +++ b/tex/context/base/mkxl/typo-adj.mkxl @@ -0,0 +1,62 @@ +%D \module +%D [ file=typo-adj, +%D version=2021.11.02, +%D title=\CONTEXT\ Typesetting Macros, +%D subtitle=Adjusters, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This is preliminary (mostly test) code ... for it to be useful we also need to +% add some spacing options as well as penalty control. So far I never needed this +% but who knows. + +\writestatus{loading}{ConTeXt Typesetting Macros / Adjusters} + +\registerctxluafile{typo-adj}{autosuffix} + +% \definesystemattribute[adjuster][public] + +\unprotect + +%D \starttyping +%D \start \showboxes +%D \dorecurse{20}{test #1 } +%D \insertlinebefore{BEFORE 1} +%D \insertlineafter {AFTER 1} +%D \dorecurse{20}{test #1 } +%D \dorecurse{20}{test #1 } +%D \insertlinebefore{BEFORE 2} +%D \insertlineafter {AFTER 2} +%D \dorecurse{20}{test #1 } +%D \stop +%D \stoptyping + +\def\typo_adjusters_line#1% no need for speed + {\begingroup + \dowithnextbox + {\ht\nextbox\strutht + \dp\nextbox\strutdp + %\boxattribute\nextbox \adjusterattribute \plusone + \vadjust #1 index \plusone {\box\nextbox}% + \endgroup}% + \hbox} + +\tolerant\def\typo_adjusters_blank#1[#2]% no need for speed + {\begingroup + % \setbox\scratchbox\vbox{\ifcstok{#2}\emptytoks\blank\else\blank[#2]\fi}% + \setbox\scratchbox\vbox{\blank[#2]}% + \vadjust #1 index \plustwo {\vskip\htdp\scratchbox}% + \endgroup} + +\permanent\protected\def\insertlinebefore{\typo_adjusters_line{pre}} +\permanent\protected\def\insertlineafter {\typo_adjusters_line{post}} + +\permanent\protected\def\insertblankbefore{\typo_adjusters_blank{pre}} +\permanent\protected\def\insertblankafter {\typo_adjusters_blank{post}} + +\protect \endinput diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml index e27f2a2d6..76f6d8117 100644 --- a/tex/context/interface/mkii/keys-pe.xml +++ b/tex/context/interface/mkii/keys-pe.xml @@ -318,6 +318,7 @@ <cd:variable name='lefthanging' value='آویزانچپ'/> <cd:variable name='leftmargin' value='حاشیهچپ'/> <cd:variable name='leftpage' value='صفحهچپ'/> + <cd:variable name='lefttext' value='متنچپ'/> <cd:variable name='lefttoright' value='lefttoright'/> <cd:variable name='legend' value='راهنما'/> <cd:variable name='less' value='less'/> @@ -479,6 +480,7 @@ <cd:variable name='righthanging' value='آویزانکردنراست'/> <cd:variable name='rightmargin' value='حاشیهراست'/> <cd:variable name='rightpage' value='صفحهراست'/> + <cd:variable name='righttext' value='متنراست'/> <cd:variable name='righttoleft' value='righttoleft'/> <cd:variable name='roman' value='رومن'/> <cd:variable name='romannumerals' value='شمارهلاتین'/> diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 693fa599f..61089b31d 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2021-11-05 12:33 +-- merge date : 2021-11-05 15:54 do -- begin closure to overcome local limits and interference |