# Libertine fonts not working in ConTeXt

In a previous question about vertical rhythm, I was pointed at ConTeXt, which I am now trying to use. I first took the step from LaTeX to luaLaTeX in order to get simplified font selection and the possibility to use opentype fonts from the system or the directory of my tex file.

However, now that I use ConTeXt, `fontspec` (which was really straight forward) is no option any more. simplefonts is the next possibilty, but that doesn't ship with miktex (I have 2.9, win xp). I also have access to texlive 2010 running on Ubuntu, but that is not working as well. As I am more familiar with windows, I'm first trying to fix miktex. I installed context in addition to miktex 2.9 according to these instructions (Option 2) and everything seemed fine.

I am compiling the libertine sample from the ConTeXt wiki and get the following error:

``````pdfTeX error: pdftex (file fxlr): Font fxlr at 600 not found
``````

``````mtxrun --script fonts --reload
``````

with the result

``````MTXrun | unknown script 'fonts.lua' or 'mtx-fonts.lua'
``````
• What can I do to get the mtxrun to complete?
• what else has to be done to make the libertine fonts available to context?
• Also, how painful will it be (I'm absolutely frustrated regarding fonts.)?
-

Your error message says "pdftex". pdfTeX is not LuaTeX and so you are not using MkIV. The example won't work.

Forget the idea to use context with MiKTeX. There is a context in MiKTeX 2.9. (and it works) but it is not updated and the LuaTeX in MiKTeX is getting old. Also don't try to use something else as MkIV (that is ConTeXt over LuaTeX), ConTeXt is already complicated enough, there is no need to struggle with the installation of additional script languages like Ruby.

Get the ConTeXt minimals. And after you have initialized it with `setuptex.bat` compile your document with "context document".

-
Thanks @Ulrike, I rolled back the first installation and installed the minimals. However, the example output is in latin modern: `fonts > defining > font with asked name 'fxlr' is not found using lookup 'file'`. Do I need to run any other initialization scripts? –  Christoph Apr 16 '11 at 11:13
I don't know much about the high-level context commands. I can use libertine with the low-level command: `\font\test="name:linuxlibertineoregular"\test This is a test of Libertine fonts.`. But the libertine examples on the wiki don't work for me and the simplefonts module seems to be broken (I get a lua error). You could try to setup the typescript yourself (wiki.contextgarden.net/Fonts_in_LuaTeX). Or ask in the mailing list. –  Ulrike Fischer Apr 16 '11 at 13:48
ok, the low-level command worked (no ligatures yet, but I didn't specify anything there - so that's ok). With the link you posted I found out how to get a list of available fonts (which never worked before), and it seems that fxlr is indeed not available. –  Christoph Apr 16 '11 at 14:51

Posting this on behalf of Wolfgang Schuster

The fonts are not shipped with the minimals, you have them on your system under texmf-fonts which means they are installed by you.

The problem with the typescripts is that context use the names from ctan which are different from the sourceforge version of the font.

Ulrike's problem with simplefonts is that the module can’t find the font which can be the case when one loads it with `\setmainfont[Linux Libertine]` and not `\setmainfont[Linux Libertine O]` (the second has a “O” at the end of the name). The Lua error comes only when a font was not found and the module tries to use “DefaultFont” which has problems with fontfeatures (see message at the context-dev list).

Another solution to use the fonts are the spec-system (the MkIV version of Xserif for XeTeX), e.g.

``````\definetypeface[mainface][rm][specserif][Linux Libertine O][default]

\setupbodyfont[mainface]

\starttext
…
\stoptext
``````
-
I indeed have the `fx..` files under my miktex tree, but as Ulrike pointed out, ConTeXt and MikTeX are not a good couple. Nonetheless, the libertine files are named, for example, `fxlr.otf` for the libertine regular font. The typescript is looking for a file with exactly that name. I'll have to find out what the spec-system is... –  Christoph Apr 17 '11 at 9:09
@Christoph: You have two options: either manually install the fonts in a location where the minimals can find them (I usually use `\$TEXMF/texmf-fonts`, or make the minimals aware of the fonts in the miktex tree (tricky, I usually do this using symlinks in linux; not sure how to do this in windows). The easier solution will be to download the fonts from CTAN, and unzip them in `\$TEXMF/texmf-fonts` (create that directory if it does not exist). Then run `mtxrun --generate` and `mktexlsr`, and you should be able to use ConTeXt typescripts. –  Aditya Apr 17 '11 at 16:41
@Christoph: Another option is to install the fonts using windows, set `OSFONTDIR=C:\Windows\Fonts` in `setuptex.bat`, and using the simplefonts module (with `Linux Libertine O` as the font name) –  Aditya Apr 17 '11 at 16:43
@Aditya I've tried adding mathdesign for Adobe Utopia by unzipping it to `texmf-fonts` and, when using the font, got a message saying that it didn't understand `putri8a.afm`. I don't expect a solution to this now (because this error belongs to a different question), I just wanted to complete this. Maybe it's not a ConTeXt issue, but a MathDesign issue. –  Christoph Apr 18 '11 at 19:59
I reinstalled ConTeXt, which now completely refuses to work. Giving up now. Maybe I'll try this on a linux system later. –  Christoph Apr 18 '11 at 21:44