summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-06-08 23:26:57 +0300
committerKhaled Hosny <khaledhosny@eglug.org>2010-06-08 23:36:43 +0300
commit54d2c5f1f4e5aaccadf4f4af472a497cab9645c8 (patch)
tree6dbe4330c7b913d995a098fb2bb09bbfecd484bf
parenteb75c5c0881d295b2cd45f8915114450034c731d (diff)
downloadluaotfload-54d2c5f1f4e5aaccadf4f4af472a497cab9645c8.tar.gz
Fallback to regular
If the requested style is not found, fallback to regular. I think this broke in commit b9d377647240804d7d85429a18e1bdf0ff00823c closes #13
-rw-r--r--otfl-font-nms.lua5
-rw-r--r--tests/fallback.tex6
2 files changed, 11 insertions, 0 deletions
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