diff options
| -rw-r--r-- | tex/context/base/font-dum.lua | 6 | ||||
| -rw-r--r-- | tex/context/base/font-mis.lua | 2 | ||||
| -rw-r--r-- | tex/context/base/font-otf.lua | 10 | ||||
| -rw-r--r-- | tex/context/base/grph-inc.lua | 3 | ||||
| -rw-r--r-- | tex/context/base/mlib-run.lua | 2 | ||||
| -rw-r--r-- | tex/context/base/s-fnt-25.tex | 1 | ||||
| -rw-r--r-- | tex/context/fonts/lucida-math.lfg | 20 | ||||
| -rw-r--r-- | tex/generic/context/luatex-fonts-merged.lua | 18 | ||||
| -rw-r--r-- | tex/generic/context/luatex-mplib.lua | 71 | ||||
| -rw-r--r-- | tex/generic/context/luatex-test.tex | 14 | 
10 files changed, 107 insertions, 40 deletions
diff --git a/tex/context/base/font-dum.lua b/tex/context/base/font-dum.lua index 6e07a53ec..14d155aba 100644 --- a/tex/context/base/font-dum.lua +++ b/tex/context/base/font-dum.lua @@ -31,6 +31,8 @@ function fonts.definers.getspecification(str)      return "", str, "", ":", str  end +fonts.definers.registersplit("",fonts.definers.specifiers.variants[":"]) -- we add another one for catching lone [names] +  -- logger  fonts.logger = fonts.logger or { } @@ -89,6 +91,10 @@ end  fonts.names.resolvespec = fonts.names.resolve -- only supported in mkiv +function fonts.names.getfilename(askedname,suffix)  -- only supported in mkiv +    return "" +end +  -- For the moment we put this (adapted) pseudo feature here.  table.insert(fonts.triggers,"itlc") diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 2ae60e635..911ffd3fb 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -11,7 +11,7 @@ local lower, strip = string.lower, string.strip  fonts.otf = fonts.otf or { } -fonts.otf.version = fonts.otf.version or 2.702 +fonts.otf.version = fonts.otf.version or 2.705  fonts.otf.cache   = containers.define("fonts", "otf", fonts.otf.version, true)  function fonts.otf.loadcached(filename,format,sub) diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index ba6e90c4d..8a1791d9e 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -56,7 +56,7 @@ local definers       = fonts.definers  otf.glists           = { "gsub", "gpos" } -otf.version          = 2.702 -- beware: also sync font-mis.lua +otf.version          = 2.705 -- beware: also sync font-mis.lua  otf.cache            = containers.define("fonts", "otf", otf.version, true)  local loadmethod     = "table" -- table, mixed, sparse @@ -1067,6 +1067,7 @@ end  actions["analyze math"] = function(data,filename,raw)      if raw.math then +data.metadata.math = raw.math          -- we move the math stuff into a math subtable because we then can          -- test faster in the tfm copy          local glyphs, udglyphs = data.glyphs, data.udglyphs @@ -1294,6 +1295,13 @@ actions["check glyphs"] = function(data,filename,raw)              v.unicode = nil              v.index = nil          end +        -- only needed on non sparse/mixed mode +        if v.math then +            if v.mathkern      then v.mathkern      = nil end +            if v.horiz_variant then v.horiz_variant = nil end +            if v.vert_variants then v.vert_variants = nil end +        end +        --      end      data.luatex.comment = "Glyph tables have their original index. When present, kern tables are indexed by unicode."  end diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 08efa1a22..0a3346846 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -50,6 +50,7 @@ local allocate = utilities.storage.allocate  local ctxcatcodes    = tex.ctxcatcodes  local variables      = interfaces.variables  local codeinjections = backends.codeinjections +local nodeinjections = backends.nodeinjections  local trace_figures    = false  trackers.register("figures.locating",   function(v) trace_figures    = v end)  local trace_bases      = false  trackers.register("figures.bases",      function(v) trace_bases      = v end) @@ -153,7 +154,7 @@ figures.formats = allocate{      ["svg"]    = { list = { "svg", "svgz" } },      ["eps"]    = { list = { "eps", "ai" } },      ["gif"]    = { list = { "gif" } }, -    ["mov"]    = { list = { "mov", "avi" } }, +    ["mov"]    = { list = { "mov", "flv" } }, -- "avi" is not supported      ["buffer"] = { list = { "tmp", "buffer", "buf" } },      ["tex"]    = { list = { "tex" } },  } diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index 25c1cb022..fc993861c 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -109,7 +109,7 @@ if mplibone then      function metapost.make(name, target, version)          starttiming(mplib) -        target = file.replacesuffix(target or name, "mem") +        target = file.replacesuffix(target or name, "mem") -- redundant          local mpx = mplib.new ( table.merged (              metapost.parameters,              { diff --git a/tex/context/base/s-fnt-25.tex b/tex/context/base/s-fnt-25.tex index b2467fbd0..6f95d07c6 100644 --- a/tex/context/base/s-fnt-25.tex +++ b/tex/context/base/s-fnt-25.tex @@ -191,5 +191,6 @@ end      \setupbodyfont[mathtimes,12pt] \showmathfontcharacters      \setupbodyfont[stix,     12pt] \showmathfontcharacters      \setupbodyfont[xits,     12pt] \showmathfontcharacters +    \setupbodyfont[lucida,   12pt] \showmathfontcharacters  \stoptext diff --git a/tex/context/fonts/lucida-math.lfg b/tex/context/fonts/lucida-math.lfg index 83c3c272d..480418946 100644 --- a/tex/context/fonts/lucida-math.lfg +++ b/tex/context/fonts/lucida-math.lfg @@ -1,4 +1,6 @@ -fonts.enc.math["lbr-ma"] = { +local mathencodings = fonts.enc.math + +mathencodings["lbr-ma"] = {      [0x025CB] = 0x00, -- circle      [0x025CF] = 0x01, -- blackcircle      [0x025A1] = 0x02, -- square @@ -188,7 +190,7 @@ fonts.enc.math["lbr-ma"] = {      [0x022AF] = 0xFB, -- nVDash  } -fonts.enc.math["lbr-mb"] = { +mathencodings["lbr-mb"] = {      [0x00393] = 0x00, -- Gamma      [0x00394] = 0x01, -- Delta      [0x00398] = 0x02, -- Theta @@ -248,7 +250,7 @@ fonts.enc.math["lbr-mb"] = {      [0x1D718] = 0x9B, -- varkappa  } -fonts.enc.math["lbr-sy"] = { +mathencodings["lbr-sy"] = {      [0x021CB] = 0x8D, -- leftrightharpoons      [0x021CC] = 0x8E, -- rightleftharpoons      [0x02214] = 0x89, -- dotplus @@ -293,7 +295,12 @@ fonts.enc.math["lbr-sy"] = {      [0x025CA] = 0x05, -- lozenge  } -fonts.enc.math["lbr-sy"] = table.merged(fonts.enc.math["tex-sy"],fonts.enc.math["lbr-sy"]) + +mathencodings["lbr-sy"] = table.merged(mathencodings["tex-sy"],mathencodings["lbr-sy"]) + +mathencodings["lbr-fraktur"] = { } + +fonts.vf.math.setletters(mathencodings, "lbr-fraktur",  0x1D504, 0x1D51E)  return {      name = "lucida-math", @@ -314,6 +321,11 @@ return {                  { name = "hlcrv.tfm", vector = "tex-ex", extension = true },                  { name = "hlcra.tfm", vector = "lbr-ma" },                  { name = "hlcrm.tfm", vector = "lbr-mb" }, +                { name = "file:lbd.afm", vector = "tex-bf" }, +                { name = "file:lbdi.afm", vector = "tex-bi" } , +                { name = "file:lsr.afm", vector = "tex-ss" }, +                { name = "file:lstr.afm", vector = "tex-tt" }, +                { name = "file:lbl.afm", vector = "lbr-fraktur" }, -- more complete              }          }      } diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index de0d529c0..1cd549c18 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@  -- merged file : luatex-fonts-merged.lua  -- parent file : luatex-fonts.lua --- merge date  : 09/23/10 11:35:08 +-- merge date  : 09/24/10 11:40:36  do -- begin closure to overcome local limits and interference @@ -5506,7 +5506,7 @@ local definers       = fonts.definers  otf.glists           = { "gsub", "gpos" } -otf.version          = 2.702 -- beware: also sync font-mis.lua +otf.version          = 2.705 -- beware: also sync font-mis.lua  otf.cache            = containers.define("fonts", "otf", otf.version, true)  local loadmethod     = "table" -- table, mixed, sparse @@ -6517,6 +6517,7 @@ end  actions["analyze math"] = function(data,filename,raw)      if raw.math then +data.metadata.math = raw.math          -- we move the math stuff into a math subtable because we then can          -- test faster in the tfm copy          local glyphs, udglyphs = data.glyphs, data.udglyphs @@ -6744,6 +6745,13 @@ actions["check glyphs"] = function(data,filename,raw)              v.unicode = nil              v.index = nil          end +        -- only needed on non sparse/mixed mode +        if v.math then +            if v.mathkern      then v.mathkern      = nil end +            if v.horiz_variant then v.horiz_variant = nil end +            if v.vert_variants then v.vert_variants = nil end +        end +        --      end      data.luatex.comment = "Glyph tables have their original index. When present, kern tables are indexed by unicode."  end @@ -15646,6 +15654,8 @@ function fonts.definers.getspecification(str)      return "", str, "", ":", str  end +fonts.definers.registersplit("",fonts.definers.specifiers.variants[":"]) -- we add another one for catching lone [names] +  -- logger  fonts.logger = fonts.logger or { } @@ -15704,6 +15714,10 @@ end  fonts.names.resolvespec = fonts.names.resolve -- only supported in mkiv +function fonts.names.getfilename(askedname,suffix)  -- only supported in mkiv +    return "" +end +  -- For the moment we put this (adapted) pseudo feature here.  table.insert(fonts.triggers,"itlc") diff --git a/tex/generic/context/luatex-mplib.lua b/tex/generic/context/luatex-mplib.lua index 0afad083a..b3ab97b2c 100644 --- a/tex/generic/context/luatex-mplib.lua +++ b/tex/generic/context/luatex-mplib.lua @@ -25,7 +25,7 @@ else      local format, concat, abs, match = string.format, table.concat, math.abs, string.match      local mplib = require ('mplib') -    local kpse = require ('kpse') +    local kpse  = require ('kpse')      --[[ldx--      <p>We create a namespace and some variables to it. If a namespace is @@ -93,11 +93,11 @@ else          metapost.lastlog = ""      end -    metapost.make = metapost.make or function(name,mem_name,dump) -        if false then -            metapost.report("no format %s made for %s",mem_name,name) -            return false -        else +    local mplibone = tonumber(mplib.version()) <= 1.50 + +    if mplibone then + +        metapost.make = metapost.make or function(name,mem_name,dump)              local t = os.clock()              local mpx = mplib.new {                  ini_version = true, @@ -113,25 +113,52 @@ else              end              return mpx          end -    end -    function metapost.load(name) -        local mem_name = file.replacesuffix(name,"mem") -        local mpx = mplib.new { -            ini_version = false, -            mem_name = mem_name, -            find_file = metapost.finder -        } -        if not mpx and type(metapost.make) == "function" then -            -- when i have time i'll locate the format and dump -            mpx = metapost.make(name,mem_name) +        function metapost.load(name) +            local mem_name = file.replacesuffix(name,"mem") +            local mpx = mplib.new { +                ini_version = false, +                mem_name = mem_name, +                find_file = metapost.finder +            } +            if not mpx and type(metapost.make) == "function" then +                -- when i have time i'll locate the format and dump +                mpx = metapost.make(name,mem_name) +            end +            if mpx then +                metapost.report("using format %s",mem_name,false) +                return mpx, nil +            else +                return nil, { status = 99, error = "out of memory or invalid format" } +            end          end -        if mpx then -            metapost.report("using format %s",mem_name,false) -            return mpx, nil -        else -            return nil, { status = 99, error = "out of memory or invalid format" } + +    else + +        local preamble = [[ +            boolean mplib ; mplib := true ; +            let dump = endinput ; +            input %s ; +        ]] + +        metapost.make = metapost.make or function() +        end + +        function metapost.load(name) +            local mpx = mplib.new { +                ini_version = true, +                find_file = metapost.finder, +            } +            local result +            if not mpx then +                result = { status = 99, error = "out of memory"} +            else +                result = mpx:execute(format(preamble, file.replacesuffix(name,"mp"))) +            end +            metapost.reporterror(result) +            return mpx, result          end +      end      function metapost.unload(mpx) diff --git a/tex/generic/context/luatex-test.tex b/tex/generic/context/luatex-test.tex index a142d1635..594039053 100644 --- a/tex/generic/context/luatex-test.tex +++ b/tex/generic/context/luatex-test.tex @@ -17,20 +17,19 @@  \font\testc=file:lmroman12-regular:mode=node;+liga; at 24pt \testc effe flink fietsen \par  \font\testd=name:lmroman10bold                      at 12pt \testd a bit bold \par -\font\oeps=[lmroman12-regular]:+liga at 30pt \oeps crap -\font\oeps=[lmroman12-regular]       at 40pt \oeps more crap -  \font\oeps=cmr10 -\font\testx=ptmr8t \testx abc +\font\oeps=[lmroman12-regular]:+liga at 30pt \oeps crap +\font\oeps=[lmroman12-regular]       at 40pt \oeps more crap  \font\cidtest=adobesongstd-light  \font\mathtest=cambria(math) {\mathtest 123} -% \font\testy=file:IranNastaliq.ttf:mode=node;script=arab;language=dflt;+calt;+ccmp;+init;+isol;+medi;+fina;+liga;+rlig;+kern;+mark;+mkmk at 14pt -% \testy این یک متن نمونه است با قلم ذر که درست آمده است. -% \font\testz=name:linlibertineo \testz +\font\gothic=msgothic(ms-gothic) {\gothic whatever} + +\font\testy=file:IranNastaliq.ttf:mode=node;script=arab;language=dflt;+calt;+ccmp;+init;+isol;+medi;+fina;+liga;+rlig;+kern;+mark;+mkmk at 14pt +\testy این یک متن نمونه است با قلم ذر که درست آمده است.  \pdfprotrudechars2 \pdfadjustspacing2 @@ -50,4 +49,3 @@  \endmplibcode  \end -  | 
