summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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