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 | |
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')
-rw-r--r-- | Master/texmf-dist/doc/luatex/luaotfload/NEWS | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf | bin | 289770 -> 293999 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/luatex/luaotfload/Makefile | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx | 64 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua | 101 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/otfl-font-otc.lua | 4 |
9 files changed, 136 insertions, 75 deletions
diff --git a/Master/texmf-dist/doc/luatex/luaotfload/NEWS b/Master/texmf-dist/doc/luatex/luaotfload/NEWS index e9a3263a54e..662cc7c5900 100644 --- a/Master/texmf-dist/doc/luatex/luaotfload/NEWS +++ b/Master/texmf-dist/doc/luatex/luaotfload/NEWS @@ -1,6 +1,18 @@ Change History -------------- +2010/06/28, luaotfload v1.14: + * anum feature did not work as advertised + * add system shipped TTC fonts on Mac OS X to the blacklist, until the + culprit ones are isolated + +2010/06/25, luaotfload v1.14: + * fix mkluatexfontdb which was broken in the last version + * support general font blacklisting feature + * temporally re-enable ttc fonts on Mac OS X + * make sure mkluatexfontdb in verbose mode prints font filename before + attempting to load it + 2010/06/24, luaotfload v1.13: * fix typo in font cache path diff --git a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf Binary files differindex 81195b4b10f..74187bbd2a9 100644 --- a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf +++ b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf diff --git a/Master/texmf-dist/source/luatex/luaotfload/Makefile b/Master/texmf-dist/source/luatex/luaotfload/Makefile index 0dbcb178512..ddf2f45ff81 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/Makefile +++ b/Master/texmf-dist/source/luatex/luaotfload/Makefile @@ -3,7 +3,7 @@ NAME = luaotfload DOC = $(NAME).pdf DTX = $(NAME).dtx -OTFL = $(wildcard otfl-*.lua) +OTFL = $(wildcard otfl-*.lua) otfl-blacklist.cnf SCRIPT = mkluatexfontdb.lua # Files grouped by generation mode diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx index e191b4cf8fb..eb94174f964 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/06/24 v1.13 ConTeXt font loading system} +\Msg{* Package: luaotfload 2010/06/28 v1.15 ConTeXt font loading system} \Msg{************************************************************************} \keepsilent @@ -102,7 +102,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2010/06/24 v1.13 ConTeXt font loading system]% + [2010/06/28 v1.15 ConTeXt font loading system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb} \usepackage[colorlinks=true]{hyperref} @@ -140,7 +140,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2010/06/24 v1.13} +% \date{2010/06/28 v1.15} % \author{ Elie Roux\footnote{\texttt{elie.roux@telecom-bretagne.eu}} % \and Khaled Hosny\footnote{\texttt{khaledhosny@eglug.org}}} % @@ -197,8 +197,8 @@ and the derived files % with square brackets is synonymous to using the \texttt{file:} prefix. % % Accessing fonts by fontname allows loading system installed fonts as well as -% \textsc{texmf} ones, and requires a font names database that must be -% pre-generated; see Section~\ref{sec:fontdb} for more information. +% \textsc{texmf} ones, and requires a font names database; see +% Section~\ref{sec:fontdb} for more information. % % \paragraph{Font name} % @@ -304,35 +304,61 @@ and the derived files % \texttt{mapping=text-tex} using \XeTeX's input remapping feature.) % % -% \section{Maintaining the font database} +% \section{Font names database} % \label{sec:fontdb} % % As introduced in the previous section, \textsf{luaotfload} uses a database % to keep track of fonts available to \LuaTeX. Using this database, fonts can % be loaded by font name as well as filename. % -% This font database is maintained automatically as you add and remove fonts -% to/from your system. To update the database manually, run the script -% |mkluatexfontdb| that is included with this package. If you have not run it -% before, it may take quite some time to process every font on your computer. +% When \textsf{luaotfload} is asked to load a font by font name, it will check +% if font names database exists and load it, or generate a new database if non +% exists. This is all done automatically without user intervention. When the +% asked font is missing from the database, it will attempt to update the +% database and try to find the font again, so that the user can install new +% fonts without worrying about manually updating the database. +% +% However, it is sometimes desirable to update the database manually, so +% \textsf{luaotfload} provides a |mkluatexfontdb| utility to manually update +% the database. |mkluatexfontdb| is a lua script that can be either run +% directly or as an argument to |texlua|, depending on your system\footnote{ +% On MS Windows it can be run either by calling the wrapper application +% |mkluatexfontdb.exe| or with |texlua.exe mkluatexfontdb.lua|}. +% +% The first time the database is generated may take quite some time to process +% every font on your computer. % This is particularly noticeable if it occurs during a typesetting run. % Subsequent runs to update the database will be quite fast, however. % -% The script will parse standard places for fonts in your system to build the -% font database. Linux, it will use |fontconfig| to find the font locations; +% \textsf{luaotfload} will parse standard places for fonts in your system to +% build the font database. On Linux, it will read |fontconfig| configuration +% files to find the font locations; % on Windows and Mac~OS~X, it will search in the standard font locations, % |%WINDIR%\Fonts| in Windows and |~/Library/Fonts|, |/Library/Fonts|, % |/System/Library/Fonts|, and |/Network/Library/Fonts| in Mac~OS~X. % -% If you do not wish the script to search the standard font locations by -% default but would rather specify the exact locations in which to find your -% fonts, set the |OSFONTDIR| environment variable instead. When this variable -% is set, the script will only search in those directories. +% If you do not wish the standard font locations be searched by default but +% would rather specify the exact locations in which to find your fonts, set +% the |OSFONTDIR| environment variable instead. When this variable is set, +% only the specified directories will be searched. % % |mkluatexfontdb.lua --help| provides a brief summary of the functionality of % the script and includes some advanced options that we have not mentioned % here. % +% \subsection{Blacklisting fonts} +% +% Some fonts are problematic in \LuaTeX, if you found that your document takes +% too long to compile, or eats all the free memory, you can find the culprit +% file by running |mkluatexfontdb| utility with |-v| option to see which font +% file it is stuck with. You can then instruct \textsf{luaotfload} to ignore +% this font by adding it to the blacklist configuration file. +% +% Simply, create a file named |otfl-blacklist.cnf| and added the to be +% blacklisted files, one per line. Then put the file some where \textsf{kpse} +% can find. You can either use the base name or the full path. Any thing after +% a |%| sign is ignored. +% % \section{Required \ConTeXt\ files} % % This package is a wrapper for several files taken from the \ConTeXt\ macro @@ -409,8 +435,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", @@ -676,7 +702,7 @@ end \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/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", |