summaryrefslogtreecommitdiff
path: root/luaotfload.dtx
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-09 21:01:30 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-09 21:01:30 +0200
commitfc83c9e8f100a4149896d0bbafed1ce6c3088bd0 (patch)
tree37db66d663bd206bca6892181adb03c3ac049dbf /luaotfload.dtx
parent5203d400f9e1e38f76580e4741236c76510fc5d7 (diff)
downloadluaotfload-fc83c9e8f100a4149896d0bbafed1ce6c3088bd0.tar.gz
fix font type forcing
Diffstat (limited to 'luaotfload.dtx')
-rw-r--r--luaotfload.dtx30
1 files changed, 14 insertions, 16 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx
index 74cf467..073ffa8 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -1259,17 +1259,6 @@ local reset_callback, call_callback =
local dummy_function = function () end
-% \end{macrocode}
-% No final decision has been made on how to handle font definition. At
-% the moment, there are three candidates: The \identifier{generic}
-% callback as hard-coded in the font loader, the \identifier{old}
-% wrapper, and a simplified version of the latter (\identifier{patch})
-% that does nothing besides applying font patches.
-%
-% \begin{macrocode}
-
-luaotfload.font_definer = "patch" --- | “generic” | “old”
-
local error, warning, info, log =
luatexbase.provides_module(luaotfload.module)
@@ -1611,13 +1600,22 @@ formats.ofm = "type1"
% most cases when looking up font files, only when generating the database.
%
% \begin{macrocode}
-request_resolvers.file = function (specification)
- local found = fonts.names.crude_file_lookup(specification.name)
- --local found = fonts.names.crude_file_lookup_verbose(specification.name)
- specification.name = found[1]
- --if format then specification.forced = format end
+
+local resolvefile = fonts.names.crude_file_lookup
+--local resolvefile = fonts.names.crude_file_lookup_verbose
+
+function request_resolvers.file(specification)
+ local name=resolvefile(specification.name)
+ local suffix=file.suffix(name)
+ if formats[suffix] then
+ specification.forced=suffix
+ specification.name=file.removesuffix(name)
+ else
+ specification.name=name
+ end
end
+
% \end{macrocode}
% We classify as \verb|anon:| those requests that have neither a
% prefix nor brackets. According to Khaled\footnote{%