summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4137 -> 4140 bytes
-rw-r--r--tex/context/base/context-version.pngbin40279 -> 40442 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-ctx.lua89
-rw-r--r--tex/context/base/font-fea.mkvi85
-rw-r--r--tex/context/base/status-files.pdfbin24771 -> 24796 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin210117 -> 210050 bytes
-rw-r--r--tex/context/base/strc-sec.mkiv3
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
12 files changed, 148 insertions, 39 deletions
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 05e6b96e7..5d1b5468a 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.03.15 00:17}
+\newcontextversion{2013.03.15 11:59}
%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/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index eeaa8c9c6..3e1e00c34 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{2013.03.15 00:17}
+\newcontextversion{2013.03.15 11:59}
%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
index 8533f51c4..e2b4165ed 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index a0e3d860a..80fe04690 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index d39d51eff..ef51cfefe 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.03.15 00:17}
+\edef\contextversion{2013.03.15 11:59}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 6b0bf8234..2f59b4831 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.03.15 00:17}
+\edef\contextversion{2013.03.15 11:59}
%D For those who want to use this:
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index bf39ca025..0c99268a4 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -646,20 +646,35 @@ local function mergecontext(currentnumber,extraname,option) -- number string num
end
end
-local function mergecontextfeatures(currentname,extraname) -- string string
+local function mergecontextfeatures(currentname,extraname,how,mergedname) -- string string
local extra = setups[extraname]
if extra then
local current = setups[currentname]
- local mergedfeatures, mergedname = { }, nil
- if current then
- for k, v in next, current do
+ local mergedfeatures = { }
+ if how == "+" then
+ if current then
+ for k, v in next, current do
+ mergedfeatures[k] = v
+ end
+ end
+ for k, v in next, extra do
+ mergedfeatures[k] = v
+ end
+ elseif how == "-" then
+ if current then
+ for k, v in next, current do
+ mergedfeatures[k] = v
+ end
+ end
+ for k, v in next, extra do
+ mergedfeatures[k] = not v
+ end
+ else -- =
+ for k, v in next, extra do
mergedfeatures[k] = v
end
end
- for k, v in next, extra do
- mergedfeatures[k] = v
- end
- mergedname = currentname .. "+" .. extraname
+ -- local mergedname = currentname .. how .. extraname
local number = #numbers + 1
mergedfeatures.number = number
numbers[number] = mergedname
@@ -694,6 +709,25 @@ local function registercontext(fontnumber,extraname,option)
end
end
+local function registercontextfeature(fontnumber,extraname,how)
+ local extra = setups[extraname]
+ if extra then
+ local mergedfeatures, mergedname = { }, nil
+ mergedname = fontnumber .. how .. extraname
+ for k, v in next, extra do
+ mergedfeatures[k] = v
+ end
+ local number = #numbers + 1
+ mergedfeatures.number = number
+ numbers[number] = mergedname
+ merged[number] = option
+ setups[mergedname] = mergedfeatures
+ return number -- contextnumber(mergedname)
+ else
+ return 0
+ end
+end
+
specifiers.presetcontext = presetcontext
specifiers.contextnumber = contextnumber
specifiers.mergecontext = mergecontext
@@ -1662,26 +1696,33 @@ end
commands.definefontfeature = presetcontext
-function commands.feature(parent,name,font)
- local font = font or currentfont()
- local full = parent .. "+" .. name
- local hash = font .. "*" .. full .. "*" .. 2 -- what
- local done = withcache[hash]
- if done then
+local cache = { }
+
+function commands.feature(how,parent,name,font)
+ if not how then
+ texattribute[0] = 0
else
- local n = setups[full]
- if n then
+ local font = font or currentfont()
+ local full = parent .. how .. name
+ local hash = font .. how .. full -- what, hm
+ local done = cache[hash]
+ if done then
else
- n = mergecontextfeatures(parent,name) -- registers parent .. "+" .. name
- end
- done = registercontext(font,full,2) -- what
- withcache[hash] = done
- if trace_features then
- report_cummulative("font %!font:name!, number %a, set %a : %!font:features!",
- fontdata[font],done,full,setups[numbers[done]])
+ local n = setups[full]
+ if n then
+ -- already defined
+ else
+ n = mergecontextfeatures(parent,name,how,full) -- registers parent .. "+" .. name
+ end
+ done = registercontextfeature(font,full,how)
+ cache[hash] = done
+ if trace_features then
+ report_cummulative("font %!font:name!, number %a, set %a : %!font:features!",
+ fontdata[font],done,full,setups[numbers[done]])
+ end
end
+ texattribute[0] = done
end
- texattribute[0] = done
end
function commands.featurelist(...)
diff --git a/tex/context/base/font-fea.mkvi b/tex/context/base/font-fea.mkvi
index 7b3319392..f3d915c1b 100644
--- a/tex/context/base/font-fea.mkvi
+++ b/tex/context/base/font-fea.mkvi
@@ -168,20 +168,89 @@
% beware: these are global features on top of existing font features
-\let\currentfeature \s!current
-\let\m_font_feature_list\s!current
+\let\currentfeature \s!current
+\let\m_font_feature_list \s!current
+\let\m_font_feature_asked\empty
-\unexpanded\def\feature#1% hashing at this end is slower
- {\edef\m_font_feature_asked{#1}%
- \ifx\m_font_feature_asked\currentfeature \else
- \font_feature_accumulate
+\newconstant\c_font_feature_state
+
+% hashing at this end is slower
+
+\unexpanded\def\addfeature {\doifnextoptionalelse\font_feature_add_yes \font_feature_add_nop }
+\unexpanded\def\subtractfeature{\doifnextoptionalelse\font_feature_subtract_yes\font_feature_subtract_nop}
+\unexpanded\def\replacefeature {\doifnextoptionalelse\font_feature_replace_yes \font_feature_replace_nop }
+
+\unexpanded\def\font_feature_add_yes [#1]{\edef\m_font_feature_asked{#1}\font_feature_add}
+\unexpanded\def\font_feature_add_nop #1{\edef\m_font_feature_asked{#1}\font_feature_add}
+
+\unexpanded\def\font_feature_subtract_yes[#1]{\edef\m_font_feature_asked{#1}\font_feature_subtract}
+\unexpanded\def\font_feature_subtract_nop #1{\edef\m_font_feature_asked{#1}\font_feature_subtract}
+
+\unexpanded\def\font_feature_replace_yes [#1]{\edef\m_font_feature_asked{#1}\font_feature_replace}
+\unexpanded\def\font_feature_replace_nop #1{\edef\m_font_feature_asked{#1}\font_feature_replace}
+
+\let\doaddfeature \font_feature_add_nop % low level faster ones
+\let\dosubtractfeature\font_feature_subtract_nop % low level faster ones
+\let\doreplacefeature \font_feature_replace_nop % low level faster ones
+
+\def\font_feature_add
+ {\ifnum\c_font_feature_state=\plusone
+ \ifx\m_font_feature_asked\currentfeature\else
+ \font_feature_add_indeed
+ \fi
+ \else
+ \font_feature_add_indeed
\fi}
-\def\font_feature_accumulate
- {\ctxcommand{feature("\m_font_feature_list","\m_font_feature_asked")}%
+\def\font_feature_add_indeed
+ {\ctxcommand{feature("+","\m_font_feature_list","\m_font_feature_asked")}%
\edef\m_font_feature_list{\m_font_feature_list+\m_font_feature_asked}% also + at the lua end
+ \c_font_feature_state\plusone
\let\currentfeature\m_font_feature_asked}
+\unexpanded\def\font_feature_subtract
+ {\ifnum\c_font_feature_state=\minusone
+ \ifx\m_font_feature_asked\currentfeature\else
+ \font_feature_subtract_indeed
+ \fi
+ \else
+ \font_feature_subtract_indeed
+ \fi}
+
+\def\font_feature_subtract_indeed
+ {\ctxcommand{feature("-","\m_font_feature_list","\m_font_feature_asked")}%
+ \edef\m_font_feature_list{\m_font_feature_list-\m_font_feature_asked}% also - at the lua end
+ \c_font_feature_state\minusone
+ \let\currentfeature\m_font_feature_asked}
+
+\unexpanded\def\font_feature_replace
+ {\ifnum\c_font_feature_state=\zerocount
+ \ifx\m_font_feature_asked\currentfeature\else
+ \font_feature_replace_indeed
+ \fi
+ \else
+ \font_feature_replace_indeed
+ \fi}
+
+\def\font_feature_replace_indeed
+ {\ctxcommand{feature("=","\m_font_feature_list","\m_font_feature_asked")}%
+ \edef\m_font_feature_list{\m_font_feature_list=\m_font_feature_asked}% also = at the lua end
+ \c_font_feature_state\zerocount
+ \let\currentfeature\m_font_feature_asked}
+
+\unexpanded\def\resetfeature
+ {\ifx\currentfeature\s!current \else
+ \font_feature_reset_indeed
+ \fi}
+
+\def\font_feature_reset_indeed
+ {\let\m_font_feature_asked\empty
+ \let\currentfeature \s!current
+ \let\m_font_feature_list \s!current
+ \ctxcommand{feature(false)}}
+
+\let\feature\addfeature
+
%D \macros
%D {os}
%D
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 769f3ecb9..7b3262411 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index b1551f6d8..36f38780e 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv
index 9cd1cf081..22ed9fe0d 100644
--- a/tex/context/base/strc-sec.mkiv
+++ b/tex/context/base/strc-sec.mkiv
@@ -738,6 +738,7 @@
\def\strc_sectioning_place_head_text[#1]%
{\dontleavehmode
\begingroup
+ \unexpanded\def\\{\space}% messy here, but the default (and needs to be grouped)
\settrue\headisdisplay % triggers interlinespace checking
\edef\currenthead{#1}%
\strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor
@@ -772,8 +773,6 @@
\strc_sectioning_initialize_placement
\strc_sectioning_initialize_number
%
- \unexpanded\def\\{\space}% messy here
- %
\flushingcolumnfloatsfalse
%
% todo: also mark (for header)
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index f9533f82f..9445993e2 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 : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 03/15/13 00:17:23
+-- merge date : 03/15/13 11:59:36
do -- begin closure to overcome local limits and interference