Changes

Jump to navigation Jump to search
2,228 bytes removed ,  18:34, 23 June 2013
adding a link to the new simplefonts page
Handling fonts in LuaTeX can be done
* in a simple but limited way, using the [[simplefonts|<code>simplefonts</code> module]];
* in the standard way, using [[TypeScripts]]
 
== With the <code>simplefonts</code> module ==
 
[http://www.ctan.org/tex-archive/macros/context/contrib/context-simplefonts simplefonts] is a third-party module written by Wolfgang Schuster.
 
It simplifies the use of fonts in LuaTeX by
* freeing the user from writing or using [[TypeScripts]];
* offering an interface similar to the [http://www.ctan.org/tex-archive/macros/xetex/latex/fontspec/ fontspec package for XeTeX]
 
For instance, assuming the [http://www.exljbris.com/delicious.html Delicious fonts] are properly installed and recognized by ConTeXt, you can simply write:
 
<texcode>
\usemodule[simplefonts] % load the module.
\setmainfont[Delicious] % set Delicious as main (serif) font
% \setmonofont[mymonofont]
% \setmathfont[mymathfont]
% \setsansfont[mysansfont]
 
\starttext
\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps
\stoptext
</texcode>
 
=== Installing <code>simplefonts</code> ===
 
* If you're using LuaTeX along with TeXlive 2009, <code>simplefonts</code> is already installed
* If you're running [[ConTeXt Standalone]], <code>simplefonts</code> can be installed like [http://wiki.contextgarden.net/ConTeXt_Standalone#Installing_third_party_modules any third-party module]:
first-setup.sh --modules="t-simplefonts"
 
=== Handling special cases ===
 
If the font in question has an unusual naming scheme and is missing some features, it may be necessary to specify the names to look for and the font features to implement. In [http://archive.contextgarden.net/message/20111017.113829.e2b20bf4.en.html this example] the font names do not end with *bold and *regular but with *fett and *nor (from the german words "fett" for bold and "normal" for regular). Also the font doesn't provide an italic font face, so it has to be emulated.
 
Wolfgang Schuster proposed the following [http://archive.contextgarden.net/message/20111017.144952.1a72175c.en.html solutions]:
 
<texcode>
\usemodule[simplefonts]
 
\definefontfeature[fakeitalic][default][slant=.25] % for fake bold use “extend=<number>”
 
\setmainfont
[telegrotesk]
[regularfont=* nor,
italicfont=* nor,
boldfont=* fett,
bolditalicfont=* fett,
italicfeatures=fakeitalic, % just the name of a fontfeature
bolditalicfeatures=fakeitalic]
</texcode>
== The standard way: Typescripts ==
139

edits

Navigation menu