diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-10 00:14:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-10 00:14:41 +0000 |
commit | 1046dadf55dc14a285c03628230c033a16a4d0f2 (patch) | |
tree | 795748736701c68d567047308ceed2286177b405 /Master/texmf-dist/tex/luatex | |
parent | 7f4ad5e1fe8b4a36113dfa1677a989bbd2610c1e (diff) |
luaotfload update (28jun10)
git-svn-id: svn://tug.org/texlive/trunk@19327 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
5 files changed, 78 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua index 5a38735c0ee..75562d58f3b 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.13, - date = "2010/06/24", + version = 1.15, + date = "2010/06/28", description = "ConTeXt font loading 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 2681141bfd1..6ccfa8b4fe2 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty @@ -24,7 +24,7 @@ \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/06/24 v1.13 ConTeXt font loading system] + [2010/06/28 v1.15 ConTeXt font loading system] \RequirePackage{luatextra} \fi diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf b/Master/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf new file mode 100644 index 00000000000..f77de5b214a --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf @@ -0,0 +1,22 @@ +% Tackes ages to load +LastResort.ttf % a MacOSX font, but also available for free from unicode.org + +% Mac OS X TTC fonts, this list need to be filtered out +/Library/Fonts/AmericanTypewriter.ttc +/Library/Fonts/Baskerville.ttc +/Library/Fonts/Chalkboard.ttc +/Library/Fonts/Cochin.ttc +/Library/Fonts/Copperplate.ttc +/Library/Fonts/Didot.ttc +/Library/Fonts/Futura.ttc +/Library/Fonts/GillSans.ttc +/Library/Fonts/Hoefler Text.ttc +/Library/Fonts/MarkerFelt.ttc +/Library/Fonts/Optima.ttc +/Library/Fonts/Papyrus.ttc +/Library/Fonts/STHeiti Medium.ttc +/System/Library/Fonts/AquaKana.ttc +/System/Library/Fonts/HelveticaNeue.ttc +/System/Library/Fonts/LucidaGrande.ttc +/System/Library/Fonts/Menlo.ttc +/System/Library/Fonts/STHeiti Light.ttc 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 5aadd7b4aaa..ac3f0ba0b79 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua @@ -92,23 +92,9 @@ function names.load() end local synonyms = { - regular = { - normal = true, - roman = true, - plain = true, - book = true, - medium = true, - }, - italic = { - regularitalic = true, - normalitalic = true, - oblique = true, - slant = true, - }, - bolditalic = { - boldoblique = true, - boldslant = true, - }, + regular = { "normal", "roman", "plain", "book", "medium" }, + italic = { "regularitalic", "normalitalic", "oblique", "slant" }, + bolditalic = { "boldoblique", "boldslat" }, } local loaded = false @@ -164,7 +150,8 @@ function names.resolve(specification) found[1] = face break end - elseif synonyms[style] and synonyms[style][subfamily] then + elseif synonyms[style] and + table.contains(synonyms[style], subfamily) then if optsize then if dsnsize == size or (size > minsize and size <= maxsize) then @@ -177,8 +164,8 @@ function names.resolve(specification) found[1] = face break end - elseif subfamily == "regular" - or synonyms.regular[style] then + elseif subfamily == "regular" or + table.contains(synonyms.regular, subfamily) then found.fallback = face end else @@ -273,10 +260,18 @@ end local lastislog = 0 +function log(fmt, ...) + lastislog = 1 + texio.write_nl(format("luaotfload | %s", format(fmt,...))) + io.flush() +end + logs = logs or { } logs.report = logs.report or log logs.info = logs.info or log +local log = names.log + -- The progress bar local function progress(current, total) if trace_progress then @@ -355,6 +350,13 @@ local function load_font(filename, fontnames, newfontnames, texmf) local status = fontnames.status local basefile = texmf and basename(filename) or filename if filename then + if table.contains(names.blacklist, filename) or + table.contains(names.blacklist, basename(filename)) then + if trace_search then + logs.report("ignoring font '%s'", filename) + end + return + end local timestamp, db_timestamp db_timestamp = status[basefile] and status[basefile].timestamp timestamp = lfs.attributes(filename, "modification") @@ -446,13 +448,35 @@ end fonts.path_normalize = path_normalize -if os.name == "macosx" then - -- While Mac OS X 10.6 has a problem with TTC files, ignore them globally: - font_extensions = { "otf", "ttf", "dfont" } -else - font_extensions = { "otf", "ttf", "ttc", "dfont" } +names.blacklist = { } + +local function read_blacklist() + local files = { + kpse.lookup("otfl-blacklist.cnf", {all=true, format="tex"}) + } + local blacklist = names.blacklist + + if files and type(files) == "table" then + for _,v in next, files do + for line in io.lines(v) do + line = line:strip() -- to get rid of lines like " % foo" + if line:find("^%%") or line:is_empty() then + -- comment or empty line + else + line = line:split("%")[1] + line = line:strip() + if trace_search then + logs.report("blacklisted file: %s", line) + end + blacklist[#blacklist+1] = line + end + end + end + end end +local font_extensions = { "otf", "ttf", "ttc", "dfont" } + local function scan_dir(dirname, fontnames, newfontnames, texmf) --[[ this function scans a directory and populates the list of fonts @@ -481,7 +505,7 @@ local function scan_dir(dirname, fontnames, newfontnames, texmf) if trace_search then logs.report("%d fonts found in '%s'", nbfound, dirname) end - list = remove_ignore_fonts(list) -- fixme: general solution required + for _,file in next, list do file = path_normalize(file) if trace_loading then @@ -491,30 +515,6 @@ local function scan_dir(dirname, fontnames, newfontnames, texmf) end end --- Temporary until a general solution is implemented: -if os.name == "macosx" then - ignore_fonts = { - -- this font kills the indexer: - "/System/Library/Fonts/LastResort.ttf" - } - function remove_ignore_fonts(fonts) - for N,fnt in ipairs(fonts) do - if table.contains(ignore_fonts,fnt) then - if trace_search then - logs.report("ignoring font '%s'", fnt) - end - table.remove(fonts,N) - end - end - return fonts - end --- This function is only necessary, for now, on Mac OS X. -else - function remove_ignore_fonts(fonts) - return fonts - end -end - local function scan_texmf_fonts(fontnames, newfontnames) --[[ The function that scans all fonts in the texmf tree, through kpathsea @@ -700,6 +700,7 @@ local function update_names(fontnames, force) end end local newfontnames = fontnames_init() + read_blacklist() scan_texmf_fonts(fontnames, newfontnames) if expandpath("$OSFONTDIR"):is_empty() then scan_os_fonts(fontnames, newfontnames) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otc.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otc.lua index 551696f2cbf..35555ed05f6 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otc.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otc.lua @@ -94,14 +94,14 @@ local extra_features = { -- maybe just 1..n so that we prescribe order }, anum = { { - features = { { scripts = { { script = "arab", langs = { "dflt", "FAR" }, } }, tag = "anum", comment = "added bij mkiv" }, }, + features = { { scripts = { { script = "arab", langs = { "dflt", "ARA" }, } }, tag = "anum", comment = "added bij mkiv" }, }, name = "ctx_anum_1", subtables = { { name = "ctx_anum_1_s" } }, type = "gsub_single", flags = { }, }, { - features = { { scripts = { { script = "arab", langs = { "URD" }, } }, tag = "anum", comment = "added bij mkiv" }, }, + features = { { scripts = { { script = "arab", langs = { "FAR" }, } }, tag = "anum", comment = "added bij mkiv" }, }, name = "ctx_anum_2", subtables = { { name = "ctx_anum_2_s" } }, type = "gsub_single", |