summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4385 -> 4388 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-ini.mkvi25
-rw-r--r--tex/context/base/font-pre.mkiv16
-rw-r--r--tex/context/base/lang-hyp.lua49
-rw-r--r--tex/context/base/lang-hyp.mkiv23
-rw-r--r--tex/context/base/math-ini.mkiv12
-rw-r--r--tex/context/base/mult-def.mkiv2
-rw-r--r--tex/context/base/status-files.pdfbin24622 -> 24641 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin344527 -> 344553 bytes
-rw-r--r--tex/context/base/typo-cap.lua25
-rw-r--r--tex/context/base/typo-cap.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
14 files changed, 129 insertions, 31 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index afa71115e..cac66238a 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{2014.12.03 18:26}
+\newcontextversion{2014.12.04 21: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 debfb27f9..a4ac52c6a 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.mkiv b/tex/context/base/context.mkiv
index b93063b1d..a168b88e4 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.12.03 18:26}
+\edef\contextversion{2014.12.04 21:59}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/font-ini.mkvi b/tex/context/base/font-ini.mkvi
index bdb8f9a11..03e08affc 100644
--- a/tex/context/base/font-ini.mkvi
+++ b/tex/context/base/font-ini.mkvi
@@ -1997,8 +1997,29 @@
%D takes a bit more time. Keep in mind that the fontsize is
%D represented by a character or empty.
-\unexpanded\def\tx {\font_helpers_set_current_font_x_alternative \fontalternative}
-\unexpanded\def\txx{\font_helpers_set_current_font_xx_alternative\fontalternative}
+% \unexpanded\def\tx {\font_helpers_set_current_font_x_alternative \fontalternative}
+% \unexpanded\def\txx{\font_helpers_set_current_font_xx_alternative\fontalternative}
+
+\unexpanded\def\tx
+ {\ifmmode
+ \scriptstyle
+ \else
+ \let\fontface\!!plusfour
+ \let\fontalternative\fontalternative
+ \font_helpers_synchronize_font
+ \fi
+ \currentxfontsize\plusone
+ \let\tx\txx}
+
+\unexpanded\def\txx
+ {\ifmmode
+ \scriptscriptstyle
+ \else
+ \let\fontface\!!plusfive
+ \let\fontalternative\fontalternative
+ \font_helpers_synchronize_font
+ \fi
+ \currentxfontsize\plustwo}
\let\normaltx \tx
\let\normaltxx\txx
diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv
index 071d42d09..6176c33ab 100644
--- a/tex/context/base/font-pre.mkiv
+++ b/tex/context/base/font-pre.mkiv
@@ -618,6 +618,22 @@
\definefont[infofont][dejavusansmono at 6pt] % todo \the\everybodyfont
+%D Optimization (later we overload in math):
+
+\unexpanded\def\normaltf{\let\fontalternative\s!tf\font_helpers_synchronize_font}
+\unexpanded\def\normalbf{\let\fontalternative\s!bf\font_helpers_synchronize_font}
+\unexpanded\def\normalit{\let\fontalternative\s!it\font_helpers_synchronize_font}
+\unexpanded\def\normalsl{\let\fontalternative\s!sl\font_helpers_synchronize_font}
+\unexpanded\def\normalbi{\let\fontalternative\s!bi\font_helpers_synchronize_font}
+\unexpanded\def\normalbs{\let\fontalternative\s!bs\font_helpers_synchronize_font}
+
+\let\tf\normaltf
+\let\bf\normalbf
+\let\it\normalit
+\let\sl\normalsl
+\let\bi\normalbi
+\let\bs\normalbs
+
\protect \endinput
% LM math vs CM math (analysis by Taco):
diff --git a/tex/context/base/lang-hyp.lua b/tex/context/base/lang-hyp.lua
index b13a8e965..a273009b6 100644
--- a/tex/context/base/lang-hyp.lua
+++ b/tex/context/base/lang-hyp.lua
@@ -550,13 +550,30 @@ function traditional.injecthyphens(dictionary,word,specification)
return concat(result)
end
-function traditional.registerpattern(language,str,specification)
- local dictionary = dictionaries[language]
- if specification == false then
- unregister_pattern(dictionary.patterns,dictionary.specials,str)
- else
- register_pattern(dictionary.patterns,dictionary.specials,str,specification)
+do
+
+ local word = C((1-space)^1)
+ local spaces = space^1
+
+ local u_pattern = (Carg(1) * Carg(2) * word / unregister_pattern + spaces)^1
+ local r_pattern = (Carg(1) * Carg(2) * word * Carg(3) / register_pattern + spaces)^1
+ local e_pattern = (Carg(1) * word / register_exception + spaces)^1
+
+ function traditional.registerpattern(language,str,specification)
+ local dictionary = dictionaries[language]
+ if specification == false then
+ lpegmatch(u_pattern,str,1,dictionary.patterns,dictionary.specials)
+ -- unregister_pattern(dictionary.patterns,dictionary.specials,str)
+ else
+ lpegmatch(r_pattern,str,1,dictionary.patterns,dictionary.specials,specification or false)
+ -- register_pattern(dictionary.patterns,dictionary.specials,str,specification)
+ end
+ end
+
+ function traditional.registerexception(language,str)
+ lpegmatch(e_pattern,str,1,dictionaries[language].exceptions)
end
+
end
-- todo: unicodes or utfhash ?
@@ -811,7 +828,8 @@ if context then
texsetattribute(a_hyphenation,n or unsetvalue)
end
- commands.registerhyphenationpattern = traditional.registerpattern
+ commands.registerhyphenationpattern = traditional.registerpattern
+ commands.registerhyphenationexception = traditional.registerexception
-- This is a relative large function with local variables and local
-- functions. A previous implementation had the functions outside but
@@ -874,7 +892,10 @@ if context then
local rightmin = 0
local leftcharmin = nil
local rightcharmin = nil
+ ----- leftwordmin = nil
local rightwordmin = nil
+ local leftchar = nil
+ local rightchar = nil
local attr = nil
local lastwordlast = nil
local hyphenated = hyphenate
@@ -892,6 +913,10 @@ if context then
starttiming(traditional)
+ local function somehyphenchar(c)
+ return type(c) == "string" and utfbyte(c) or tonumber(c)
+ end
+
local function synchronizefeatureset(a)
local f = a and featuresets[a]
if f then
@@ -901,6 +926,8 @@ if context then
rightwordmin = f.rightwordmin
leftcharmin = f.leftcharmin
rightcharmin = f.rightcharmin
+ leftchar = somehyphenchar(f.leftchar)
+ rightchar = somehyphenchar(f.rightchar)
strict = f.strict and strictids
if rightwordmin and rightwordmin > 0 and lastwordlast ~= rightwordmin then
-- so we can change mid paragraph but it's kind of unpredictable then
@@ -931,6 +958,8 @@ if context then
rightwordmin = false
leftcharmin = false
rightcharmin = false
+ leftchar = false
+ rightchar = false
strict = false
end
return a
@@ -1156,9 +1185,9 @@ if context then
instance = dictionary.instance
characters = dictionary.characters
unicodes = dictionary.unicodes
- leftchar = instance and posthyphenchar(instance)
- rightchar = instance and prehyphenchar (instance)
- leftmin = leftcharmin or getfield(current,"left")
+ leftchar = leftchar or (instance and posthyphenchar(instance))
+ rightchar = rightchar or (instance and prehyphenchar (instance))
+ leftmin = leftcharmin or getfield(current,"left")
rightmin = rightcharmin or getfield(current,"right")
if not leftchar or leftchar < 0 then
leftchar = false
diff --git a/tex/context/base/lang-hyp.mkiv b/tex/context/base/lang-hyp.mkiv
index e2c18ac14..5af47fc26 100644
--- a/tex/context/base/lang-hyp.mkiv
+++ b/tex/context/base/lang-hyp.mkiv
@@ -59,7 +59,9 @@
\installsetuphandler \??hyphenation {hyphenation}
\setuphyphenation
- [\c!method=\s!default]
+ [\c!method=\s!default,
+ \s!righthyphenchar=0,
+ \s!lefthyphenchar=0]
\appendtoks
\ctxcommand{setuphyphenation{method="\hyphenationparameter\c!method"}}%
@@ -94,6 +96,8 @@
\letdummyparameter\c!rightwords\!!zerocount % maybe \s!
\letdummyparameter\s!lefthyphenmin\!!zerocount
\letdummyparameter\s!righthyphenmin\!!zerocount
+ \letdummyparameter\s!lefthyphenchar\!!zerocount
+ \letdummyparameter\s!righthyphenchar\!!zerocount
\letdummyparameter\c!alternative\empty
\letdummyparameter\c!rightedge\empty
\getdummyparameters[#2]%
@@ -104,6 +108,8 @@
rightwordmin = \number\dummyparameter\c!rightwords,
leftcharmin = \number\dummyparameter\s!lefthyphenmin,
rightcharmin = \number\dummyparameter\s!righthyphenmin,
+ leftchar = "\dummyparameter\s!lefthyphenchar",
+ rightchar = "\dummyparameter\s!righthyphenchar",
alternative = "\dummyparameter\c!alternative",
rightedge = "\dummyparameter\c!rightedge",
})}%
@@ -143,6 +149,21 @@
false
)}}
+\unexpanded\def\registerhyphenationexception
+ {\dodoubleempty\lang_hyphenation_register_exception}
+
+
+\def\lang_hyphenation_register_exception[#1][#2]%
+ {\ctxcommand{registerhyphenationexception(
+ \ifsecondargument
+ \!!bs#1\!!es,
+ \!!bs#2\!!es
+ \else
+ \!!bs\currentlanguage\!!es,
+ \!!bs#1\!!es
+ \fi
+ )}}
+
\unexpanded\def\showhyphenationtrace
{\dodoubleempty\lang_hyphenation_show_trace}
diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv
index c4d280377..a636c28c2 100644
--- a/tex/context/base/math-ini.mkiv
+++ b/tex/context/base/math-ini.mkiv
@@ -253,12 +253,12 @@
\unexpanded\def\mathfrak#1{{\mathfraktur #1}} % for AMS compatibility
\unexpanded\def\mathbb #1{{\mathblackboard#1}} % for AMS compatibility
-\let\normaltf\tf \unexpanded\def\tf{\ifmmode\mathtf\else\normaltf\fi}
-\let\normalbf\bf \unexpanded\def\bf{\ifmmode\mathbf\else\normalbf\fi}
-\let\normalit\it \unexpanded\def\it{\ifmmode\mathit\else\normalit\fi}
-\let\normalsl\sl \unexpanded\def\sl{\ifmmode\mathsl\else\normalsl\fi}
-\let\normalbi\bi \unexpanded\def\bi{\ifmmode\mathbi\else\normalbi\fi}
-\let\normalbs\bs \unexpanded\def\bs{\ifmmode\mathbs\else\normalbs\fi}
+\ifdefined\normaltf\else\let\normaltf\tf\fi \unexpanded\def\tf{\ifmmode\mathtf\else\normaltf\fi}
+\ifdefined\normalbf\else\let\normalbf\bf\fi \unexpanded\def\bf{\ifmmode\mathbf\else\normalbf\fi}
+\ifdefined\normalit\else\let\normalit\it\fi \unexpanded\def\it{\ifmmode\mathit\else\normalit\fi}
+\ifdefined\normalsl\else\let\normalsl\sl\fi \unexpanded\def\sl{\ifmmode\mathsl\else\normalsl\fi}
+\ifdefined\normalbi\else\let\normalbi\bi\fi \unexpanded\def\bi{\ifmmode\mathbi\else\normalbi\fi}
+\ifdefined\normalbs\else\let\normalbs\bs\fi \unexpanded\def\bs{\ifmmode\mathbs\else\normalbs\fi}
\let\normalrm\rm \unexpanded\def\rm{\ifmmode\mathrm\else\normalrm\fi}
\let\normalss\ss \unexpanded\def\ss{\ifmmode\mathss\else\normalss\fi}
diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv
index b73a6df3e..e456d1568 100644
--- a/tex/context/base/mult-def.mkiv
+++ b/tex/context/base/mult-def.mkiv
@@ -57,6 +57,8 @@
\def\v!display {display}
\def\v!inline {inline}
+\def\v!camel {camel}
+
\def\c!dataset {dataset}
\def\c!sectionblock {sectionblock}
\def\c!language {language}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index af2f651d4..61ae8fa36 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 6df64a555..bcb6ad6b6 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/typo-cap.lua b/tex/context/base/typo-cap.lua
index 78ed8700a..4b424e5a4 100644
--- a/tex/context/base/typo-cap.lua
+++ b/tex/context/base/typo-cap.lua
@@ -314,15 +314,22 @@ local function random(start,attr,lastfont,n)
return start, false
end
-register(variables.WORD, WORD) -- 1
-register(variables.word, word) -- 2
-register(variables.Word, Word) -- 3
-register(variables.Words, Words) -- 4
-register(variables.capital, capital) -- 5
-register(variables.Capital, Capital) -- 6
-register(variables.none, none) -- 7 (dummy)
-register(variables.random, random) -- 8
-register(variables.mixed, mixed) -- 9
+local function camel(start,attr,lastfont,n)
+ local start, done_1 = word(start,attr,lastfont,n)
+ local start, done_2 = Words(start,attr,lastfont,n)
+ return start, done_1 or done_2
+end
+
+register(variables.WORD, WORD) -- 1
+register(variables.word, word) -- 2
+register(variables.Word, Word) -- 3
+register(variables.Words, Words) -- 4
+register(variables.capital, capital) -- 5
+register(variables.Capital, Capital) -- 6
+register(variables.none, none) -- 7 (dummy)
+register(variables.random, random) -- 8
+register(variables.mixed, mixed) -- 9
+register(variables.camel, camel) -- 10
register(variables.cap, variables.capital) -- clone
register(variables.Cap, variables.Capital) -- clone
diff --git a/tex/context/base/typo-cap.mkiv b/tex/context/base/typo-cap.mkiv
index c4458129f..9394cd7d0 100644
--- a/tex/context/base/typo-cap.mkiv
+++ b/tex/context/base/typo-cap.mkiv
@@ -43,6 +43,7 @@
\definecapitals[\v!WORD] % all lower
\definecapitals[\v!Word] % one upper + font
\definecapitals[\v!Words] % some upper
+\definecapitals[\v!camel] % lowers first
\definecapitals[\v!word][\c!style=] % nothing
%D \macros
@@ -84,6 +85,7 @@
\unexpanded\def\word {\groupedcommand{\setcharactercasing[\v!word ]}{}}
\unexpanded\def\Word {\groupedcommand{\setcharactercasing[\v!Word ]}{}}
\unexpanded\def\Words{\groupedcommand{\setcharactercasing[\v!Words]}{}}
+\unexpanded\def\camel{\groupedcommand{\setcharactercasing[\v!camel]}{}}
% This might become:
%
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 031320402..42003752d 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 : 12/03/14 18:26:33
+-- merge date : 12/04/14 21:59:47
do -- begin closure to overcome local limits and interference