3

I'd like to use the Mac OS X (.dfont) Monaco with LuaLaTeX. With this input file

\documentclass{article}
\usepackage{fontspec}
\setmonofont{Monaco}
\begin{document}
\begin{verbatim}
    foo
\end{verbatim}
\end{document}

I get the following error message:

luaotfload | Font names database not found, generating new one.
             This can take several minutes; please be patient.
luaotfload | Updating the font names database:
luaotfload | Scanning TEXMF fonts...
luaotfload | Scanning OS fonts...
! LuaTeX error ...0/texmf-dist/tex/luatex/luaotfload/otfl-luat-dum.lua:67: bad 
argument #2 to 'find_file' (invalid option 'truetype dictionary').
<to be read again> 
                   \scan_stop: 
l.3 \setmonofont{Monaco}

This is the file list:

*File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty    2010/09/29 v2.1b Advanced font selection for XeLaTeX/LuaLaTeX
   expl3.sty    2010/09/16 v2022 L3 Experimental code bundle wrapper
 l3names.sty    2010/09/26 v2048 L3 Experimental Naming Scheme for TeX Primitives
  luatex.sty    2010/03/09 v0.4 LuaTeX basic definition package (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
luatex-loader.sty    2010/03/09 v0.4 Lua module loader (HO)
pdftexcmds.sty    2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO)
 ltxcmds.sty    2010/04/26 v1.7 LaTeX kernel commands for general use (HO)
l3basics.sty    2010/09/20 v2037 L3 Experimental basic definitions
 l3expan.sty    2010/09/20 v2037 L3 Experimental Argument Expansion module
    l3tl.sty    2010/09/21 v2040 L3 Experimental Token Lists
l3intexpr.sty    2010/09/22 v2045 L3 Integer Expressions
 l3quark.sty    2010/09/20 v2036 L3 Experimental Quark Commands
   l3seq.sty    2010/03/29 v1879 L3 Experimental sequences and stacks
  l3toks.sty    2010/09/20 v2037 L3 Experimental Token Registers
   l3int.sty    2010/09/19 v2029 L3 Experimental Integer module
   l3prg.sty    2010/09/22 v2043 L3 Experimental control structures
 l3clist.sty    2010/09/20 v2037 L3 Experimental comma separated lists
 l3token.sty    2010/09/19 v2029 L3 Experimental token investigation and manipulation
  l3prop.sty    2010/03/21 v1857 L3 Experimental Property Lists
   l3msg.sty    2010/03/23 v1866 L3 Experimental LaTeX Messages module
    l3io.sty    2010/05/22 v1923 L3 Experimental i/o module
  l3skip.sty    2010/09/23 v2047 L3 Experimental skip registers
   l3box.sty    2010/09/26 v2048 L3 Experimental Box module
l3keyval.sty    2010/04/11 v1890 L3 Experimental keyval processing
  l3keys.sty    2010/05/24 v1931 L3 Experimental key-value support
l3precom.sty    2010/02/09 v1793 L3 Experimental precompilation module
  l3xref.sty    2010/02/09 v1786 L3 Experimental cross referencing
  l3file.sty    2010/03/21 v1853 L3 Experimental file loading
    l3fp.sty    2010/09/19 v2029 L3 Experimental floating-point operations
l3luatex.sty    2010/07/18 v1985 L3 Experimental LuaTeX functions
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
  xparse.sty    2010/09/20 v2037 Generic document command parser
luatextra.sty    2010/08/02 v0.971 LuaTeX extra low-level macros
luatexbase-modutils.sty    2010/05/27 v0.2a Module utilities for LuaTeX
luatexbase-loader.sty    2010/05/27 v0.2a Lua module loader for LuaTeX
luatexbase-compat.sty    2010/05/27 v0.2a Compatibility tools for LuaTeX
luatexbase-attr.sty    2010/05/27 v0.2a Attributes allocation for LuaTeX
luatexbase-cctb.sty    2010/05/27 v0.2a Catcodetable allocation for LuaTeX
luatexbase-regs.sty    2010/05/27 v0.2a Registers allocation for LuaTeX
luatexbase-mcb.sty    2010/05/27 v0.2a Callback management for LuaTeX
 environ.sty    2008/06/18 v0.2 A new way to define environments
luaotfload.sty    2010/09/12 v1.19 OpenType layout system
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
fontspec-patches.sty    2010/09/29 v2.1b Advanced font selection for XeLaTeX/LuaLaTeX
fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX
 fontenc.sty
  eu2enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu2lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2010/05/18 v0.95 provides access to latin accents and many other characters in Unicode lower plane
fontspec.cfg

and this is what luatex --version tells me:

This is LuaTeX, Version beta-0.64.0-2010111215

Now the question is: what do I need to do in order to use Monaco with LuaLaTeX?

3
  • Well, anything but luatex version in texlive2010 is neither tested nor guaranteed to work with current luaotfload, that might be your actual problem but I won't bet on that. Dec 18, 2010 at 20:39
  • I can replicate this problem with Version beta-0.60.2-2010071217 (TeX Live 2010) (rev 3736) and a fully updated distribution. But the problem is not restricted to Monaco; I can't load any font any more.
    – Alan Munn
    Mar 22, 2011 at 14:03
  • Thanks for all answers. It was hard to decide, who gets the bounty and it was chosen by random. Too bad it doesn't work out of the box, but I'd guess this is just a matter of time.
    – topskip
    Mar 24, 2011 at 10:40

3 Answers 3

4
+50

I don't have a mac, but on d.c.t.t. someone had problems with Monaco too and if I did understand him right the source of the problem was the installation place: Monaco was in "the library folder in the systemfolder" while fonts which worked were "outside" the system folder.

Addition: You could try to change in otfl-luat-dum.lua the line 59 (probably) from truetype dictionary to truetype fonts:

-    dfont = "truetype dictionary",
+    dfont = "truetype fonts",

You could also try the version of luaotfload from the "unstable" branch (https://github.com/khaledhosny/luaotfload/tree/unstable). (I got it about two weeks ago and it seems to work fine.) Put it in a local texmf-tree where you can easily remove it if something goes wrong or when it becomes official.

I forgot: If you want to try the unstable version you will perhaps have to correct two things: In otfl-luat-dum.lua line 77 is missing an "s". Correct is

 found = kpse.find_file(name,"other text files")

And in fontspec.lua you will have to replace every fonts.ids by fonts.identifiers

3
  • My +1 and apologies since I didn't see you already mentioned the dictionary->font tricks! (BTW, what does d.c.t.t. stand for?)
    – chl
    Mar 22, 2011 at 21:59
  • d.c.t.t. = the (german) usenet group de.comp.text.tex. c.t.t.= comp.text.tex. And there is no need to apoligies. The same answer twice is better than no answer. Mar 23, 2011 at 7:46
  • 1
    The current "master" branch works well. Thanks for the pointer!
    – topskip
    Mar 24, 2011 at 10:40
3

I've followed the instructions provided on the [Dev-luatex] mailing, and it seems to work, after you replace dfont = "truetype dictionary" by dfont = "truetype fonts" in otfl-luat-dum.lua (fire up a Terminal window, and then find /usr/local -name "otfl-luat-dum.lua" to locate this file under your TeXLive root directory). Your example then compile fine and pdffonts said:

name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
BKOWUW+Monaco                        CID TrueType      yes yes yes      4  0
JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes      5  0
1

One workaround would be to install a font creation program which allows you to create a plain .otf version of the font. E.g. fontforge.

This can be done by loading the .dfont file in fontforge and selecting Generate Fonts with the OpenType (CFF) option.

Note that OS X apparently does not like fonts having the same name as a system font, so before converting it, you should have to rename the font using ElementFont Info.

The resulting .otf file is then ready to be found by luaotfload (you can even put it into the same directory as your .tex file as to minimise OS confusion).

Note that this process might or might not be forbidden by local law or license agreements.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .