From 49cdd10ba6dfc461ce5e70b61695ba2aba0cbeb7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 18 May 2014 23:36:26 +0000 Subject: context from May 18 beta/cont-tmf.zip (11854476 bytes) git-svn-id: svn://tug.org/texlive/trunk@34112 c570f23f-e606-0410-a88d-b1316a301751 --- .../generic/context/luatex/luatex-basics-gen.lua | 13 ++++ .../generic/context/luatex/luatex-fonts-enc.lua | 7 +- .../generic/context/luatex/luatex-fonts-merged.lua | 63 +++++++++++------ .../tex/generic/context/luatex/luatex-math.tex | 79 +++++++++++++++------- .../tex/generic/context/luatex/luatex-test.tex | 26 +++++++ 5 files changed, 141 insertions(+), 47 deletions(-) (limited to 'Master/texmf-dist/tex/generic/context') diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua index a304ab6aaa0..c19a49af39f 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua @@ -353,3 +353,16 @@ end function table.setmetatableindex(t,f) setmetatable(t,{ __index = f }) end + +-- helper for plain: + +arguments = { } + +if arg then + for i=1,#arg do + local k, v = string.match(arg[i],"^%-%-([^=]+)=?(.-)$") + if k and v then + arguments[k] = v + end + end +end diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua index e20c3a03b54..2e1c6a46674 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua @@ -11,9 +11,10 @@ if context then os.exit() end -local fonts = fonts -fonts.encodings = { } -fonts.encodings.agl = { } +local fonts = fonts +fonts.encodings = { } +fonts.encodings.agl = { } +fonts.encodings.known = { } setmetatable(fonts.encodings.agl, { __index = function(t,k) if k == "unicodes" then diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua index 60083ae2fa0..4dfefd65644 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/Master/texmf-dist/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/05/14 22:31:19 +-- merge date : 05/18/14 15:57:13 do -- begin closure to overcome local limits and interference @@ -125,7 +125,7 @@ local uppercase=R("AZ") local underscore=P("_") local hexdigit=digit+lowercase+uppercase local cr,lf,crlf=P("\r"),P("\n"),P("\r\n") -local newline=crlf+S("\r\n") +local newline=P("\r")*(P("\n")+P(true))+P("\n") local escaped=P("\\")*anything local squote=P("'") local dquote=P('"') @@ -147,8 +147,8 @@ patterns.utfbom_32_le=utfbom_32_le patterns.utfbom_16_be=utfbom_16_be patterns.utfbom_16_le=utfbom_16_le patterns.utfbom_8=utfbom_8 -patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") -patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") +patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n") +patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000") patterns.utf8one=R("\000\127") patterns.utf8two=R("\194\223")*utf8next patterns.utf8three=R("\224\239")*utf8next*utf8next @@ -2853,7 +2853,11 @@ local format_f=function(f) end local format_F=function(f) n=n+1 - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + if not f or f=="" then + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + else + return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + end end local format_g=function(f) n=n+1 @@ -3460,6 +3464,15 @@ end function table.setmetatableindex(t,f) setmetatable(t,{ __index=f }) end +arguments={} +if arg then + for i=1,#arg do + local k,v=string.match(arg[i],"^%-%-([^=]+)=?(.-)$") + if k and v then + arguments[k]=v + end + end +end end -- closure @@ -4170,6 +4183,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 +4195,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 @@ -4858,6 +4875,7 @@ end local fonts=fonts fonts.encodings={} fonts.encodings.agl={} +fonts.encodings.known={} setmetatable(fonts.encodings.agl,{ __index=function(t,k) if k=="unicodes" then texio.write(" ") @@ -8542,13 +8560,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) @@ -8631,8 +8650,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] @@ -8644,8 +8663,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={} } @@ -8668,8 +8687,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 @@ -8680,6 +8699,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 @@ -8689,12 +8710,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) @@ -8913,7 +8936,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/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex b/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex index ab304b97486..604b4a1f8d9 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex @@ -19,15 +19,6 @@ % a bunch of fonts: -\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt -\font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt -\font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt - -\font\tentt = file:lmmono10-regular.otf at 10pt -\font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt -\font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt -\font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt - \let \teni = \relax \let \seveni = \relax \let \fivei = \relax @@ -35,19 +26,58 @@ \let \sevensy = \relax \let \fivesy = \relax \let \tenex = \relax -\let \tenbf = \relax \let \sevenbf = \relax \let \fivebf = \relax -\tenrm +\def\latinmodern + {\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt + \font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt + \font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt + % + \font\tentt = file:lmmono10-regular.otf at 10pt + \font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbf = file:lmroman10-bold.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt + % + \font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt + \font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt + \font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt + % + \textfont 0 = \mathfonttextupright + \scriptfont 0 = \mathfontscriptupright + \scriptscriptfont 0 = \mathfontscriptscriptupright + % + \tenrm} -\font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt -\font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt -\font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt +\def\lucidabright + {\font\tenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt + \font\sevenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 7pt + \font\fiverm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 5pt + % + \font\tentt = file:lucidabrightot.otf at 10pt + \font\tenit = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenit = file:lucidabrightot-italic.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbf = file:lucidabrightot-demi.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbi = file:lucidabrightot-demiitalic.otf:+liga;+kern;+tlig;+trep at 10pt + % + \font\mathfonttextupright = file:lucidabrightmathot.otf:ssty=0;fixmath=yes at 10pt + \font\mathfontscriptupright = file:lucidabrightmathot.otf:ssty=1;fixmath=yes at 7pt + \font\mathfontscriptscriptupright = file:lucidabrightmathot.otf:ssty=2;fixmath=yes at 5pt + % + \textfont 0 = \mathfonttextupright + \scriptfont 0 = \mathfontscriptupright + \scriptscriptfont 0 = \mathfontscriptscriptupright + % + \tenrm} -\textfont 0 = \mathfonttextupright -\scriptfont 0 = \mathfontscriptupright -\scriptscriptfont 0 = \mathfontscriptscriptupright +\directlua { + if arguments["mtx:lucidabright"] then + tex.print("\string\\lucidabright") + else + tex.print("\string\\latinmodern") + end +} \newtoks\everymathrm \newtoks\everymathmit @@ -58,12 +88,12 @@ \newtoks\everymathbi \newtoks\everymathtt -\def\rm{\fam0\relax\the\everymathmrm\relax\tenrm\relax} -\def\it{\fam0\relax\the\everymathit \relax\tenit\relax} -\def\sl{\fam0\relax\the\everymathsl \relax\tensl\relax} -\def\bf{\fam0\relax\the\everymathbf \relax\tenbf\relax} -\def\bi{\fam0\relax\the\everymathbi \relax\tenbi\relax} -\def\tt{\fam0\relax\the\everymathtt \relax\tentt\relax} +\def\rm{\fam0\relax\the\everymathrm\relax\tenrm\relax} +\def\it{\fam0\relax\the\everymathit\relax\tenit\relax} +\def\sl{\fam0\relax\the\everymathsl\relax\tensl\relax} +\def\bf{\fam0\relax\the\everymathbf\relax\tenbf\relax} +\def\bi{\fam0\relax\the\everymathbi\relax\tenbi\relax} +\def\tt{\fam0\relax\the\everymathtt\relax\tentt\relax} \let\mit \relax % use names or \Uchar or define a vector \let\cal \relax % idem, i'm not in the mood for this now @@ -1799,7 +1829,8 @@ % a few definitions: -\def\sqrt{\Uroot "0 "221A } +\def\sqrt {\Uroot "0 "221A{}} +\def\root#1\of{\Uroot "0 "221A{#1}} % \skewchar\teni='177 \skewchar\seveni='177 \skewchar\fivei='177 % \skewchar\tensy='60 \skewchar\sevensy='60 \skewchar\fivesy='60 diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex b/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex index fbf8ce3cf2c..b822af66875 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex @@ -84,4 +84,30 @@ $$\sqrt {2} { { {1} \over { {1} \over {x} } } } $$ \cows Hello World! +% math test + +\latinmodern + +\def\sqrt{\Uroot "0 "221A{}} + +\def\root#1\of{\Uroot "0 "221A{#1}} + +Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$ + +$\root3\of x$ + +$\sin{x}$ + +\lucidabright + +\def\sqrt{\Uroot "0 "221A{}} + +\def\root#1\of{\Uroot "0 "221A{#1}} + +Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$ + +$\root3\of x$ + +$\sin{x}$ + \end -- cgit v1.2.3