summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-09-24 11:40:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-09-24 11:40:00 +0200
commit1eb36c19101fc0bb7a9d2257413fb072118e47d9 (patch)
tree61a4f1c2c0008ff667d3937f3db3837914779ee2 /tex/generic
parent43022156592c9bb4e359c03c283160de7f3b5b1c (diff)
downloadcontext-1eb36c19101fc0bb7a9d2257413fb072118e47d9.tar.gz
beta 2010.09.24 11:40
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua18
-rw-r--r--tex/generic/context/luatex-mplib.lua71
-rw-r--r--tex/generic/context/luatex-test.tex14
3 files changed, 71 insertions, 32 deletions
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
-