Changes

Jump to navigation Jump to search
434 bytes added ,  16:55, 13 May 2021
m
\replacemissingcharacters
'''Please, someone, fill this page !'''
'''This page is beeing regorganizedbeing reorganized'''
= Getting access Using [[LuaTeX]] as the processing engine in ConTeXt allows one to directly use fonts installed on the user's system . Instead of converting all fonts =into the standard <code>.tfm</code> and <code>.vf</code> formats (as outlined in some [[This Way - My Way#MyWay|My Way]] documents<ref>[http://dl.contextgarden.net/websitesarchive/atl/tex/OpenType.pdf OpenType in ConTeXt] by Adam Lindsay</ref><ref>[http://dl.contextgarden.net/myway/expertfonts.pdf Installing Expert Fonts: Minion Pro] by Idris Samawi Hamid</ref>), LuaTeX creates these metric files automatically at run-time. This greatly simplifies font installation in ConTeXt.
= How LuaTeX can use non-TeX handles system fonts (in OpenType, TrueType or Type1 format) directly. =
Mac OS users should note that many of their system LuaTeX can use fonts come packaged in the non-TeX format (e.g.dfont OpenType, TrueType or Type1 format) directly. When ConTeXt processes a file that uses such non-traditional fonts, the actual fonts themselves are loaded in LuaTeX's embedded section of fontforge to extract their metric information. This format removes the need for tfm and vf files on your disk, but it is Macalso a somewhat lengthy and often memory-specific and isn't recognized by LuaTeX ; but hungry process. Fortunately, the result of that internal preprocessing are also saved inside the free software [http://fondutexmf cache.sourceforge.net/#Fondu fondu] program Future runs using the same font (not just this file, but all files using that particular font) can be used to convert dfont fonts to TrueTypethen use the cached version of the metrics instead.
The first time Mac OS users should note that you run  context myfilethe current version of LuaTeX (0.tex on a file that uses such non-traditional fonts (which is probably always60), has severe problems dealing with the actual new TrueType collection fonts themselves have to be loaded in luatex's embedded section of fontforge to extract their metric informationSnow Leopard (Mac OS 10. This removes the need for tfm and vf files on your disk, but it is also a somewhat lengthy and often memory-hungry process6)That is why the results of that internal preprocessing are also saved inside the texmf cacheThe older Mac OS . Future runs using the same font (not just this file, but all files using that particular font) can then use the cached version of the metrics insteaddfont format works fine nowadays.
== Building the font database ==
You need to specify where the fonts should be looked for, by setting the <code>OSFONTDIR</code> environment variable. For instanceOn Windows,this might be achieved by running
set OSFONTDIR=c:/windows/fonts/
if the fonts should be found in <code>c:/windows/fonts/</code>; or. For Unix machines,
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"
if indicate that the fonts should be found in both <code>/usr/local/share/fonts</code> and <code>$HOME/.fonts</code>.
The font database will then be automatically generated in the next run of <code>context</code> . You can also generate it manually by typing mtxrun --script font --reloador equally
mtxrun --script fonts --reload
MTXrun | fontnames: 3837 files read, 3342 normal and 49 extra entries added, 5 rejected, 3386 valid
If mtxrun has problem finding the mtx-fonts.lua file, it may be necessary to regenerate ConTeXt's file database: context --generate
== Querying the font database ==
You only have to do the reload manually when you have installed updates to already installed fonts that cause the font and/or file names to change.
This normally only happens for fonts that are still in development like [[TeX Gyre- Old Content]] and [[Latin Modern]].
You can rebuild the database manually, using the already-mentioned command
to "no".
== References Get a warning if the glyph is missing ==
You need to add the command <code>\checkcharactersinfont</code> or(better) <code>\enabletrackers[http://contextfonts.aanhet.netmissing]</svn/contextman/context-reference/en/co-fontscode> in the preambleof your document.pdf The new manual chapter on fonts]
= Using fonts =In LMTX the command {{cmd|replacemissingcharacters}} will insert boxes where missing characters are expected. The boxes adhere to font style (italics, bold) and copying the box from PDF into the text editor will insert the missing glyph, so one can see the missing character without looking at the ''missing characters'' section of the log file.
Handling fonts in LuaTeX can be done
* in a simple but limited way, using the <code>simplefonts</code> module;
* in the standard way, using [[TypeScripts]]
== With the <code>simplefonts</code> module References ==
[http://wwwcontext.ctanaanhet.orgnet/tex-archivesvn/macroscontextman/context-reference/contriben/contextco-simplefonts simplefontsfonts.pdf The new manual chapter on fonts] 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://wwwpragma-ade.josbuivenga.demon.nlcom/general/manuals/deliciousmfonts.html Delicious fontspdf Old Fonts Manual by Hans Hagen] are properly installed and recognized by ConTeXt, you can simply write:
<texcode>\usemodule[simplefontshttp://pragma-ade.com/general/manuals/fonts-mkiv.pdf New Fonts Manual by Hans Hagen] % load the module\setmainfont[Delicious] % set Delicious as main (serif) font
\starttext
\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps
\stoptext
</texcode>
=== Installing <code>simplefonts</code> ==Using fonts =
* If you're using Handling fonts in LuaTeX along with TeXlive 2009, <code>simplefonts</code> is already installedcan be done* If you're running in a simple but limited way, using the [[ConTeXt Minimals]], Simplefonts - Old Content|<code>simplefonts</code> can be installed like [http://wiki.contextgarden.net/ConTeXt_Minimals#Installing_third_party_modules any third-party module]:]; first* in the standard way, using [[TypeScripts -setup.sh --extras="t-simplefonts"Old Content]]
== The standard way: Typescripts ==
\usetypefile[xx]
where ConTeXt prepends <code>type-</code> when it loads the file; but
<{{cmd>|usetypescriptfile</cmd> }} is the preferred command because it takes care of the<{{cmd>|starttypescriptcollection</cmd>}}/<{{cmd>|stoptypescriptcollection</cmd> }} environments. === Very simple example of typescript === If you are new to typescript you might have a look at this [[Simple Typescript Example]] to get a first idea how to use it.
=== Where to find existing typescripts ===
Each of the typescripts below defines a keyword to use with <{{cmd>|setupbodyfont</cmd>}}. Usually this is the same as the name of the typescript, but there is one exception (<code>antykwa-torunska</code>)
* Latin Modern (typescript name: <code>modern</code>; this is the default font set)
* Latin Modern variant (ts name: <code>modernvariable</code>; LM variable typewriter for serif)
* Postscript (ts name: <code>postscript</code>; Termes for serif, Heros for sans, Cursor for mono)
* Antykwa Toruńska (ts name: <code>antykwa-torunska</code>; only serif; defines <tt>antykwa</tt> as keyword for <{{cmd>|setupbodyfont</cmd>}})
* Iwona (ts name: <code>iwona</code>; only sans serif)
* Iwona Light, Medium and Heavy (ts names: <code>iwona-light</code>, <code>iwona-medium</code>, <code>iwona-heavy</code>; only sans; the medium variant is a small bit heavier than a "regular" one)
That's as simple as using a traditional ConTeXt typescript!
But ... how is it any different, then? Well, the difference is that in Mark IV, we can use an Opentype font directly, so that what is done here: when we want to use Palatino, the [[TeX Gyre- Old Content]] equivalent (“Pagella”) is called and we can use its Opentype “features”; read on.
==== Opentype features ====
</texcode>
 
= References =
<references/>
[[Category:Fonts]]
[[Category:International]]
138

edits

Navigation menu