Re: [luatex] Lua interpreter difference between Windows and Mac

2017-02-19 Thread Br. Samuel Springuel

On 2017-02-19 2:02 AM, Akira Kakuto wrote:

Probably kpse.find_file(filename) on windows without file type
searches TEXINPUTS by default. Try by adding file type as follows:

kpse.set_program_name('texlua')
font_target = "greciliae.ttf"
font_directory = kpse.find_file(font_target, 'truetype fonts')
print(font_directory)


That does seem to have fixed the problem.  Thanks.

--
✝
Br. Samuel, OSB
St. Anselm’s Abbey
Washington, DC
(R. Padraic Springuel)

PAX ☧ ΧΡΙΣΤΟΣ


[luatex] Lua interpreter difference between Windows and Mac

2017-02-18 Thread Br. Samuel Springuel

I'm writing a lua script which has the following code block:

  font_target = "greciliae.ttf"
  font_directory = kpse.find_file(font_target)
  print(font_directory)

Given that greciliae.ttf is installed in 
$TEXMFLOCAL/fonts/truetype/public/gregoriotex, the code block works fine 
on my Mac (10.11.6) when executed by texlua (and I assume on other Unix 
flavors, though I haven't tested that yet).  However, when I test the 
same code on a Windows (10) machine, font_directory ends up being nil.


When I type `kpsewhich greciliae.ttf` at the command prompt on the 
Windows machine, I get the proper path returned, so I know that 
kpsewhich can find the file.


If I switch font_target to a "gregoriotex.sty" (which is installed in 
$TEXMFLOCAL/tex/lualatex/gregoriotex/) font_directory returns the proper 
value on both machines.  Thus I know that kpse.find_file does actually 
work, at least some of the time, on Windows.


Why isn't kpse.find_file finding fonts that kpsewhich can find on 
Windows?  Am I doing something wrong?


Both machines are running version 0.95.0 (TeXLive 2016) of texlua.
--
✝
Br. Samuel, OSB
St. Anselm’s Abbey
Washington, DC
(R. Padraic Springuel)

PAX ☧ ΧΡΙΣΤΟΣ