luatex font path problem

Ken Brown kbrown@cornell.edu
Tue May 7 21:56:00 GMT 2013


On 4/29/2013 10:50 PM, Arthur Tu wrote:
> On 4/30/2013 12:47 AM, Ken Brown wrote:
>> On 4/28/2013 12:56 PM, Arthur Tu wrote:
>>> After lualatex command, file
>>> "~/.cache/texmf/luatex-cache/generic/names/otfl-names.lua" was
>>> generated.
>>>
>>> Entry like this for example
>>>    {
>>>     ["familyname"]="SimSun",
>>>     ["filename"]={ "c:/windows/fonts/simsun.ttc", 0 },
>>>     ["fontname"]="SimSun",
>>>     ["fullname"]="SimSun",
>>>     ["names"]={
>>>      ["family"]="SimSun",
>>>      ["fullname"]="SimSun",
>>>      ["psname"]="SimSun",
>>>      ["subfamily"]="Regular",
>>>     },
>>>     ["size"]={},
>>>     ["slant"]=0,
>>>     ["weight"]=400,
>>>     ["width"]=5,
>>>    },
>>>
>>> when I used \setmainfont{SimSun}, error occured that SimSun font not
>>> found.
>>> When i used \setmainjfont[Path=/cygdrive/c/windows/fonts/]{simsun.ttc}
> A typo here.
> \setmainjfont Should be \setmainfont. \setmainjfont only works when
> luatex-ja package is available.
>>> and specify the path in *unix-style, it works.
>>>
>>> So i think this is another mixed path style problem in cygwin.
>>> Even though the fonts in system dir are listed in otfl-names.lua, they
>>> can't be accessed because their pathes are in windows-style.
>>
>> I'm on vacation right now, but I'll look into this in mid-May when I
>> return.

I'm still on vacation but had a chance to look at this.  The problem is 
the Cygwin-specific code in 
/usr/share/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua.orig 
otfl-font-nms.lua.  If you remove that code (see the attached patch) and 
regenerate ~/.cache/texmf/luatex-cache/generic/names/otfl-names.lua, I 
think the problem will be solved.

Ken

-------------- next part --------------
--- otfl-font-nms.lua.orig	2012-12-21 18:12:14.000000000 -0500
+++ otfl-font-nms.lua	2013-05-07 13:33:36.478763100 -0400
@@ -393,7 +393,7 @@
         - reading symlinks under non-Win32
         - using kpse.readable_file on Win32
     ]]
-    if os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
+    if os.type == "windows" or os.type == "msdos" then
         path = path:gsub('\\', '/')
         path = path:lower()
         path = path:gsub('^/cygdrive/(%a)/', '%1:/')
@@ -600,7 +600,7 @@
             "/System/Library/Fonts",
             "/Network/Library/Fonts",
         }
-    elseif os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
+    elseif os.type == "windows" or os.type == "msdos" then
         local windir = os.getenv("WINDIR")
         return { file.join(windir, 'Fonts') }
     else

-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list