From 63c1181d3b3baf82e48ab28cd6a66230903423de Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Mon, 12 May 2014 22:08:36 +0200 Subject: 2014-05-12 16:55:00 --- tex/context/base/char-ini.lua | 11 ++++ tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4063 -> 4065 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/font-con.lua | 7 ++- tex/context/base/font-otb.lua | 38 ++++++++------ tex/context/base/font-otc.lua | 9 +++- tex/context/base/math-ini.mkiv | 6 +++ tex/context/base/mult-low.lua | 2 + tex/context/base/page-mix.mkiv | 3 +- tex/context/base/status-files.pdf | Bin 24652 -> 24601 bytes tex/context/base/status-lua.pdf | Bin 242951 -> 242955 bytes tex/context/base/type-imp-lato.mkiv | 56 +++++++++++++++++++++ tex/context/base/x-asciimath.lua | 6 ++- tex/context/base/x-asciimath.mkiv | 4 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 41 +++++++++------ 16 files changed, 146 insertions(+), 41 deletions(-) create mode 100644 tex/context/base/type-imp-lato.mkiv (limited to 'tex') diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index d6e8d18a9..1cfeb0596 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -776,6 +776,17 @@ function characters.lower (str) return lpegmatch(tolower,str) end function characters.upper (str) return lpegmatch(toupper,str) end function characters.shaped(str) return lpegmatch(toshape,str) end +-- maybe: (twice as fast when much ascii) +-- +-- local tolower = lpeg.patterns.tolower +-- local lower = string.lower +-- +-- local allascii = R("\000\127")^1 * P(-1) +-- +-- function characters.checkedlower(str) +-- return lpegmatch(allascii,str) and lower(str) or lpegmatch(tolower,str) or str +-- end + function characters.lettered(str,spacing) local new, n = { }, 0 if spacing then diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 812647e80..e0c78f53f 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.05.08 11:18} +\newcontextversion{2014.05.12 16:53} %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 c77c0777f..6b0f52399 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index c5b82329f..247c79ad7 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.05.08 11:18} +\edef\contextversion{2014.05.12 16:53} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-con.lua b/tex/context/base/font-con.lua index b43961ec6..a34044f0b 100644 --- a/tex/context/base/font-con.lua +++ b/tex/context/base/font-con.lua @@ -599,6 +599,7 @@ function constructors.scale(tfmdata,specification) -- basemode hack (we try to catch missing tounicodes, e.g. needed for ssty in math cambria) local c = changed[unicode] if c then +local ligatures = character.ligatures description = descriptions[c] or descriptions[unicode] or character character = characters[c] or character index = description.index or c @@ -610,6 +611,9 @@ function constructors.scale(tfmdata,specification) touni = tounicode[i] -- nb: index! end end +if ligatures and not character.ligatures then + character.ligatures = ligatures +end else description = descriptions[unicode] or character index = description.index or unicode @@ -780,7 +784,7 @@ function constructors.scale(tfmdata,specification) chr.ligatures = vl -- shared else local tt = { } - for i,l in next, vl do + for i, l in next, vl do tt[i] = l end chr.ligatures = tt @@ -963,7 +967,6 @@ function constructors.finalize(tfmdata) -- properties.finalized = true -- - -- return tfmdata end diff --git a/tex/context/base/font-otb.lua b/tex/context/base/font-otb.lua index 946d552e4..2e98d3ecb 100644 --- a/tex/context/base/font-otb.lua +++ b/tex/context/base/font-otb.lua @@ -47,13 +47,14 @@ local function gref(descriptions,n) return f_unicode(n) end elseif n then - local num, nam = { }, { } - for i=2,#n do + local num, nam, j = { }, { }, 0 + for i=1,#n do local ni = n[i] if tonumber(ni) then -- first is likely a key + j = j + 1 local di = descriptions[ni] - num[i] = f_unicode(ni) - nam[i] = di and di.name or "-" + num[j] = f_unicode(ni) + nam[j] = di and di.name or "-" end end return f_unilist(num,nam) @@ -169,7 +170,8 @@ end -- pseudo names like hyphen_hyphen to endash so in practice we end -- up with a bit too many definitions but the overhead is neglectable. -- --- Todo: if changed[first] or changed[second] then ... end +-- We can have changed[first] or changed[second] but it quickly becomes +-- messy if we need to take that into account. local trace = false @@ -188,8 +190,8 @@ local function finalize_ligatures(tfmdata,ligatures) local ligature = ligatures[i] if ligature then local unicode, lookupdata = ligature[1], ligature[2] - if trace then - trace_ligatures_detail("building % a into %a",lookupdata,unicode) + if trace_ligatures_detail then + report_prepare("building % a into %a",lookupdata,unicode) end local size = #lookupdata local firstcode = lookupdata[1] -- [2] @@ -201,8 +203,8 @@ local function finalize_ligatures(tfmdata,ligatures) local firstdata = characters[firstcode] if not firstdata then firstcode = private - if trace then - trace_ligatures_detail("defining %a as %a",firstname,firstcode) + if trace_ligatures_detail then + report_prepare("defining %a as %a",firstname,firstcode) end unicodes[firstname] = firstcode firstdata = { intermediate = true, ligatures = { } } @@ -225,8 +227,8 @@ local function finalize_ligatures(tfmdata,ligatures) break end end - if trace then - trace_ligatures_detail("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target) + if trace_ligatures_detail then + report_prepare("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target) end local firstligs = firstdata.ligatures if firstligs then @@ -237,6 +239,8 @@ local function finalize_ligatures(tfmdata,ligatures) firstcode = target firstname = secondname end + elseif trace_ligatures_detail then + report_prepare("no glyph (%a,%a) for building %a",firstname,firstcode,target) end if okay then ligatures[i] = false @@ -246,12 +250,14 @@ local function finalize_ligatures(tfmdata,ligatures) end alldone = done == 0 end - if trace then - for k, v in next, characters do - if v.ligatures then table.print(v,k) end + if trace_ligatures_detail then + for k, v in table.sortedhash(characters) do + if v.ligatures then + table.print(v,k) + end end end - tfmdata.resources.private = private + resources.private = private end end @@ -487,7 +493,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end changed[unicode] = data elseif lookuptype == "alternate" then - local replacement = data[alternate] + local replacement = data[alternate] if replacement then changed[unicode] = replacement if trace_alternatives then diff --git a/tex/context/base/font-otc.lua b/tex/context/base/font-otc.lua index 92775270d..f7f8e9ce2 100644 --- a/tex/context/base/font-otc.lua +++ b/tex/context/base/font-otc.lua @@ -134,7 +134,7 @@ local function addfeature(data,feature,specifications) askedfeatures[k] = table.tohash(v) end end - sequences[#sequences+1] = { + local sequence = { chain = 0, features = { [feature] = askedfeatures }, flags = featureflags, @@ -143,6 +143,11 @@ local function addfeature(data,feature,specifications) subtables = st, type = featuretype, } + 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 = { } @@ -208,6 +213,7 @@ local tlig_specification = { data = tlig, order = { "tlig" }, flags = noflags, + prepend = true, } otf.addfeature("tlig",tlig_specification) @@ -231,6 +237,7 @@ local trep_specification = { data = trep, order = { "trep" }, flags = noflags, + prepend = true, } otf.addfeature("trep",trep_specification) diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index dcd2a5c33..adf252d95 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -230,6 +230,12 @@ \ifdefined\mr \else \let\mr\relax \fi \ifdefined\mb \else \let\mb\relax \fi +% 1: $\setmathattribute{ss}{bf}3$ +% 2: $\setmathattribute{ss}{bf}\setmathfontstylealterternate{bf}3$ +% 3: $\setmathattribute{ss}{bf}\setmathfontstyle{bf}3$ +% 4: $\setmathattribute{ss}{bf}\setmathfontstyle{bf}\setmathfontstylealterternate{bf}3$ +% 5: $e=mc^2 \quad \mb e=mc^2$ + \prependtoks \mathdefault \to \everymathematics diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index f41104986..a52fd1ddc 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -307,6 +307,8 @@ return { -- "leftorright", -- + "offinterlineskip", "oninterlineskip", "nointerlineskip", + -- "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight", -- "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing", diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv index 41897f6dd..57de14b88 100644 --- a/tex/context/base/page-mix.mkiv +++ b/tex/context/base/page-mix.mkiv @@ -29,6 +29,7 @@ % wide floats % move floats % offsets (inner ones, so we change the hsize ... needed with backgrounds +% when no content we currently loose the page % luatex buglet: % @@ -208,7 +209,7 @@ \fi \global\setbox\b_page_mix_preceding\vbox {\page_otr_command_flush_top_insertions - \ifdim\ht\b_page_mix_preceding=\zeropoint \else + \ifdim\htdp\b_page_mix_preceding=\zeropoint \else \writestatus\m!columns{preceding error}% \unvbox\b_page_mix_preceding \fi diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 60ed193df..3c137a92d 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index c6c1623ed..321d4eef7 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/type-imp-lato.mkiv b/tex/context/base/type-imp-lato.mkiv new file mode 100644 index 000000000..8fb8647fc --- /dev/null +++ b/tex/context/base/type-imp-lato.mkiv @@ -0,0 +1,56 @@ +%D \module +%D [ file=type-imp-lato, +%D version=2014.05.02, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Lato fonts, +%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. + +% hai : hair / lta : italic +% lig : light / lta : italic +% reg : regular / lta : italic +% bol : bold / lta : italic +% bla : black / lta : italic + +\loadtypescriptfile[dejavu] +\loadtypescriptfile[xits] + +\starttypescriptcollection[lato] + + \starttypescript [\s!sans] [lato] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [\s!file:lato-reg] [\s!features=\s!default] + \definefontsynonym [\s!SansBold] [\s!file:lato-bol] [\s!features=\s!default] + \definefontsynonym [\s!SansItalic] [\s!file:lato-reglta] [\s!features=\s!default] + \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-bollta] [\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!sans] [lato-light] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [\s!file:lato-lig] [\s!features=\s!default] + \definefontsynonym [\s!SansBold] [\s!file:lato-reg] [\s!features=\s!default] + \definefontsynonym [\s!SansItalic] [\s!file:lato-liglta] [\s!features=\s!default] + \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-reglta] [\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!sans] [lato-dark] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [\s!file:lato-bol] [\s!features=\s!default] + \definefontsynonym [\s!SansBold] [\s!file:lato-bla] [\s!features=\s!default] + \definefontsynonym [\s!SansItalic] [\s!file:lato-bollta] [\s!features=\s!default] + \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-blalta] [\s!features=\s!default] + \stoptypescript + + \starttypescript[lato,lato-light,lato-dark] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [xits] [\s!default] [\s!rscale=1.2] + \stoptypescript + +\stoptypescriptcollection diff --git a/tex/context/base/x-asciimath.lua b/tex/context/base/x-asciimath.lua index 992c37eae..87f04b5ff 100644 --- a/tex/context/base/x-asciimath.lua +++ b/tex/context/base/x-asciimath.lua @@ -268,5 +268,7 @@ parser = Cs { "main", } -asciimath.reserved = reserved -asciimath.convert = converted +asciimath.reserved = reserved +asciimath.convert = converted + +commands.convert = converted diff --git a/tex/context/base/x-asciimath.mkiv b/tex/context/base/x-asciimath.mkiv index b555115ff..fd385671a 100644 --- a/tex/context/base/x-asciimath.mkiv +++ b/tex/context/base/x-asciimath.mkiv @@ -64,7 +64,8 @@ \writestatus{asciimath}{beware, this is an experimental (m4all only) module} -\unexpanded\def\asciimath#1{\ctxmoduleasciimath{convert(\!!bs\detokenize{#1}\!!es,true)}} +%unexpanded\def\asciimath#1{\ctxmoduleasciimath{convert(\!!bs\detokenize{#1}\!!es,true)}} +\unexpanded\def\asciimath#1{\ctxcommand{convert(\!!bs\detokenize\expandafter{\normalexpanded{#1}}\!!es,true)}} \protect @@ -82,6 +83,7 @@ \asciimath{int_0^1 f(x)dx} \asciimath{int^1_0 f(x)dx} \asciimath{a//b} +\asciimath{a//\alpha} \asciimath{(a/b)/(d/c)} \asciimath{((a*b))/(d/c)} \asciimath{[[a,b],[c,d]]((n),(k))} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b15b23556..381c5ca8d 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 : 05/08/14 11:18:23 +-- merge date : 05/12/14 16:53:28 do -- begin closure to overcome local limits and interference @@ -4170,6 +4170,7 @@ function constructors.scale(tfmdata,specification) if changed then local c=changed[unicode] if c then +local ligatures=character.ligatures description=descriptions[c] or descriptions[unicode] or character character=characters[c] or character index=description.index or c @@ -4181,6 +4182,9 @@ function constructors.scale(tfmdata,specification) touni=tounicode[i] end end +if ligatures and not character.ligatures then + character.ligatures=ligatures +end else description=descriptions[unicode] or character index=description.index or unicode @@ -8543,13 +8547,14 @@ local function gref(descriptions,n) return f_unicode(n) end elseif n then - local num,nam={},{} - for i=2,#n do + local num,nam,j={},{},0 + for i=1,#n do local ni=n[i] if tonumber(ni) then + j=j+1 local di=descriptions[ni] - num[i]=f_unicode(ni) - nam[i]=di and di.name or "-" + num[j]=f_unicode(ni) + nam[j]=di and di.name or "-" end end return f_unilist(num,nam) @@ -8632,8 +8637,8 @@ local function finalize_ligatures(tfmdata,ligatures) local ligature=ligatures[i] if ligature then local unicode,lookupdata=ligature[1],ligature[2] - if trace then - trace_ligatures_detail("building % a into %a",lookupdata,unicode) + if trace_ligatures_detail then + report_prepare("building % a into %a",lookupdata,unicode) end local size=#lookupdata local firstcode=lookupdata[1] @@ -8645,8 +8650,8 @@ local function finalize_ligatures(tfmdata,ligatures) local firstdata=characters[firstcode] if not firstdata then firstcode=private - if trace then - trace_ligatures_detail("defining %a as %a",firstname,firstcode) + if trace_ligatures_detail then + report_prepare("defining %a as %a",firstname,firstcode) end unicodes[firstname]=firstcode firstdata={ intermediate=true,ligatures={} } @@ -8669,8 +8674,8 @@ local function finalize_ligatures(tfmdata,ligatures) break end end - if trace then - trace_ligatures_detail("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target) + if trace_ligatures_detail then + report_prepare("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target) end local firstligs=firstdata.ligatures if firstligs then @@ -8681,6 +8686,8 @@ local function finalize_ligatures(tfmdata,ligatures) firstcode=target firstname=secondname end + elseif trace_ligatures_detail then + report_prepare("no glyph (%a,%a) for building %a",firstname,firstcode,target) end if okay then ligatures[i]=false @@ -8690,12 +8697,14 @@ local function finalize_ligatures(tfmdata,ligatures) end alldone=done==0 end - if trace then - for k,v in next,characters do - if v.ligatures then table.print(v,k) end + if trace_ligatures_detail then + for k,v in table.sortedhash(characters) do + if v.ligatures then + table.print(v,k) + end end end - tfmdata.resources.private=private + resources.private=private end end local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist) @@ -8914,7 +8923,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end changed[unicode]=data elseif lookuptype=="alternate" then - local replacement=data[alternate] + local replacement=data[alternate] if replacement then changed[unicode]=replacement if trace_alternatives then -- cgit v1.2.3