From 9755d58202647a46a7ff5105362f9947c9b0d866 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Apr 2013 23:08:28 +0000 Subject: luaotfload (18apr13) git-svn-id: svn://tug.org/texlive/trunk@30026 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luaotfload/luaotfload.lua | 7 +++--- .../tex/luatex/luaotfload/luaotfload.sty | 2 +- .../tex/luatex/luaotfload/otfl-font-com.lua | 16 +++++++++++++ .../tex/luatex/luaotfload/otfl-font-nms.lua | 28 +++++++++++++--------- .../tex/luatex/luaotfload/otfl-font-otf.lua | 2 +- .../tex/luatex/luaotfload/otfl-luat-dum.lua | 2 +- 6 files changed, 40 insertions(+), 17 deletions(-) create mode 100644 Master/texmf-dist/tex/luatex/luaotfload/otfl-font-com.lua (limited to 'Master/texmf-dist/tex/luatex') diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua index f66221fa93a..ab837536af3 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua @@ -7,7 +7,7 @@ -- luaotfload.dtx (with options: `lua') -- This is a generated file. -- --- Copyright (C) 2009-2010 by by Elie Roux +-- Copyright (C) 2009-2013 by by Elie Roux -- and Khaled Hosny -- (Support: .) -- @@ -21,8 +21,8 @@ module("luaotfload", package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.27, - date = "2012/05/28", + version = 1.28, + date = "2013/04/11", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", @@ -107,6 +107,7 @@ local function def_font(...) end return fontdata end +fonts.define.resolvers.file = fonts.define.resolvers.name fonts.mode = "node" local register_base_sub = fonts.otf.features.register_base_substitution local gsubs = { diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty index e865ed13f3f..02c913e76ae 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty @@ -7,7 +7,7 @@ %% luaotfload.dtx (with options: `package') %% This is a generated file. %% -%% Copyright (C) 2009-2010 by by Elie Roux +%% Copyright (C) 2009-2013 by by Elie Roux %% and Khaled Hosny %% (Support: .) %% diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-com.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-com.lua new file mode 100644 index 00000000000..4b6d8162f56 --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-com.lua @@ -0,0 +1,16 @@ +if not modules then modules = { } end modules ['font-com'] = { + version = 1.002, + comment = "Luaotfload backward compatibility module", + author = "Elie Roux", + copyright = "Luaotfload Development Team", + license = "GNU GPL v2" +} + +fonts = fonts or { } +local fonts = fonts + +-- In new ConTeXt versions, fonts.identifiers is renamed in +-- fonts.hashes.identifiers, this break fontspec from TeXLive 2012 +if not fonts.identifiers then + fonts.identifiers = fonts.hashes.identifiers +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 a8b3100937a..50febabc219 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua @@ -76,9 +76,12 @@ end local synonyms = { regular = { "normal", "roman", "plain", "book", "medium" }, - bold = { "boldregular", "demi", "demibold" }, + -- boldregular was for old versions of Linux Libertine, is it still useful? + -- semibold is in new versions of Linux Libertine, but there is also a bold, + -- not sure it's useful here... + bold = { "demi", "demibold", "semibold", "boldregular" }, italic = { "regularitalic", "normalitalic", "oblique", "slanted" }, - bolditalic = { "boldoblique", "boldslanted", "demiitalic", "demioblique", "demislanted", "demibolditalic" }, + bolditalic = { "boldoblique", "boldslanted", "demiitalic", "demioblique", "demislanted", "demibolditalic", "semibolditalic" }, } local loaded = false @@ -493,8 +496,8 @@ local function scan_texmf_fonts(fontnames, newfontnames) else logs.info("Scanning TEXMF and OS fonts...") end - local fontdirs = expandpath("$OPENTYPEFONTS"):gsub("^\.", "") - fontdirs = fontdirs .. expandpath("$TTFONTS"):gsub("^\.", "") + local fontdirs = expandpath("$OPENTYPEFONTS"):gsub("^%.", "") + fontdirs = fontdirs .. expandpath("$TTFONTS"):gsub("^%.", "") if not fontdirs:is_empty() then for _,d in next, splitpath(fontdirs) do scan_dir(d, fontnames, newfontnames, true) @@ -515,14 +518,16 @@ end in OSFONTDIR. ]] -local function read_fonts_conf(path, results) +local function read_fonts_conf(path, results, passed_paths) --[[ This function parses /etc/fonts/fonts.conf and returns all the dir it finds. The code is minimal, please report any error it may generate. ]] local f = io.open(path) + table.insert(passed_paths, path) if not f then - error("Cannot open the file "..path) + logs.info("Warning: unable to read "..path.. ", skipping...") + return results end local incomments = false for line in f:lines() do @@ -571,14 +576,15 @@ local function read_fonts_conf(path, results) elseif not lfs.isfile(include) and not lfs.isdir(include) then include = file.join(file.dirname(path), include) end - if lfs.isfile(include) then - -- maybe we should prevent loops here? + if lfs.isfile(include) and kpse.readable_file(include) and not table.contains(passed_paths, include) then -- we exclude path with texmf in them, as they should -- be found otherwise - read_fonts_conf(include, results) + read_fonts_conf(include, results, passed_paths) elseif lfs.isdir(include) then for _,f in next, glob(file.join(include, "*.conf")) do - read_fonts_conf(f, results) + if not table.contains(passed_paths, f) then + read_fonts_conf(f, results, passed_paths) + end end end end @@ -604,7 +610,7 @@ local function get_os_dirs() local windir = os.getenv("WINDIR") return { file.join(windir, 'Fonts') } else - return read_fonts_conf("/etc/fonts/fonts.conf", {}) + return read_fonts_conf("/etc/fonts/fonts.conf", {}, {}) end end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otf.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otf.lua index b46bc91915f..ce540865574 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otf.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otf.lua @@ -1100,7 +1100,7 @@ otf.enhancers["reorganize kerns"] = function(data,filename) if type(lookups) ~= "table" then lookups = { lookups } end - local maxfirsts, maxseconds = getn(firsts), getn(seconds) + local maxfirsts, maxseconds = #firsts, #seconds -- here we could convert split into a list of unicodes which is a bit -- faster but as this is only done when caching it does not save us much for _, s in next, firsts do 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 2f6627ff798..13b73b17fff 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua @@ -62,7 +62,7 @@ local remapper = { } function resolvers.find_file(name,kind) - name = string.gsub(name,"\\","\/") + name = string.gsub(name,"\\","/") kind = string.lower(kind) return kpse.find_file(name,(kind and kind ~= "" and (remapper[kind] or kind)) or file.extname(name,"tex")) end -- cgit v1.2.3