From 54d2c5f1f4e5aaccadf4f4af472a497cab9645c8 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 8 Jun 2010 23:26:57 +0300 Subject: Fallback to regular If the requested style is not found, fallback to regular. I think this broke in commit b9d377647240804d7d85429a18e1bdf0ff00823c closes #13 --- otfl-font-nms.lua | 5 +++++ tests/fallback.tex | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/fallback.tex diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 73a45c9..54dcde8 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -189,6 +189,9 @@ function names.resolve(specification) found[1] = face break end + elseif subfamily == "regular" + or synonyms.regular[style] then + found.fallback = face end else if name == fullname @@ -237,6 +240,8 @@ function names.resolve(specification) name, style, closest.filename[1]) return closest.filename[1], closest.filename[2] end + elseif found.fallback then + return found.fallback.filename[1], found.fallback.filename[2] end -- no font found so far if not reloaded then diff --git a/tests/fallback.tex b/tests/fallback.tex new file mode 100644 index 0000000..71baea9 --- /dev/null +++ b/tests/fallback.tex @@ -0,0 +1,6 @@ +\input luaotfload.sty +\font\testa={XITS Math} +\font\testb={XITS Math/B} +\testa text\par +\testb text\par +\bye -- cgit v1.2.3