Luatex-fonts sets the internal font name to the full filename path,
thus \fontname\font returns filename, but this is not compatable with
LaTeX which assumes that \fontname will return tfm file name and use it
to re-call previously defined fonts, in luatex-fonts case this raises an
error because the filename isn't usable for defining fonts.

My suggestion is to store the full specification in the name feild so
that it can be used to recall the font (XeTeX does this too)

See the attached patch.

\input luatex-fonts
\font\xxx="[lmroman10-regular.otf]" at 20pt
\font\yyy="[lmroman10-regular.otf]" at 10pt
\font\zzz="[lmroman10-regular.otf]"

\fontname\xxx\par
\fontname\yyy\par
\fontname\zzz
\bye

(Comment out the first line and try it with xetex)

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua
index d01c5d7..3736699 100644
--- a/tex/context/base/font-otf.lua
+++ b/tex/context/base/font-otf.lua
@@ -1781,7 +1781,7 @@ function tfm.read_from_open_type(specification)
     local tfmtable = otf.otf_to_tfm(specification)
     if tfmtable then
         local otfdata = tfmtable.shared.otfdata
-        tfmtable.name = specification.name
+        tfmtable.name = specification
         tfmtable.sub = specification.sub
         local s = specification.size
         local m = otfdata.metadata.math
@@ -1832,7 +1832,7 @@ function tfm.read_from_open_type(specification)
             else
                 tfmtable.format = specification.format
             end
-            tfmtable.name = tfmtable.filename or tfmtable.fullname or tfmtable.fontname
+            tfmtable.name = tfmtable.name or tfmtable.filename or tfmtable.fullname or tfmtable.fontname
         end
         fonts.logger.save(tfmtable,file.extname(specification.filename),specification)
     end

Attachment: signature.asc
Description: Digital signature

Reply via email to