summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-21 21:05:05 +0000
committerKarl Berry <karl@freefriends.org>2021-05-21 21:05:05 +0000
commit18c4b51ca1b98fb507d18afb9dbf02c3f0dd4baf (patch)
tree40df74fcad10980ff11a5c7a5dd2227af9ff7e2d /Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
parentb1faafa7a3280da5554864dc3b75351f780b7c74 (diff)
luaotfload (21may21)
git-svn-id: svn://tug.org/texlive/trunk@59293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua27
1 files changed, 21 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
index e6a38af5c3e..7d960922f47 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
@@ -370,13 +370,24 @@ if context then
local xmlconvert = xml.convert
local xmlfirst = xml.first
+ -- function otfsvg.filterglyph(entry,index)
+ -- -- we only support decompression in lmtx, so one needs to wipe the
+ -- -- cache when invalid xml is reported
+ -- local svg = xmlconvert(entry.data)
+ -- local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
+ -- local data = root and tostring(root)
+ -- -- report_svg("data for glyph %04X: %s",index,data)
+ -- return data
+ -- end
+
function otfsvg.filterglyph(entry,index)
- -- we only support decompression in lmtx, so one needs to wipe the
- -- cache when invalid xml is reported
- local svg = xmlconvert(entry.data)
+ local d = entry.data
+ if gzip.compressed(d) then
+ d = gzip.decompress(d) or d
+ end
+ local svg = xmlconvert(d)
local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
local data = root and tostring(root)
- -- report_svg("data for glyph %04X: %s",index,data)
return data
end
@@ -412,6 +423,9 @@ end
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -430,9 +444,10 @@ end
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -446,7 +461,7 @@ end
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then