diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4171 -> 4166 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/file-mod.mkvi | 10 | ||||
-rw-r--r-- | tex/context/base/font-gds.lua | 29 | ||||
-rw-r--r-- | tex/context/base/font-otc.lua | 120 | ||||
-rw-r--r-- | tex/context/base/pack-mrl.mkiv | 6 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24361 -> 24390 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 257830 -> 258601 bytes | |||
-rw-r--r-- | tex/context/base/tabl-ltb.mkiv | 780 | ||||
-rw-r--r-- | tex/context/base/toks-scn.lua | 8 | ||||
-rw-r--r-- | tex/context/base/type-imp-cambria.mkiv | 8 | ||||
-rw-r--r-- | tex/context/base/typo-inj.lua | 32 | ||||
-rw-r--r-- | tex/context/base/typo-inj.mkiv | 21 | ||||
-rw-r--r-- | tex/context/fonts/cambria.lfg | 16 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
16 files changed, 589 insertions, 447 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index bef916274..eb7dd28f6 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.01.07 13:38} +\newcontextversion{2016.01.08 16:02} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 5f938ae29..e310bb563 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 2a44f12ea..852561092 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.01.07 13:38} +\edef\contextversion{2016.01.08 16:02} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/file-mod.mkvi b/tex/context/base/file-mod.mkvi index 8025da6ea..ebd741d42 100644 --- a/tex/context/base/file-mod.mkvi +++ b/tex/context/base/file-mod.mkvi @@ -93,14 +93,14 @@ \unexpanded\def\setupmodule {\dodoubleempty\syst_modules_setup} -\def\syst_modules_setup_indeed +\def\syst_modules_setup {\ifx\currentmoduleparameters\empty - \expandafter\syst_modules_setup_indeed_nop + \expandafter\syst_modules_setup_nop \else - \expandafter\syst_modules_setup_indeed_yes + \expandafter\syst_modules_setup_yes \fi} -\def\syst_modules_setup_indeed_nop[#name][#parameters]% +\def\syst_modules_setup_nop[#name][#parameters]% {\ifsecondargument \getparameters[\??module#name:][#parameters]% internal (defaults) \else\iffirstargument @@ -108,7 +108,7 @@ \fi\fi \the\everysetupmodule} -\def\syst_modules_setup_indeed_yes[#name][#parameters]% +\def\syst_modules_setup_yes[#name][#parameters]% {\scratchtoks\expandafter{\currentmoduleparameters}% \ifsecondargument \getparameters[\??module#name:][#parameters]% internal (defaults) diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua index 9fbe1e844..23bbad42f 100644 --- a/tex/context/base/font-gds.lua +++ b/tex/context/base/font-gds.lua @@ -447,6 +447,24 @@ local function setextrafeatures(tfmdata) end end +local function setextensions(tfmdata) + local goodies = tfmdata.goodies + if goodies then + for i=1,#goodies do + local g = goodies[i] + local e = g.extensions + if e then + local goodie = g.name or "unknown" + for i=1,#e do + local name = "extension-" .. i + -- report_goodies("adding extension %s from %s",name,goodie) + otf.enhancers.addfeature(tfmdata.shared.rawdata,name,e[i]) + end + end + end + end +end + -- installation (collected to keep the overview) -- also for type 1 registerotffeature { @@ -471,6 +489,17 @@ registerotffeature { } registerotffeature { + name = "extensions", + description = "extensions to features", + default = true, + initializers = { + position = 2, + base = setextensions, + node = setextensions, + } +} + +registerotffeature { name = "featureset", description = "goodie feature set", initializers = { diff --git a/tex/context/base/font-otc.lua b/tex/context/base/font-otc.lua index 393dbbe87..0cc7b58b0 100644 --- a/tex/context/base/font-otc.lua +++ b/tex/context/base/font-otc.lua @@ -28,6 +28,7 @@ local normalized = { alternate = "alternate", multiple = "multiple", kern = "kern", + pair = "pair", chainsubstitution = "chainsubstitution", chainposition = "chainposition", } @@ -38,6 +39,7 @@ local types = { alternate = "gsub_alternate", multiple = "gsub_multiple", kern = "gpos_pair", + pair = "gpos_pair", chainsubstitution = "gsub_contextchain", chainposition = "gpos_contextchain", } @@ -57,10 +59,15 @@ local function addfeature(data,feature,specifications) if not features or not sequences then return end - local gsubfeatures = features.gsub - if gsubfeatures and gsubfeatures[feature] then - return -- already present - end + -- feature has to be unique but the name entry wins eventually + -- local gsubfeatures = features.gsub + -- if gsubfeatures and gsubfeatures[feature] then + -- return -- already present + -- end + -- local gposfeatures = features.gpos + -- if gposfeatures and gposfeatures[feature] then + -- return -- already present + -- end -- todo alse gpos @@ -236,7 +243,34 @@ local function addfeature(data,feature,specifications) skip = skip + 1 end end - return coverage, "kern" + return coverage + end + + local function prepare_pair(list,featuretype) + local coverage = { } + local cover = coveractions[featuretype] + for code, replacement in next, list do + local unicode = tounicode(code) + local description = descriptions[unicode] + if description and type(replacement) == "table" then + local r = { } + for k, v in next, replacement do + local u = tounicode(k) + if u then + r[u] = v + end + end + if next(r) then + cover(coverage,unicode,r) + done = done + 1 + else + skip = skip + 1 + end + else + skip = skip + 1 + end + end + return coverage end local function prepare_chain(list,featuretype,sublookups) @@ -332,6 +366,7 @@ local function addfeature(data,feature,specifications) for s=1,#specifications do local specification = specifications[s] local valid = specification.valid + local feature = specification.name or feature if not valid or valid(data,specification,feature) then local initialize = specification.initialize if initialize then @@ -347,6 +382,7 @@ local function addfeature(data,feature,specifications) local nofsteps = 0 local steps = { } local sublookups = specification.lookups + local category = nil if sublookups then local s = { } for i=1,#sublookups do @@ -361,15 +397,19 @@ local function addfeature(data,feature,specifications) local coverage = nil local format = nil if featuretype == "substitution" then - coverage, format = prepare_substitution(list,featuretype) + coverage = prepare_substitution(list,featuretype) elseif featuretype == "ligature" then - coverage, format = prepare_ligature(list,featuretype) + coverage = prepare_ligature(list,featuretype) elseif featuretype == "alternate" then - coverage, format = prepare_alternate(list,featuretype) + coverage = prepare_alternate(list,featuretype) elseif featuretype == "multiple" then - coverage, format = prepare_multiple(list,featuretype) + coverage = prepare_multiple(list,featuretype) elseif featuretype == "kern" then - coverage, format = prepare_kern(list,featuretype) + format = "kern" + coverage = prepare_kern(list,featuretype) + elseif featuretype == "pair" then + format = "pair" + coverage = prepare_pair(list,featuretype) end if coverage and next(coverage) then nofsteps = nofsteps + 1 @@ -389,17 +429,31 @@ local function addfeature(data,feature,specifications) local coverage = nil local format = nil if featuretype == "substitution" then - coverage, format = prepare_substitution(list,featuretype) + category = "gsub" + coverage = prepare_substitution(list,featuretype) elseif featuretype == "ligature" then - coverage, format = prepare_ligature(list,featuretype) + category = "gsub" + coverage = prepare_ligature(list,featuretype) elseif featuretype == "alternate" then - coverage, format = prepare_alternate(list,featuretype) + category = "gsub" + coverage = prepare_alternate(list,featuretype) elseif featuretype == "multiple" then - coverage, format = prepare_multiple(list,featuretype) + category = "gsub" + coverage = prepare_multiple(list,featuretype) elseif featuretype == "kern" then - coverage, format = prepare_kern(list,featuretype) - elseif featuretype == "chainsubstitution" or featuretype == "chainposition" then - coverage, format = prepare_chain(list,featuretype,sublookups) + category = "gpos" + format = kern + coverage = prepare_kern(list,featuretype) + elseif featuretype == "pair" then + category = "gpos" + format = "pair" + coverage = prepare_pair(list,featuretype) + elseif featuretype == "chainsubstitution" then + category = "gsub" + coverage = prepare_chain(list,featuretype,sublookups) + elseif featuretype == "chainposition" then + category = "gpos" + coverage = prepare_chain(list,featuretype,sublookups) end if coverage and next(coverage) then nofsteps = nofsteps + 1 @@ -420,26 +474,40 @@ local function addfeature(data,feature,specifications) chain = featurechain, features = { [feature] = askedfeatures }, flags = featureflags, - name = feature, -- not needed + name = feature, -- redundant order = featureorder, [stepkey] = steps, nofsteps = nofsteps, type = types[featuretype], } + -- todo : before|after|index if specification.prepend then insert(sequences,1,sequence) else insert(sequences,sequence) end -- register in metadata (merge as there can be a few) - if not gsubfeatures then - gsubfeatures = { } - fontfeatures.gsub = gsubfeatures - end - local k = gsubfeatures[feature] - if not k then - k = { } - gsubfeatures[feature] = k + local k = nil + if category == "gpos" then + if not gposfeatures then + gposfeatures = { } + fontfeatures.gpos = gposfeatures + end + k = gposfeatures[feature] + if not k then + k = { } + gposfeatures[feature] = k + end + else + if not gsubfeatures then + gsubfeatures = { } + fontfeatures.gsub = gsubfeatures + end + k = gsubfeatures[feature] + if not k then + k = { } + gsubfeatures[feature] = k + end end for script, languages in next, askedfeatures do local kk = k[script] diff --git a/tex/context/base/pack-mrl.mkiv b/tex/context/base/pack-mrl.mkiv index a97c9e6f8..e8f89da8e 100644 --- a/tex/context/base/pack-mrl.mkiv +++ b/tex/context/base/pack-mrl.mkiv @@ -57,9 +57,9 @@ \fi\fi \useblackrulesstyleandcolor\c!style\c!color \vrule - \s!width \ifx\p_width \v!max\emwidth\else\p_width \fi - \s!height\ifx\p_height\v!max\strutht\else\p_height\fi - \s!depth \ifx\p_depth \v!max\strutdp\else\p_depth \fi + \ifx\p_width \v!max\s!width \emwidth\else\ifx\p_width \empty\else\s!width \p_width \fi\fi + \ifx\p_height\v!max\s!height\strutht\else\ifx\p_height\empty\else\s!height\p_height\fi\fi + \ifx\p_depth \v!max\s!depth \strutdp\else\ifx\p_depth \empty\else\s!depth \p_depth \fi\fi \egroup} \setupblackrules diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 4bab1ac7f..bc59d9a12 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 871897ac1..d1b7f4877 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/tabl-ltb.mkiv b/tex/context/base/tabl-ltb.mkiv index 4c892138e..b0e3f52e4 100644 --- a/tex/context/base/tabl-ltb.mkiv +++ b/tex/context/base/tabl-ltb.mkiv @@ -1,6 +1,6 @@ %D \module %D [ file=tabl-ltb, -%D version=2002.10.31, +%D version=2002.10.31, % updated 2016.01.08 %D title=\CONTEXT\ Table Macros, %D subtitle=Line Tables, %D author=Hans Hagen, @@ -11,17 +11,13 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% testfile: tfmetrics.tex - -% todo: als nx>1, dan in geval van rek tussenruimte berekenen en optellen -% bij breedte, dus: nx nog niet gebruiken in combinatie met rek ! ! ! ! ! - -% This module is experimental, undocumented, and currently only set up -% eTeX. It provides a mechanism for typesetting very large tables, -% spanning many pages horizontally and vertically, with repeated -% header lines and (entry) columns, tab tracking, color, etc. In does -% two passes over a table, which is why the table goes into a -% buffer or file. As said, tables can be real huge. +%D This module was made for some special project where we needed to typeset tables +%D spanning spanning many pages horizontally and vertically, with repeated header +%D lines and (entry) columns, tab tracking, color, etc. We do two passes over a +%D table, which is why the table can go into a buffer or file. As said, tables can +%D be real huge but performance is still quite okay (there is room for some speed +%D up). The code has been adapted to \MKIV\ but the functionality is the same as in +%D \MKII. % \BH \BC .. \EC \BC .. \EC \EH % append % \BR \BC .. \EC \BC .. \EC \ER @@ -59,171 +55,183 @@ \unprotect -\newconstant\linetablesplitstate -\newconstant\linetableheadstate -\newconstant\linetablemode +\installcorenamespace{linetable} +\installcorenamespace{linetablepart} +\installcorenamespace{linetablewidth} +\installcorenamespace{linetableheight} +\installcorenamespace{linetabledepth} + +\newconditional \c_tabl_lines_preroll +\newconditional \c_tabl_lines_in_table -\definesystemvariable {le} % LinetablE +\newdimen \d_tabl_lines_width +\newdimen \d_tabl_lines_height +%newdimen \d_tabl_lines_depth -\edef\??ler{\??le:r:} -\edef\??lec{\??le:c:} -\edef\??lew{\??le:w:} -\edef\??leh{\??le:h:} -\edef\??led{\??le:d:} +\newbox \b_tabl_lines_cell -\newif\iflinetablepreroll -\newif\ifinlinetable +\newcount \c_tabl_lines_n_of_columns +\newcount \c_tabl_lines_n_of_rows +\newcount \c_tabl_lines_n_of_lines +\newcount \c_tabl_lines_n_of_parts +\newcount \c_tabl_lines_part \c_tabl_lines_part\plusone +\newcount \c_tabl_lines_step \c_tabl_lines_step\plusone +\newcount \c_tabl_lines_line +\newcount \c_tabl_lines_row +\newcount \c_tabl_lines_rows +\newcount \c_tabl_lines_column +\newcount \c_tabl_lines_subcol -\newcount\linetablecolumn -\newcount\linetablesubcol -\newdimen\linetablewidth -\newdimen\linetableheight -\newbox \linetablecell +\newconstant \c_tabl_lines_hmode +\newconstant \c_tabl_lines_page +\newconstant \c_tabl_lines_repeat +\newconstant \c_tabl_lines_split_state +\newconstant \c_tabl_lines_head_state +\newconstant \c_tabl_lines_mode -\let\noflinetablecolumns\!!zerocount -\let\noflinetablerows \!!zerocount -\let\noflinetablelines \!!zerocount -\let\noflinetableparts \!!zerocount -\let\linetablepart \!!plusone -\let\linetablestep \!!plusone -\let\linetableline \!!zerocount -\let\linetablerow \!!zerocount -\let\linetablerows \!!zerocount +\newtoks \t_tabl_lines_head -\initializetablebox \zerocount % holds repeater +\newconditional \linetableautoheight \settrue\linetableautoheight -\newconstant\linetablehmode -\newconstant\linetablepage -\newconstant\linetablerepeat +\initializetablebox\zerocount % holds repeater \unexpanded\def\setuplinetable - {\dotripleempty\dosetuplinetable} + {\dotripleempty\tabl_lines_setup} -\def\dosetuplinetable[#1][#2][#3]% +\def\tabl_lines_setup[#1][#2][#3]% {\ifthirdargument - \getparameters[\??le:#1:#2][#3]% + \getparameters[\??linetable#1:#2][#3]% \else\ifsecondargument - \getparameters[\??lec#1][#2]% + \getparameters[\??linetable#1:][#2]% \else - \getparameters[\??le][#1]% + \getparameters[\??linetable][#1]% \fi\fi} \setuplinetable - [\c!n=\!!maxcard, - \c!lines=\!!maxcard, + [\c!n=\maxcard, + \c!lines=\maxcard, \c!nx=\plusone, - \c!nleft=0, - \c!repeat=\v!yes, % when \c!nleft>0, repeat on both pages + \c!nleft=\zerocount, + \c!repeat=\v!yes, % when nleft > 0, repeat on both pages \c!before=, \c!after=, \c!inbetween=\page, \c!distance=\zeropoint, \c!stretch=\v!no, \c!align=\c!right, - \c!leftoffset=.25ex, + \c!leftoffset=.25\exheight, \c!rightoffset=\linetableparameter\c!leftoffset, \c!maxwidth=\zeropoint, - \c!width=5em, + \c!width=5\emwidth, \c!height=\v!fit, % \v!line = faster \c!background=, \c!backgroundcolor=] - + \def\linetableparameter#1% - {\csname\??le#1\endcsname} + {\begincsname\??linetable#1\endcsname} -\def\doifelselinetablecparameter#1% - {\ifcsname\??lec\number\linetablecolumn#1\endcsname +\unexpanded\def\doifelselinetablecparameter#1% + {\ifcsname\??linetable c:\number\c_tabl_lines_column#1\endcsname \expandafter\firstoftwoarguments + \else\ifcsname\??linetable c:#1\endcsname + \doubleexpandafter\firstoftwoarguments \else - \expandafter\secondoftwoarguments - \fi} + \doubleexpandafter\secondoftwoarguments + \fi\fi} \let\doiflinetablecparameterelse\doifelselinetablecparameter \def\linetablecparameter#1% - {\csname - \ifcsname\??lec\number\linetablecolumn#1\endcsname - \??lec\number\linetablecolumn - \else - \??le - \fi - #1\endcsname} + {\begincsname + \??linetable + \ifcsname\??linetable c:\number\c_tabl_lines_column#1\endcsname + c:\number\c_tabl_lines_column + \else\ifcsname\??linetable c:#1\endcsname + c:% + \fi\fi + #1% + \endcsname} \def\linetablerparameter#1% faster, leaner and meaner - {\csname - \ifnum\linetablerow=\zerocount % geen ifcase - \ifcsname\??ler\v!header#1\endcsname - \??ler\v!header#1% - \else\ifcsname\??ler0#1\endcsname - \??ler0#1% - \else - \s!empty + {\begincsname + \??linetable + \ifnum\c_tabl_lines_row=\zerocount % geen ifcase + \ifcsname\??linetable r:\v!header#1\endcsname + r:\v!header + \else\ifcsname\??linetable r:0#1\endcsname + r:0% \fi\fi \else - \ifcsname\??ler\number\linetablerow#1\endcsname - \??ler\number\linetablerow#1% - \else\ifcsname\??ler\v!oddeven\linetablerow#1\endcsname - \??ler\v!oddeven\linetablerow#1% - \else - \s!empty + \ifcsname\??linetable r:\number\c_tabl_lines_row#1\endcsname + r:\number\c_tabl_lines_row + \else\ifcsname\??linetable r:\v!oddeven\c_tabl_lines_row#1\endcsname + r:\v!oddeven\c_tabl_lines_row \fi\fi \fi + #1% \endcsname} - -\def\setnoftableslines - {\doifelse{\linetableparameter\c!lines}\v!fit - {% whitespace already added by vertical strut - \ifdim\pagegoal<\maxdimen - \scratchdimen\pagegoal - \advance\scratchdimen -\pagetotal - \else - \scratchdimen\textheight - \fi - \getrawnoflines\scratchdimen - \xdef\noflinetablelines{\the\noflines} -\iflinetablepreroll \else \ifnum\noflinetablelines<\plustwo - \page \setnoftableslines -\fi \fi -} - {\xdef\noflinetablelines{\linetableparameter\c!lines}}} - + +\unexpanded\def\tabl_lines_set + {\edef\p_lines{\linetableparameter\c!lines}% + \ifx\p_lines\v!fit + \tabl_lines_set_indeed + \else + \global\c_tabl_lines_n_of_lines\p_lines + \fi} + +\unexpanded\def\tabl_lines_set_indeed + {% whitespace already added by vertical strut + %\triggerpagebuilder + \scratchdimen + \ifdim\pagegoal<\maxdimen + \dimexpr\pagegoal-\pagetotal\relax + \else + \textheight + \fi + \getrawnoflines\scratchdimen + \global\c_tabl_lines_n_of_lines\noflines + \ifconditional\c_tabl_lines_preroll \else \ifnum\c_tabl_lines_n_of_lines<\plustwo + \page + \tabl_lines_set + \fi \fi} + \unexpanded\def\startlinetablecell - {\dosingleempty\dostartlinetablecell} + {\dosingleempty\tabl_lines_start_cell} -\def\dostartlinetablecell[#1]% - {\global\setbox\linetablecell\hbox\bgroup +\def\tabl_lines_step_cell + {\advance\scratchdimen\linetablecparameter\c!width + \global\advance \c_tabl_lines_column\plusone + \advance\scratchskip \linetablecparameter\c!distance} + +\def\tabl_lines_start_cell[#1]% + {\global\setbox\b_tabl_lines_cell\hbox\bgroup \iffirstargument - \getparameters[\??lec\number\linetablecolumn][#1]% + \getparameters[\??linetable c:\number\c_tabl_lines_column][#1]% \fi - \xdef\linetablestep{\linetablecparameter\c!nx}% - \ifcase\linetablestep\or + \global\c_tabl_lines_step\linetablecparameter\c!nx\relax + \ifcase\c_tabl_lines_step\or \scratchdimen\linetablecparameter\c!width \scratchskip \linetablecparameter\c!distance \else \scratchdimen \zeropoint \scratchskip \zeropoint - \scratchcounter\linetablecolumn - \dorecurse\linetablestep - {\advance\scratchdimen\linetablecparameter\c!width - %\advance\scratchskip \linetablecparameter\c!distance - \global\advance \linetablecolumn\plusone - \advance\scratchskip \linetablecparameter\c!distance - }% - \global\linetablecolumn\scratchcounter + \scratchcounter\c_tabl_lines_column + \dorecurse\c_tabl_lines_step\tabl_lines_step_cell + \global\c_tabl_lines_column\scratchcounter \fi - \linetablemode - \iflinetablepreroll + \c_tabl_lines_mode + \ifconditional\c_tabl_lines_preroll \ifdim\scratchdimen>\zeropoint \zerocount \else \plustwo \fi \else \zerocount \fi - \ifcase\linetablemode - \ifcase\linetablehmode + \ifcase\c_tabl_lines_mode + \ifcase\c_tabl_lines_hmode % nothing \or % fit, keep it simple \or - \linetablemode\plusone % line + \c_tabl_lines_mode\plusone % line \else % some already calculated height \fi @@ -235,29 +243,27 @@ % 0 = width, unknown height % 1 = width, fixed height % 2 = no width, auto hsize - \ifnum\linetablemode<\plustwo + \ifnum\c_tabl_lines_mode<\plustwo \advance\scratchdimen-\linetablecparameter\c!leftoffset \advance\scratchdimen-\linetablecparameter\c!rightoffset \fi - \ifcase\linetablemode + \ifcase\c_tabl_lines_mode \dosetraggedcommand{\linetablecparameter\c!align}% - \vtop \ifdim\linetableheight>\zeropoint to\linetableheight \fi \bgroup + \vtop \ifdim\d_tabl_lines_height>\zeropoint to\d_tabl_lines_height \fi \bgroup \hsize\scratchdimen \raggedcommand \else \setalignmentswitch{\linetablecparameter\c!align}% - \hbox \ifcase\linetablemode \or to\scratchdimen \fi \bgroup + \hbox \ifcase\c_tabl_lines_mode \or to\scratchdimen \fi \bgroup \ifcase\alignmentswitch\hss\or\hss\fi \fi - \dousestylehashparameter{\??lec\number\linetablecolumn}\c!style - \dousecolorhashparameter{\??lec\number\linetablecolumn}\c!color + \dousestyleparameter{\linetablecparameter\c!style}% + \dousecolorparameter{\linetablecparameter\c!color}% \begstrut \ignorespaces} -\newconditional\linetableautoheight \settrue\linetableautoheight - \unexpanded\def\stoplinetablecell {\unskip \endstrut - \ifcase\linetablemode + \ifcase\c_tabl_lines_mode \endgraf \else \ifcase\alignmentswitch\else\hss\fi @@ -265,31 +271,46 @@ \egroup \hskip\linetablecparameter\c!rightoffset \egroup - \iflinetablepreroll + \ifconditional\c_tabl_lines_preroll \box\scratchbox \else - \doifelse{\linetablecparameter\c!background}\v!color - {\ifconditional\linetableautoheight - \hbox{\blackrule - [ \c!color=\linetablecparameter\c!backgroundcolor, - \c!height=\linetablerparameter{x\c!height}, - \c!depth=\linetablerparameter{x\c!depth}, - \c!width=\wd\scratchbox]% - \hskip-\wd\scratchbox\box\scratchbox}% - \else - \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% - \fi}% - {\box\scratchbox}% + \tabl_lines_wrap_up \fi \egroup} -\def\savelinetablepart - {\global\setbox\tablebox\linetablepart - \ifnum\linetablepart=\zerocount +\def\tabl_lines_wrap_up + {\edef\p_background{\linetablecparameter\c!background}% + \ifx\p_background\v!color + \ifconditional\linetableautoheight + \tabl_lines_wrap_up_auto + \else + \tabl_lines_wrap_up_line + \fi + \else + \box\scratchbox + \fi} + +\def\tabl_lines_wrap_up_auto + {\edef\p_height{\linetablerparameter{x\c!height}}% + \edef\p_depth {\linetablerparameter{x\c!depth }}% + \hbox + {\blackrule + [ \c!color=\linetablecparameter\c!backgroundcolor, + \c!height=\ifx\p_height\empty\ht\scratchbox\else\p_height\fi, + \c!depth=\ifx\p_depth \empty\dp\scratchbox\else\p_depth \fi, + \c!width=\wd\scratchbox]% + \hskip-\wd\scratchbox\box\scratchbox}} + +\def\tabl_lines_wrap_up_line + {\backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}} + +\def\tabl_lines_save_part + {\global\setbox\tablebox\c_tabl_lines_part + \ifnum\c_tabl_lines_part=\zerocount \box\scratchbox % just storing \else \vbox - {\ifvoid\tablebox\linetablepart\else\unvbox\tablebox\linetablepart\fi + {\ifvoid\tablebox\c_tabl_lines_part\else\unvbox\tablebox\c_tabl_lines_part\fi \doif{\linetablerparameter\c!background}\v!color {\backgroundline[\linetablerparameter\c!backgroundcolor]}% {\box\scratchbox}% is also arg to \backgroundline @@ -297,86 +318,90 @@ \linetablerparameter\c!after}% \fi} -\def\flushlinetableparts - {\doglobal\increment\linetableline - \ifnum\linetableline<\noflinetablelines +\def\tabl_lines_flush_parts + {\global\advance\c_tabl_lines_line\plusone + \ifnum\c_tabl_lines_line<\c_tabl_lines_n_of_lines % keep collecting \else - \iflinetablepreroll + \ifconditional\c_tabl_lines_preroll % forget about them \else - \dorecurse\noflinetableparts - {\let\linetablepart\recurselevel - \dp\tablebox\linetablepart\strutdepth + \dorecurse\c_tabl_lines_n_of_parts + {\c_tabl_lines_part\recurselevel + \dp\tablebox\c_tabl_lines_part\strutdepth % noindent en endgraf needed else whitespace mess-up! \whitespace % here not after verticalstrut \ifdim\topskipgap=\zeropoint\else - \verticalstrut\nobreak\kern-\struttotal\kern-\parskip\nobreak\nointerlineskip % fix topskip + \verticalstrut + \nobreak + \kern-\struttotal + \kern-\parskip + \nobreak + \nointerlineskip % fix topskip \fi - \noindent\strut\hbox to \hsize{\box\tablebox\linetablepart\hss}\endgraf - \ifnum\linetablepart<\noflinetableparts\relax + \noindent\strut + \hbox to \hsize{\box\tablebox\c_tabl_lines_part\hss}% + \endgraf + \ifnum\c_tabl_lines_part<\c_tabl_lines_n_of_parts\relax \linetableparameter\c!inbetween \fi}% - \ifnum\linetablerows<\noflinetablerows\relax + \ifnum\c_tabl_lines_rows<\c_tabl_lines_n_of_rows \linetableparameter\c!inbetween \else % after, later \fi - \linetableheadstate\plusthree + \c_tabl_lines_head_state\plusthree \global\setbox\tablebox\zerocount\emptybox % here \fi - % reset \linetablerow will be an option, currently + % reset \c_tabl_lines_row will be an option, currently % starts at zero after split - \globallet\linetablerow\!!zerocount - \globallet\linetableline\!!zerocount - \global\linetablepage\zerocount - \global\linetablewidth\zeropoint - \setnoftableslines + \global\c_tabl_lines_row\zerocount + \global\c_tabl_lines_line\zerocount + \global\c_tabl_lines_page\zerocount + \global\d_tabl_lines_width\zeropoint + \tabl_lines_set \fi} - -\unexpanded\def\startlinetablepart - {\global\linetablesubcol\zerocount + +\def\tabl_lines_start_part + {\global\c_tabl_lines_subcol\zerocount \setbox\scratchbox\hbox\bgroup \dousestyleparameter{\linetablerparameter\c!style}% \dousecolorparameter{\linetablerparameter\c!color}% \ignorespaces} -\unexpanded\def\stoplinetablepart - {\ifnum\linetablepart>\zerocount +\def\tabl_lines_stop_part + {\ifnum\c_tabl_lines_part>\zerocount \unskip \unskip % remove last intercolumn skip (distance+fill) \fi \egroup - \iflinetablepreroll \else - \ifcase\linetablepart + \ifconditional\c_tabl_lines_preroll \else + \ifcase\c_tabl_lines_part % we're collecting the repeater \else - \scratchdimen\hsize \advance\scratchdimen-\wd\scratchbox\relax - \ifdim\scratchdimen>\linetableparameter\c!stretch\else - \setbox\scratchbox\hbox to \hsize{\unhbox\scratchbox}% + \ifdim\dimexpr\hsize-\wd\scratchbox\relax>\linetableparameter\c!stretch\else + \setbox\scratchbox\hpack to \hsize{\unhbox\scratchbox}% \fi \fi \fi} -\def\checklinetablepart - {\global\advance\linetablewidth\wd\linetablecell - \global\advance\linetablecolumn\linetablestep - \global\advance\linetablesubcol\linetablestep +\def\tabl_lines_check_part + {\global\advance\d_tabl_lines_width\wd\b_tabl_lines_cell + \global\advance\c_tabl_lines_column\c_tabl_lines_step + \global\advance\c_tabl_lines_subcol\c_tabl_lines_step \relax - %\message{\the\linetablecolumn,\the\linetablesubcol}\wait + %\message{\the\c_tabl_lines_column,\the\c_tabl_lines_subcol}\wait % from now on the column counter is already incremented - \ifcase\linetablesplitstate - \iflinetablepreroll \else - \box\linetablecell + \ifcase\c_tabl_lines_split_state + \ifconditional\c_tabl_lines_preroll \else + \box\b_tabl_lines_cell % the columncounter is one ahead ! -% \hskip\linetablecparameter\c!afstand \hskip\scratchskip \fi %%% \donefalse - \ifcase\linetablerepeat\else - % van te voren berekenen - \scratchcounter\linetablecolumn\advance\scratchcounter-\plustwo - \ifnum\linetablerepeat=\scratchcounter + \ifcase\c_tabl_lines_repeat\else + % calculate ahead + \ifnum\c_tabl_lines_repeat=\numexpr\c_tabl_lines_column-\plustwo\relax \donetrue % collecting repeater \fi \fi @@ -384,85 +409,79 @@ \ifdone % collecting repeater \else - \ifnum\linetablecolumn>\getvalue{\??le::\linetablepart}\relax + \ifnum\c_tabl_lines_column>\csname\??linetablepart\number\c_tabl_lines_part\endcsname\relax \donetrue \fi \fi \ifdone - \stoplinetablepart - \iflinetablepreroll \else - \savelinetablepart + \tabl_lines_stop_part + \ifconditional\c_tabl_lines_preroll \else + \tabl_lines_save_part \fi - \ifcase\linetablepage \or - \global\linetablepage \plustwo + \ifcase\c_tabl_lines_page \or + \global\c_tabl_lines_page \plustwo \else - \global\linetablepage \plusone + \global\c_tabl_lines_page \plusone \fi - \doglobal\increment\linetablepart - \global\linetablewidth\wd\tablebox\zerocount - \startlinetablepart + \global\advance\c_tabl_lines_part\plusone + \global\d_tabl_lines_width\wd\tablebox\zerocount + \tabl_lines_start_part \fi \else \donefalse \!!doneafalse - \ifcase\linetablerepeat\else - % van te voren berekenen - \scratchcounter\linetablecolumn \advance\scratchcounter-\plustwo - \ifnum\linetablerepeat=\scratchcounter + \ifcase\c_tabl_lines_repeat\else + % calculate ahead + \ifnum\c_tabl_lines_repeat=\numexpr\c_tabl_lines_column-\plustwo\relax \donetrue % collecting repeater \fi \fi \ifdone \!!doneatrue % collecting repeater - \else\ifdim\linetablewidth>\hsize + \else\ifdim\d_tabl_lines_width>\hsize \donetrue \else -% \global\advance\linetablewidth\linetablecparameter\c!afstand\relax - \global\advance\linetablewidth\scratchskip - \ifdim\linetablewidth>\hsize % ? + \global\advance\d_tabl_lines_width\scratchskip + \ifdim\d_tabl_lines_width>\hsize % ? \donetrue \fi \fi\fi \ifdone - \stoplinetablepart - \savelinetablepart - \ifcase\linetablepage \or - \global\linetablepage \plustwo + \tabl_lines_stop_part + \tabl_lines_save_part + \ifcase\c_tabl_lines_page \or + \global\c_tabl_lines_page \plustwo \else - \global\linetablepage \plusone + \global\c_tabl_lines_page \plusone \fi - \doglobal\increment\linetablepart - \ifnum\linetablepart>\noflinetableparts - \globallet\noflinetableparts\linetablepart - \initializetablebox\linetablepart + \global\advance\c_tabl_lines_part\plusone + \ifnum\c_tabl_lines_part>\c_tabl_lines_n_of_parts + \global\c_tabl_lines_n_of_parts\c_tabl_lines_part + \initializetablebox\c_tabl_lines_part \fi - \global\linetablewidth\wd\linetablecell - \startlinetablepart - \if!!doneb \else \ifcase\linetablerepeat \else + \global\d_tabl_lines_width\wd\b_tabl_lines_cell + \tabl_lines_start_part + \if!!doneb \else \ifcase\c_tabl_lines_repeat \else % check for left/right page - \ifcase\linetablepage\donetrue\or\donetrue\or\donefalse\fi\ifdone + \ifcase\c_tabl_lines_page\donetrue\or\donetrue\or\donefalse\fi\ifdone % insert repeater - \global\advance\linetablewidth\wd\tablebox\zerocount - \iflinetablepreroll\kern\wd\else\unhcopy\fi\tablebox\zerocount + \global\advance\d_tabl_lines_width\wd\tablebox\zerocount + \ifconditional\c_tabl_lines_preroll\kern\wd\else\unhcopy\fi\tablebox\zerocount \fi \fi \fi \fi - \iflinetablepreroll \else - \box\linetablecell + \ifconditional\c_tabl_lines_preroll \else + \box\b_tabl_lines_cell % the columncounter is one ahead ! -% \hskip\linetablecparameter\c!afstand -% \hskip\scratchskip -\dorecurse\linetablestep{\strut\hfil}% + \dorecurse\c_tabl_lines_step{\strut\hfil}% \hskip\scratchskip \fi \fi} - -% \linetableparameter\c!var -> \@@levar (when no classes) \unexpanded\def\startlinetablerun % to do: quit when nested {\bgroup - \inlinetabletrue + \settrue\c_tabl_lines_in_table % autowidth \doif{\linetableparameter\c!maxwidth}\v!fit {\setuplinetable[\c!maxwidth=\zeropoint]}% @@ -470,157 +489,138 @@ [\linetableparameter\c!stretch] [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch \v!yes=>{\setuplinetable[\c!stretch=\zeropoint]}]% max stretch - \linetablerepeat\linetableparameter\c!nleft - \linetablesplitstate % = + \c_tabl_lines_repeat\linetableparameter\c!nleft + \c_tabl_lines_split_state % = \ifdim\linetableparameter\c!maxwidth>\zeropoint \zerocount \else \plusone \fi % optional prevdepth correction - \iflinetablepreroll - \globallet\noflinetablerows\!!zerocount + \ifconditional\c_tabl_lines_preroll + \global\c_tabl_lines_n_of_rows\zerocount \else \linetableparameter\c!before \fi - \globallet\linetablerows\!!zerocount - \globallet\noflinetablecolumns\!!zerocount - \globallet\noflinetableparts\!!zerocount - \!!counta\zerocount + \global\c_tabl_lines_rows\zerocount + \global\c_tabl_lines_n_of_columns\zerocount + \global\c_tabl_lines_n_of_parts\zerocount + \scratchcounter\zerocount \def\docommand##1% - {\doglobal\increment\noflinetableparts - \advance\!!counta##1% - \setxvalue{\??le::\noflinetableparts}{\the\!!counta}}% + {\global\advance\c_tabl_lines_n_of_parts\plusone + \advance\scratchcounter##1% + \setxvalue{\??linetablepart\number\c_tabl_lines_n_of_parts}{\the\scratchcounter}}% \processcommacommand[\linetableparameter\c!n]\docommand - \initializetableboxes\noflinetableparts - \ifcase\linetablerepeat - \globallet\linetablepart\!!plusone - \else - \globallet\linetablepart\!!zerocount % repeater - \fi - \globallet\linetablestep\!!plusone - \globallet\linetableline\!!zerocount - \globallet\linetablerow \!!zerocount - \global\linetablecolumn \zerocount - \global\linetablesubcol \zerocount - \global\linetablewidth \zeropoint -\iflinetablepreroll \else \ifdim\pagetotal>\zeropoint - \verticalstrut\kern-\struttotal -\fi \fi - \setnoftableslines - \checklinetablepage - \let\BR\linetableBR - \let\ER\linetableER - \let\BH\linetableBR - \let\EH\linetableER - \let\BC\linetableBC - \let\EC\linetableEC - \let\NC\linetableNC - \let\NR\linetableNR - \flushlinetablehead} + \initializetableboxes\c_tabl_lines_n_of_parts + \global\c_tabl_lines_part\ifcase\c_tabl_lines_repeat\plusone\else\zerocount\fi % repeater + \global\c_tabl_lines_step\plusone + \global\c_tabl_lines_line\zerocount + \global\c_tabl_lines_row \zerocount + \global\c_tabl_lines_column\zerocount + \global\c_tabl_lines_subcol\zerocount + \global\d_tabl_lines_width\zeropoint + \ifconditional\c_tabl_lines_preroll \else \ifdim\pagetotal>\zeropoint + \verticalstrut\kern-\struttotal + \fi \fi + \tabl_lines_set + \tabl_lines_check_page + \let\BR\tabl_lines_BR + \let\ER\tabl_lines_ER + \let\BH\tabl_lines_BR + \let\EH\tabl_lines_ER + \let\BC\tabl_lines_BC + \let\EC\tabl_lines_EC + \let\NC\tabl_lines_NC + \let\NR\tabl_lines_NR + \tabl_lines_flush_head} \unexpanded\def\stoplinetablerun - {\globallet\linetableline\!!maxcard - \linetableheadstate\zerocount % blocked - \flushlinetableparts - \iflinetablepreroll \else + {\global\c_tabl_lines_line\maxcard + \c_tabl_lines_head_state\zerocount % blocked + \tabl_lines_flush_parts + \ifconditional\c_tabl_lines_preroll \else \linetableparameter\c!after \fi - \globallet\linetablepart \!!zerocount - \globallet\noflinetableparts\!!zerocount + \global\c_tabl_lines_part\zerocount + \global\c_tabl_lines_n_of_parts\zerocount \egroup} \def\checklinecolumndimension#1#2#3% {\expandafter\xdef\csname#1\number#3\endcsname {\expandafter\ifx\csname#1\number#3\endcsname\relax - \the#2\linetablecell - \else\ifdim\csname#1\number#3\endcsname<#2\linetablecell - \the#2\linetablecell + \the#2\b_tabl_lines_cell + \else\ifdim\csname#1\number#3\endcsname<#2\b_tabl_lines_cell + \the#2\b_tabl_lines_cell \else \csname#1\number#3\endcsname \fi\fi}} -\def\checklinecolumnwidth {\checklinecolumndimension\??lew\wd\linetablecolumn} -\def\checklinecolumnheight{\checklinecolumndimension\??leh\ht\linetablerow} -\def\checklinecolumndepth {\checklinecolumndimension\??led\dp\linetablerow} - -\def\linetableBR - {\dosingleempty\dolinetableBR} - -\def\dolinetableBR[#1]% #1 not yet implemented - {\ifnum\linetableheadstate=1\else - \doglobal\increment\linetablerow - \doglobal\increment\linetablerows +\def\tabl_lines_check_width {\checklinecolumndimension\??linetablewidth \wd\c_tabl_lines_column} +\def\tabl_lines_check_height{\checklinecolumndimension\??linetableheight\ht\c_tabl_lines_row} +\def\tabl_lines_check_depth {\checklinecolumndimension\??linetabledepth \dp\c_tabl_lines_row} + +\unexpanded\def\tabl_lines_BR + {\dosingleempty\tabl_lines_BR_indeed} + +\def\tabl_lines_BR_indeed[#1]% #1 not yet implemented + {\ifnum\c_tabl_lines_head_state=1\else + \global\advance\c_tabl_lines_row\plusone + \global\advance\c_tabl_lines_rows\plusone \fi - \global\linetablecolumn\plusone - \global\linetablesubcol\plusone -% \linetableheight\linetablerparameter\c!height -% -% \ifx\linetableheight\empty -% % nothing -% \else\ifx\linetableheight\v!fit -% % keep it simple -% \else\ifx\linetableheight\v!line -% \linetablemode\plusone -% \else -% \!!heighta\linetableheight -% \advance\!!heighta-\strutdepth -% \fi\fi\fi -% - \linetableheight\zeropoint - \edef\!!stringa{\linetablerparameter\c!height}% - \ifx\!!stringa\empty - \linetablehmode\zerocount - \else\ifx\!!stringa\v!fit - \linetablehmode\plusone - \else\ifx\!!stringa\v!line - \linetablehmode\plustwo + \global\c_tabl_lines_column\plusone + \global\c_tabl_lines_subcol\plusone + \d_tabl_lines_height\zeropoint + \edef\p_height{\linetablerparameter\c!height}% + \ifx\p_height\empty + \c_tabl_lines_hmode \zerocount + \else\ifx\p_height\v!fit + \c_tabl_lines_hmode \plusone + \else\ifx\p_height\v!line + \c_tabl_lines_hmode \plustwo \else - \linetableheight\!!stringa - \advance\linetableheight-\strutdepth + \d_tabl_lines_height\dimexpr\p_height-\strutdepth\relax \fi\fi\fi -% - \startlinetablepart} + \tabl_lines_start_part} -\def\linetableBC +\unexpanded\def\tabl_lines_BC {\startlinetablecell} -\def\linetableEC +\unexpanded\def\tabl_lines_EC {\stoplinetablecell - \iflinetablepreroll - \checklinecolumnwidth - \checklinecolumnheight - \checklinecolumndepth + \ifconditional\c_tabl_lines_preroll + \tabl_lines_check_width + \tabl_lines_check_height + \tabl_lines_check_depth \fi - \checklinetablepart} + \tabl_lines_check_part} -\def\linetableER +\unexpanded\def\tabl_lines_ER {% \stoplinetablecell - % no \box\linetablecell, i.e. dummy columnn, last \NC \NR - \stoplinetablepart - \savelinetablepart - \advance\linetablecolumn \minusone - \ifnum\linetablecolumn>\noflinetablecolumns - \xdef\noflinetablecolumns{\number\linetablecolumn}% + % no \box\b_tabl_lines_cell, i.e. dummy columnn, last \NC \NR + \tabl_lines_stop_part + \tabl_lines_save_part + \advance\c_tabl_lines_column \minusone + \ifnum\c_tabl_lines_column>\c_tabl_lines_n_of_columns + \global\c_tabl_lines_n_of_columns\c_tabl_lines_column \fi - \flushlinetableparts - \global\linetablecolumn\zerocount - \global\linetablewidth \zeropoint - \ifcase\linetablerepeat - \globallet\linetablepart\!!plusone + \tabl_lines_flush_parts + \global\c_tabl_lines_column\zerocount + \global\d_tabl_lines_width \zeropoint + \ifcase\c_tabl_lines_repeat + \global\c_tabl_lines_part\plusone \else - \globallet\linetablepart\!!zerocount % repeater + \global\c_tabl_lines_part\zerocount % repeater \fi - \checklinetablepage - \flushlinetablehead} + \tabl_lines_check_page + \tabl_lines_flush_head} -\def\checklinetablepage - {\global\linetablepage\zerocount - \ifcase\linetablerepeat \else \ifcase\linetablepage +\def\tabl_lines_check_page + {\global\c_tabl_lines_page\zerocount + \ifcase\c_tabl_lines_repeat \else \ifcase\c_tabl_lines_page \doif{\linetableparameter\c!repeat}\v!no - {\global\linetablepage\doifelseoddpage\plusone\plustwo}% + {\global\c_tabl_lines_page\doifelseoddpage\plusone\plustwo}% \fi \fi} -\def\flushlinetablehead - {\ifcase\linetableheadstate +\def\tabl_lines_flush_head + {\ifcase\c_tabl_lines_head_state % 0 blocked \or % 1 doing head @@ -628,24 +628,24 @@ % 2 head done \or % 3 trigger flush - \linetableheadstate\plusone - \the\@@linetablehead\relax - \linetableheadstate\plustwo + \c_tabl_lines_head_state\plusone + \the\t_tabl_lines_head\relax + \c_tabl_lines_head_state\plustwo \fi} -\def\linetableNC % first time special treatment +\unexpanded\def\tabl_lines_NC % first time special treatment {\relax - \ifcase\linetablecolumn - \linetableBR + \ifcase\c_tabl_lines_column + \tabl_lines_BR \else - \linetableEC + \tabl_lines_EC \fi - \linetableBC} % beware, this will result in BR BC EC BC NR + \tabl_lines_BC} % beware, this will result in BR BC EC BC NR -\def\linetableNR +\unexpanded\def\tabl_lines_NR {\stoplinetablecell % dummy - \linetableER} - + \tabl_lines_ER} + \unexpanded\def\startlinetable {\startlinetablerun} @@ -654,73 +654,87 @@ \unexpanded\def\startlinetableanalysis {\bgroup - \linetableprerolltrue + \settrue\c_tabl_lines_preroll \settrialtypesetting \startlinetablerun} +% \unexpanded\def\stoplinetableanalysis +% {\stoplinetablerun +% \egroup +% \global\c_tabl_lines_n_of_rows\c_tabl_lines_rows +% \dorecurse\c_tabl_lines_n_of_rows % global, from last run {\linetableparameter\c!n} +% {\setevalue{\??linetable r:\recurselevel x\c!height}{\getvalue{\??linetableheight\recurselevel}}% +% \setevalue{\??linetable r:\recurselevel x\c!depth }{\getvalue{\??linetabledepth \recurselevel}}% +% \letgvalue{\??linetableheight\recurselevel}\!!zeropoint +% \letgvalue{\??linetabledepth \recurselevel}\!!zeropoint} +% \dorecurse\c_tabl_lines_n_of_columns % global, from last run {\linetableparameter\c!n} +% {\setevalue{\??linetable c:\recurselevel\c!width}{\getvalue{\??linetablewidth\recurselevel}}% +% \letgvalue{\??linetablewidth\recurselevel}\!!zeropoint}} % init next table + \unexpanded\def\stoplinetableanalysis {\stoplinetablerun \egroup - \globallet\noflinetablerows\linetablerows - \dorecurse\noflinetablerows % global, from last run {\linetableparameter\c!n} - {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% - \setevalue{\??ler\recurselevel x\c!height}{\getvalue{\??leh\recurselevel}}% - \setevalue{\??ler\recurselevel x\c!depth }{\getvalue{\??led\recurselevel}}% - \letgvalue{\??leh\recurselevel}\!!zeropoint - \letgvalue{\??led\recurselevel}\!!zeropoint} - \dorecurse\noflinetablecolumns % global, from last run {\linetableparameter\c!n} - {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% - \setevalue{\??lec\recurselevel\c!width}{\getvalue{\??lew\recurselevel}}% - \letgvalue{\??lew\recurselevel}\!!zeropoint}} % init next table - + \global\c_tabl_lines_n_of_rows\c_tabl_lines_rows + \dorecurse\c_tabl_lines_n_of_rows % global, from last run {\linetableparameter\c!n} + {\setevalue{\??linetable r:##1x\c!height}{\csname\??linetableheight##1\endcsname}% + \setevalue{\??linetable r:##1x\c!depth }{\csname\??linetabledepth ##1\endcsname}% + \letgvalue{\??linetableheight##1}\zeropoint + \letgvalue{\??linetabledepth ##1}\zeropoint} + \dorecurse\c_tabl_lines_n_of_columns % global, from last run {\linetableparameter\c!n} + {\setevalue{\??linetable c:##1\c!width}{\csname\??linetablewidth##1\endcsname}% + \letgvalue{\??linetablewidth##1}\zeropoint}} % init next table + % todo: store in box instead of macro -\newtoks \@@linetablehead +\let\stoplinetablehead\relax \unexpanded\def\startlinetablehead#1\stoplinetablehead - {\ifinlinetable - \@@linetablehead\emptytoks + {\ifconditional\c_tabl_lines_in_table + \t_tabl_lines_head\emptytoks \fi - \linetableheadstate\plusthree % full - \@@linetablehead{#1}% - \ifinlinetable - \flushlinetablehead + \c_tabl_lines_head_state\plusthree % full + \t_tabl_lines_head{#1}% + \ifconditional\c_tabl_lines_in_table + \tabl_lines_flush_head \fi} -\def\linetableBH +\unexpanded\def\tabl_lines_BH {\ifx\EC\relax % signal, grabbing lines \else - \@@linetablehead\emptytoks + \t_tabl_lines_head\emptytoks \fi \pushmacro\BC \pushmacro\EC - \def\BC##1\EC{\appendtoks##1\to\@@linetablehead}% + \def\BC##1\EC{\appendtoks##1\to\t_tabl_lines_head}% \let\EC\relax} % signal -\def\linetableEH +\unexpanded\def\tabl_lines_EH {\popmacro\EC \popmacro\BC - \@EA\startlinetablehead\the\@@linetablehead\stoplinetablehead} - -\let\startlinetablebody\donothing -\let\stoplinetablebody \donothing + \expandafter\startlinetablehead\the\t_tabl_lines_head\stoplinetablehead} -\def\processlinetablebuffer - {\dosingleempty\doprocesslinetablebuffer} +\let\startlinetablebody\relax +\let\stoplinetablebody \relax -\def\doprocesslinetablebuffer[#1]% +\unexpanded\def\processlinetablebuffer + {\dosingleempty\tabl_lines_process_buffer} + +\def\tabl_lines_process_buffer[#1]% {\bgroup - \let\startlinetable\donothing - \let\stoplinetable \donothing + \let\startlinetable\relax + \let\stoplinetable \relax \startlinetableanalysis\getbuffer[#1]\stoplinetableanalysis \startlinetablerun \getbuffer[#1]\stoplinetablerun \egroup} -\def\processlinetablefile#1% +\unexpanded\def\processlinetablefile + {\dosingleempty\tabl_lines_process_file} + +\def\tabl_lines_process_file#1% maybe accept #1 as well as [#1] {\bgroup - \let\startlinetable\donothing - \let\stoplinetable \donothing + \let\startlinetable\relax + \let\stoplinetable \relax \startlinetableanalysis\readfile{#1}\donothing\donothing\stoplinetableanalysis \startlinetablerun \readfile{#1}\donothing\donothing\stoplinetablerun \egroup} diff --git a/tex/context/base/toks-scn.lua b/tex/context/base/toks-scn.lua index c51912024..5c8dee8f3 100644 --- a/tex/context/base/toks-scn.lua +++ b/tex/context/base/toks-scn.lua @@ -437,3 +437,11 @@ function tokens.scantable(t,data) end return data end + +function tokens.constant(s) + if type(s) == "string" then + return "'" .. s .. "'" + else + return s + end +end diff --git a/tex/context/base/type-imp-cambria.mkiv b/tex/context/base/type-imp-cambria.mkiv index 9bfa2ee5c..8154817bd 100644 --- a/tex/context/base/type-imp-cambria.mkiv +++ b/tex/context/base/type-imp-cambria.mkiv @@ -55,10 +55,10 @@ \starttypescript [\s!serif] [cambria,cambria-m,cambria-a] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [CambriaSerif] [\s!features=\s!default] - \definefontsynonym [\s!SerifBold] [\s!name:cambriabold] [\s!features=\s!default] - \definefontsynonym [\s!SerifItalic] [\s!name:cambriaitalic] [\s!features=\s!default] - \definefontsynonym [\s!SerifBoldItalic] [\s!name:cambriabolditalic] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [CambriaSerif] [\s!features=\s!default,\s!goodies=cambria] + \definefontsynonym [\s!SerifBold] [\s!name:cambriabold] [\s!features=\s!default,\s!goodies=cambria] + \definefontsynonym [\s!SerifItalic] [\s!name:cambriaitalic] [\s!features=\s!default,\s!goodies=cambria] + \definefontsynonym [\s!SerifBoldItalic] [\s!name:cambriabolditalic] [\s!features=\s!default,\s!goodies=cambria] \stoptypescript \starttypescript [cambria,cambria-m,cambria-a] diff --git a/tex/context/base/typo-inj.lua b/tex/context/base/typo-inj.lua index b5d9e1c51..786c3c287 100644 --- a/tex/context/base/typo-inj.lua +++ b/tex/context/base/typo-inj.lua @@ -8,16 +8,20 @@ if not modules then modules = { } end modules ['typo-inj'] = { -- was node-par local tonumber = tonumber -local context = context -local implement = interfaces.implement +local context = context +local implement = interfaces.implement -local injectors = { } -typesetters.injectors = injectors -local list = { } -injectors.list = list -local showall = false +local injectors = { } +typesetters.injectors = injectors +local list = { } +injectors.list = list +local showall = false -local settings_to_array = utilities.parsers.settings_to_array +local settings_to_array = utilities.parsers.settings_to_array + +local variables = interfaces.variables +local v_next = variables.next +local v_previous = variables.previous local ctx_domarkinjector = context.domarkinjector local ctx_doactivateinjector = context.doactivateinjector @@ -72,10 +76,10 @@ end function injectors.check(name,n) -- we could also accent n = number : +/- 2 local injector = list[name] - if n == false then + if not n or n == "" or n == v_next then + n = injector.counter + 1 + elseif n == v_previous then n = injector.counter - elseif n == nil then - n = injector.counter + 1 -- next (upcoming) else n = tonumber(n) or 0 end @@ -89,6 +93,6 @@ implement { name = "resetinjector", actions = injectors.reset, arguments implement { name = "showinjector", actions = injectors.show, arguments = "string" } implement { name = "setinjector", actions = injectors.set, arguments = { "string", "string", "string" } } implement { name = "markinjector", actions = injectors.mark, arguments = "string" } -implement { name = "checkinjector", actions = injectors.check, arguments = "string" } -implement { name = "checkpreviousinjector", actions = injectors.check, arguments = { "string", true } } -implement { name = "checknextinjector", actions = injectors.check } +implement { name = "checkinjector", actions = injectors.check, arguments = { "string", "string" } } +--------- { name = "checkpreviousinjector", actions = injectors.check, arguments = { "string", tokens.constant(v_previous) } } +--------- { name = "checknextinjector", actions = injectors.check, arguments = { "string", tokens.constant(v_next) } } diff --git a/tex/context/base/typo-inj.mkiv b/tex/context/base/typo-inj.mkiv index 46cd9fe45..59f35378f 100644 --- a/tex/context/base/typo-inj.mkiv +++ b/tex/context/base/typo-inj.mkiv @@ -44,16 +44,19 @@ %D \startsection[title=Delta] fourth \index{fourth} \stopsection %D \stoptext -\unexpanded\def\resetinjector [#1]{\clf_resetinjector{#1}} -\unexpanded\def\markinjector [#1]{\dontleavehmode\clf_markinjector{#1}} -\unexpanded\def\checkinjector [#1]{\clf_checkinjector{#1}} -\unexpanded\def\checknextinjector {\clf_checknextinjector} -\unexpanded\def\checkpreviousinjector {\clf_checkpreviousinjector} -\unexpanded\def\dosetinjector [#1][#2][#3]{\clf_setinjector{#1}{#2}{#3}} -\unexpanded\def\doshowinjector [#1]{\clf_showinjector{#1}} +\unexpanded\def\resetinjector [#1]{\clf_resetinjector{#1}} +\unexpanded\def\markinjector [#1]{\dontleavehmode\clf_markinjector{#1}} +\unexpanded\def\docheckinjector [#1][#2]{\clf_checkinjector{#1}{#2}} +\unexpanded\def\checknextinjector [#1]{\clf_checkinjector{#1}{\v!next}} +\unexpanded\def\checkpreviousinjector [#1]{\clf_checkinjector{#1}{\v!previous}} +%unexpanded\def\checknextinjector [#1]{\clf_checknextinjector{#1}} +%unexpanded\def\checkpreviousinjector [#1]{\clf_checkpreviousinjector{#1}} +\unexpanded\def\dosetinjector [#1][#2][#3]{\clf_setinjector{#1}{#2}{#3}} +\unexpanded\def\doshowinjector [#1]{\clf_showinjector{#1}} -\unexpanded\def\setinjector {\dotripleargument\dosetinjector} -\unexpanded\def\showinjector{\dosingleempty\doshowinjector} +\unexpanded\def\checkinjector{\dodoubleempty \docheckinjector} +\unexpanded\def\setinjector {\dotripleargument\dosetinjector} +\unexpanded\def\showinjector {\dosingleempty \doshowinjector} \unexpanded\def\domarkinjector#1#2% called at the lua end {\dontleavehmode\llap{\infofont\ifcase#1\else\red\fi<#2>\quad}} diff --git a/tex/context/fonts/cambria.lfg b/tex/context/fonts/cambria.lfg new file mode 100644 index 000000000..04211009b --- /dev/null +++ b/tex/context/fonts/cambria.lfg @@ -0,0 +1,16 @@ +return { + name = "cambria", + version = "1.00", + comment = "Goodies that complement cambria.", + author = "Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "pair", + data = { + [0x0153] = { [0x0301] = { false, { -500, 0, 0, 0 } } }, + } + } + } +} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index bdb8b9651..ca3f1adbd 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 : 01/07/16 13:38:03 +-- merge date : 01/08/16 16:02:22 do -- begin closure to overcome local limits and interference |