From f7f60c1f72bb8c9cd64372c313e05cf46a570354 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 31 May 2010 19:37:50 +0300 Subject: Handle bypassing TFM fonts properly We now detect tfm fonts much earlier and force a file based lookup, thus bypassing |names.resolve()| completely. So, now |\font\tenrm=cmr10| is exactly the same as |\font\tenrm=file:cmr10| as long as there is a tfm/ofm file named cmr10. --- otfl-font-nms.lua | 18 ------------------ otfl-font-xtx.lua | 4 ++++ tests/tfmofm.ltx | 6 ++++++ 3 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 tests/tfmofm.ltx diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 0cad6b1..212a667 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -128,24 +128,6 @@ local loaded = false local reloaded = false function names.resolve(specification) - local tfm = resolvers.find_file(specification.name, "tfm") - local ext = lower(file.extname(specification.name)) - - if tfm then - -- is a tfm font, skip names database - if ext == 'tfm' then - return specification.name, false - else - return specification.name..'.tfm', false - end - elseif resolvers.find_file(specification.name, "ofm") then - if ext == 'ofm' then - return specification.name, false - else - return specification.name..'.ofm', false - end - end - local name = sanitize(specification.name) local style = sanitize(specification.style) or "regular" diff --git a/otfl-font-xtx.lua b/otfl-font-xtx.lua index 0fa2d69..236997c 100644 --- a/otfl-font-xtx.lua +++ b/otfl-font-xtx.lua @@ -203,6 +203,10 @@ function fonts.define.specify.colonized(specification) -- xetex mode list.optsize = nil end if list.name then + if resolvers.find_file(list.name, "ofm") then + list.lookup = "file" + end + specification.name = list.name list.name = nil end diff --git a/tests/tfmofm.ltx b/tests/tfmofm.ltx new file mode 100644 index 0000000..0f9f904 --- /dev/null +++ b/tests/tfmofm.ltx @@ -0,0 +1,6 @@ +\documentclass{article} +\usepackage{luaotfload} + +\begin{document} +Hello \(1+1=\sqrt{4}\) +\end{document} -- cgit v1.2.3