From 87c6a6ef44e21718b0eaf4e1e03a27806f6d750d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 17 Oct 2010 22:09:01 +0000 Subject: luaotfload 1.20 (16oct10) git-svn-id: svn://tug.org/texlive/trunk@20127 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luaotfload/NEWS | 6 ++++++ .../doc/luatex/luaotfload/luaotfload.pdf | Bin 184680 -> 184688 bytes .../source/luatex/luaotfload/luaotfload.dtx | 12 +++++------ .../tex/luatex/luaotfload/luaotfload.lua | 4 ++-- .../tex/luatex/luaotfload/luaotfload.sty | 2 +- .../tex/luatex/luaotfload/otfl-font-clr.lua | 17 ++++++++++++++- .../tex/luatex/luaotfload/otfl-font-nms.lua | 14 +++++++++++- .../tex/luatex/luaotfload/otfl-luat-dum.lua | 24 +++++++++++---------- .../tex/luatex/luaotfload/otfl-node-inj.lua | 18 ++++++++++------ 9 files changed, 69 insertions(+), 28 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/luatex/luaotfload/NEWS b/Master/texmf-dist/doc/luatex/luaotfload/NEWS index a2c26dee95a..3ab467890b7 100644 --- a/Master/texmf-dist/doc/luatex/luaotfload/NEWS +++ b/Master/texmf-dist/doc/luatex/luaotfload/NEWS @@ -1,6 +1,12 @@ Change History -------------- +2010/10/16, luaotfload v1.20: + * Make cache directory creation more robust + * Fix GPOS mark placement in left-to-right direction + * Reject fonts missing 'names' table + * Sanitize color value before attempting to use it + 2010/09/12, luaotfload v1.19: * fix LaTeX's detection (made Tikz fail under a non-LaTeX format) diff --git a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf index 93085729e97..fea5cd24dcc 100644 Binary files a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf and b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf differ diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx index fb1617adf69..6c3dafd7667 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx @@ -35,7 +35,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload 2010/09/12 v1.19 OpenType layout system} +\Msg{* Package: luaotfload 2010/10/16 v1.20 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -102,7 +102,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2010/09/12 v1.19 OpenType layout system]% + [2010/10/16 v1.20 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor} \usepackage{charter} @@ -153,7 +153,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2010/09/12 v1.19} +% \date{2010/10/16 v1.20} % \author{ Elie Roux\footnote{\texttt{elie.roux@telecom-bretagne.eu}} % \and Khaled Hosny\footnote{\texttt{khaledhosny@eglug.org}}} % @@ -450,8 +450,8 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.19, - date = "2010/09/12", + version = 1.20, + date = "2010/10/16", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", @@ -768,7 +768,7 @@ end \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/09/12 v1.19 OpenType layout system] + [2010/10/16 v1.20 OpenType layout system] \RequirePackage{luatextra} \fi diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua index ce2c201cc1a..cc3e3ed50ad 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua @@ -20,8 +20,8 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.19, - date = "2010/09/12", + version = 1.20, + date = "2010/10/16", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty index eb7f994ee68..4814924f393 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty @@ -25,7 +25,7 @@ \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/09/12 v1.19 OpenType layout system] + [2010/10/16 v1.20 OpenType layout system] \RequirePackage{luatextra} \fi diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-clr.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-clr.lua index a6cf63ffc9f..e02d22a6db9 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-clr.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-clr.lua @@ -15,8 +15,23 @@ local initializers, format = fonts.initializers, string.format table.insert(fonts.triggers,"color") function initializers.common.color(tfmdata,value) + local sanitized + if value then - tfmdata.color = tostring(value) + value = tostring(value) + if #value == 6 or #value == 8 then + sanitized = value + elseif #value == 7 then + _, _, sanitized = value:find("(......)") + elseif #value > 8 then + _, _, sanitized = value:find("(........)") + else + -- broken color code ignored, issue a warning? + end + end + + if sanitized then + tfmdata.color = sanitized add_color_callback() end end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua index 1f37d164a75..938b6bd39cb 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua @@ -257,7 +257,7 @@ local function font_fullinfo(filename, subfont, texmf) if trace_loading then logs.report("error: failed to open %s", filename) end - return nil + return end local m = fontloader.to_table(f) fontloader.close(f) @@ -284,6 +284,12 @@ local function font_fullinfo(filename, subfont, texmf) } end end + else + -- no names table, propably a broken font + if trace_loading then + logs.report("broken font rejected: %s", basefile) + end + return end t.fontname = m.fontname t.fullname = m.fullname @@ -345,6 +351,9 @@ local function load_font(filename, fontnames, newfontnames, texmf) if type(info) == "table" and #info > 1 then for i in next, info do local fullinfo = font_fullinfo(filename, i-1, texmf) + if not fullinfo then + return + end local index = newstatus[basefile].index[i] if newstatus[basefile].index[i] then index = newstatus[basefile].index[i] @@ -356,6 +365,9 @@ local function load_font(filename, fontnames, newfontnames, texmf) end else local fullinfo = font_fullinfo(filename, false, texmf) + if not fullinfo then + return + end local index if newstatus[basefile].index[1] then index = newstatus[basefile].index[1] diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua index e8e267a651e..96076977d0b 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua @@ -92,24 +92,26 @@ end do - local cachepaths = kpse.expand_path('$TEXMFCACHE') or "" + local cachepaths - if cachepaths == "" then - cachepaths = kpse.expand_path('$TEXMFVAR') + if kpse.expand_var('$TEXMFCACHE') ~= '$TEXMFCACHE' then + cachepaths = kpse.expand_var('$TEXMFCACHE') + elseif kpse.expand_var('$TEXMFVAR') ~= '$TEXMFVAR' then + cachepaths = kpse.expand_var('$TEXMFVAR') end - if cachepaths == "" then + if not cachepaths then cachepaths = "." end cachepaths = string.split(cachepaths,os.type == "windows" and ";" or ":") for i=1,#cachepaths do - if file.iswritable(cachepaths[i]) then - writable = file.join(cachepaths[i],"luatex-cache") - lfs.mkdir(writable) - writable = file.join(writable,caches.namespace) - lfs.mkdir(writable) + local done + writable = file.join(cachepaths[i], "luatex-cache") + writable = file.join(writable,caches.namespace) + writable, done = dir.mkdirs(writable) + if done then break end end @@ -121,10 +123,10 @@ do end if not writable then - texio.write_nl("quiting: fix your writable cache path") + texio.write_nl("quiting: fix your writable cache path\n") os.exit() elseif #readables == 0 then - texio.write_nl("quiting: fix your readable cache path") + texio.write_nl("quiting: fix your readable cache path\n") os.exit() elseif #readables == 1 and readables[1] == writable then texio.write(string.format("(using cache: %s)",writable)) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-node-inj.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-node-inj.lua index 5b55c8c2e85..fdea7f1f351 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-node-inj.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-node-inj.lua @@ -115,7 +115,7 @@ function nodes.set_mark(start,base,factor,rlmode,ba,ma,index) --ba=baseanchor, m set_attribute(base,markbase,bound) set_attribute(start,markmark,bound) set_attribute(start,markdone,index) - marks[bound] = { [index] = { dx, dy } } + marks[bound] = { [index] = { dx, dy, rlmode } } return dx, dy, bound end @@ -314,17 +314,23 @@ function nodes.inject_kerns(head,where,keep) local index = has_attribute(n,markdone) or 1 local d = mrks[index] if d then - -- local rlmode = d[3] -- not used - -- if rlmode and rlmode > 0 then - -- todo - -- else + local rlmode = d[3] + if rlmode and rlmode > 0 then + -- new per 2010-10-06 + local k = wx[p] + if k then -- maybe (d[1] - p.width) and/or + k[2] + n.xoffset = p.xoffset - (p.width - d[1]) - k[2] + else + n.xoffset = p.xoffset - (p.width - d[1]) + end + else local k = wx[p] if k then n.xoffset = p.xoffset - d[1] - k[2] else n.xoffset = p.xoffset - d[1] end - -- end + end if mk[p] then n.yoffset = p.yoffset + d[2] else -- cgit v1.2.3