[lltx] Fwd: [MacTeX] fontspec for LuaTeX

Khaled Hosny khaledhosny at eglug.org
Sun May 30 16:02:35 CEST 2010


On Sun, May 30, 2010 at 09:31:41PM +0930, Will Robertson wrote:
> Dear all,
> 
> Several issues below; I'll investigate some as best I can.
> I'll cc my own reply to this list.
> 
> Manuel, is the symlink issue for 64-bit Mac binaries a TL problem? Can you fix that?

I think we should no longer ask people to run mkluatexfontdb
script, luaotfload will take care of generating database.
Also, AFAIC, the script is the supposed to run from the same directory
where luaotfload and alt_getopt reside, anything else is not tested.

No real multiuser support either, there is a --sys option but it does
not work as advertised (i.e. it will index fonts that only accessible to
the user running it), and I don't personally support it either.

> 
> Secondly, same thing for alt_getopt ?
> 
> W
> 
> Begin forwarded message:
> 
> > From: Bruno Voisin <bvoisin at me.com>
> > Date: 30 May 2010 9:02:45 PM ACST
> > To: "MacOS X and TeX." <mactex at tug.org>
> > Subject: Re: [MacTeX] fontspec for LuaTeX
> > Reply-To: "MacOS X and TeX." <mactex at tug.org>
> > 
> > Le 29 mai 2010 à 10:14, Will Robertson a écrit :
> > 
> >> Any testing you could perform would be greatly appreciated, especially running the mkluatexfontdb script in the luaotfload package and then attempting to access system fonts in LuaLaTeX with fontspec.
> > 
> > It took some steps to reach that point:
> > 
> > 
> > - First problem: there is no mkluatexfontdb symlink in /usr/local/texlive/2010/bin/x86_64-darwin, only in /usr/local/texlive/2010/bin/universal-darwin. I had to switch from TeXLive-2010-64 to TeXLive-2010 in the TeX Dist system pref panel for mkluatexfontdb to be found.
> > 
> > 
> > - Second, more serious problem:
> > 
> > 	theo9mc182:~ bvoisin$ mkluatexfontdb --help
> > 	/usr/texbin/mkluatexfontdb:14: module 'alt_getopt' not found:
> > 		no field package.preload['alt_getopt']
> > 		[kpse lua searcher] file not found: 'alt_getopt'
> > 	[kpse C searcher] file not found: 'alt_getopt'
> > 	
> > Noticing there is a /usr/local/texlive/2010/texmf-dist/scripts/lua-alt-getopt/alt_getopt.lua, I tried to create a symlink apt_getopt to it in /usr/texbin but that didn't improve things
> > 
> > 	theo9mc182:universal-darwin bvoisin$ cd /usr/texbin
> > 	theo9mc182:texbin bvoisin$ sudo ln -s ../../texmf-dist/scripts/lua-alt-getopt/alt_getopt.lua alt_getopt
> > 	Password:
> > 	theo9mc182:texbin bvoisin$ mkluatexfontdb --help
> > 	/usr/texbin/mkluatexfontdb:14: module 'alt_getopt' not found:
> > 		no field package.preload['alt_getopt']
> > 		[kpse lua searcher] file not found: 'alt_getopt'
> > 		[kpse C searcher] file not found: 'alt_getopt'
> > 
> > Calling the symlink alt_getopt.lua did work:
> > 
> > 	theo9mc182:texbin bvoisin$ sudo ln -s ../../texmf-dist/scripts/lua-alt-getopt/alt_getopt.lua alt_getopt.lua
> > 	Password:
> > 	theo9mc182:texbin bvoisin$ mkluatexfontdb --help
> > 	Usage: mkluatexfontdb [OPTION]...
> > 	[...]
> > 	theo9mc182:texbin bvoisin$ sudo mkluatexfontdb -vv
> > 	
> > 	luaotfload | generating font names database.
> > 	[...]
> > 
> > 
> > The total output is included below, in case that can be of any help.

Forget about mkluatexfontdb, just process your tex document and
luaotfload will take care of font database generation.

> > 
> > A couple of thoughts:
> > 
> > 
> > - The same problem as with updmap vs updmap-sys remains, apparently, but it's even worse: if you want to make fonts known to LuaLaTeX system-wise, I thought you'd run
> > 
> > 	sudo -H mklualatexfontdb
> > 
> > But in this case (I tried) the font database is created in /var/root/.texlive2010/texmf-var, which won't be used unless you're logged in as root I imagine. Shouldn't /usr/texlive/2010/texmf-var be used instead?
> > 
> > And if you run either of
> > 
> > 	sudo mkluatexfontdb
> > 	mkluatexfontdb
> > 
> > the font database is created in ~/.texlive2010/texmf-var, ie for a given user only.
> > 
> > With that in mind, I think there should be two versions of mkluatexfontdb: one, the current one, using $TEXMFVAR for output, and the other, mkluatexfontdb-sys, using $TEXMFSYSVAR so that the LuaTeX font database can be created system-wise, not account-by-account.

It is essentially a single user script, no actual support for multiuser
systems, apart from installing the database in $TEXMFSYSVAR. It might
get multiuser at some point, but there are issues that need to be
thought about first.

> > 
> > 
> > - What happens with font duplicates? For example OS X contains the usual Microsoft Office fonts in .ttf format in /Library/Fonts, but upon installation Office installs its own versions, often in old FFIL suitcase format, in /Library/Fonts/Microsoft. I resolved the duplicates manually in Font Book by disactivating the Microsoft versions, but what happens with mkluatexfontdb?
> > 
> > In otfl-names.lua I noticed
> > 
> > 	  {
> > 	   ["familyname"]="Verdana",
> > 	   ["filename"]={ "/Library/Fonts/Verdana.ttf", false },
> > 	   ["fontname"]="Verdana",
> > 	   ["fullname"]="Verdana",
> > 	   ["names"]={
> > 	    ["family"]="Verdana",
> > 	    ["fullname"]="Verdana",
> > 	    ["psname"]="Verdana",
> > 	    ["subfamily"]="Regular",
> > 	   },
> > 	   ["size"]={},
> > 	   ["slant"]=0,
> > 	   ["weight"]=400,
> > 	   ["width"]=5,
> > 	  },
> > 
> > 	  ["/Library/Fonts/Verdana.ttf"]={
> > 	   ["index"]={ 654 },
> > 	   ["timestamp"]=1247723022,
> > 	  },
> > 
> > Does this mean subdirs of
> > 
> >    ~/Library/Fonts          /Library/Fonts
> >    /System/Library/Fonts    /Network/Library/Fonts
> > 
> > aren't searched? If so, that would mean things would work differently as for OS X (hence XeLaTeX) which does see fonts in subdirs of these.
> > 
> > The same duplicate problem would occur for us OSXers who install (as the MacTeX package allows optionally) the OpenType versions of the Latin Modern and TeX Gyre fonts in
> > 
> > 	/Library/Fonts/Latin Modern
> > 	/Library/Fonts/TeX Gyre
> > 
> > (ie duplicates there and in /usr/local/texlive/2010/texmf-dist/fonts/opentype/public).

Sub directories are definitely searched, duplicates are dealt in a
rather dump way; the last seen one takes precedence and others are
ignored. May be at some point we would consider checking font version
and keep the recent one, but font versions are a mess and can't be
relayed upon.

> > 
> > 
> > Finally I tried to typeset in LuaLaTeX a document written for XeLaTeX and using Verdana as its main font. Didn't work:
> > 
> > 	/usr/local/texlive/2010/texmf-dist/tex/luatex/luaotfload/luaotfload.sty:47: Lua
> > 	TeX error ...e/2010/texmf-dist/tex/luatex/luatexbase/modutils.lua:56: module 'l
> > 	uaotfload' not found:
> > 		no field package.preload['luaotfload']
> > 		[luatexbase.loader] Loading error:
> > 		/usr/local/texlive/2010/texmf-dist/tex/luatex/luaotfload/luaotfload.lua:23: ma
> > 	lformed number near '1.08a'
> > 		[kpse C searcher] file not found: 'luaotfload'
> > 		[oberdiek.luatex.kpse_module_loader] Search failed
> > 	stack traceback:
> > 		[C]: in function 'require'
> > 		...e/2010/texmf-dist/tex/luatex/luatexbase/modutils.lua:56: in function 'use_m
> > 	odule'
> > 		<\directlua >:1: in main chunk.
> > 	\luatexUseModule ...\luatexluaescapestring {#1}")}
> > 
> > and I gave up there.

That is my fault, I should have run it before uploading to CTAN.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the lualatex-dev mailing list