Changes

Jump to navigation Jump to search
1,348 bytes removed ,  22:50, 31 May 2009
+section: Getting access to the system fonts
'''This page is beeing regorganized'''
 
= Getting access to the system fonts =
 
== Building the font database ==
 
You can make LuaTeX access the non-TeX fonts (Type 1, True Type and OpenType) on your system by building a font database.
 
First, you need to specify where the fonts should be looked for, by setting the <code>OSFONTDIR</code> environment variable. For instance,
set OSFONTDIR=c:/windows/fonts/
if the fonts should be found in <code>c:/windows/fonts/</code>; or
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"
if the fonts should be found in both <code>/usr/local/share/fonts</code> and <code>$HOME/.fonts</code>.
 
You can then generate the font database by typing
mtxrun --script font --reload
or equally
mtxrun --script fonts --reload
 
The output should look like
MTXrun | fontnames: identifying tree font files with suffix otf
MTXrun | fontnames: identifying tree font files with suffix OTF
MTXrun | fontnames: 331 tree files identified, 332 hash entries added, runtime 7.653 seconds
MTXrun | fontnames: identifying tree font files with suffix ttf
MTXrun | fontnames: identifying tree font files with suffix TTF
MTXrun | fontnames: 17 tree files identified, 14 hash entries added, runtime 4.645 seconds
...
MTXrun | fontnames: 94 system files identified, 94 hash entries added, runtime 0.554 seconds
MTXrun | fontnames: 3837 files read, 3342 normal and 49 extra entries added, 5 rejected, 3386 valid
 
 
 
== Querying the font database ==
 
The command
mtxrun --script fonts --list
will return the whole entries of the font database as a list, such as
 
...
warnockprobold WarnockPro-Bold E:/Fonts/Warnock Pro/WarnockPro-Bold.otf
warnockproboldcapt WarnockPro-BoldCapt E:/Fonts/Warnock Pro/WarnockPro-BoldCapt.otf
warnockprobolddisp WarnockPro-BoldDisp E:/Fonts/Warnock Pro/WarnockPro-BoldDisp.otf
warnockproboldit WarnockPro-BoldIt E:/Fonts/Warnock Pro/WarnockPro-BoldIt.otf
warnockprobolditcapt WarnockPro-BoldItCapt E:/Fonts/Warnock Pro/WarnockPro-BoldItCapt.otf
warnockprobolditdisp WarnockPro-BoldItDisp E:/Fonts/Warnock Pro/WarnockPro-BoldItDisp.otf
warnockprobolditsubh WarnockPro-BoldItSubh E:/Fonts/Warnock Pro/WarnockPro-BoldItSubh.otf
warnockproboldsubh WarnockPro-BoldSubh E:/Fonts/Warnock Pro/WarnockPro-BoldSubh.otf
...
 
You can query the database against a particular pattern. For instance,
mtxrun --script fonts --list --pattern=Delicious*
will return
deliciousbold Delicious-Bold /usr/local/share/fonts/d/delicious_bold.otf
deliciousbolditalic Delicious-BoldItalic /usr/local/share/fonts/d/delicious_bolditalic.otf
deliciousheavy Delicious-Heavy /usr/local/share/fonts/d/delicious_heavy.otf
deliciousitalic Delicious-Italic /usr/local/share/fonts/d/delicious_italic.otf
deliciousroman Delicious-Roman /usr/local/share/fonts/d/delicious_roman.otf
delicioussmallcaps Delicious-SmallCaps /usr/local/share/fonts/d/delicious_smallcaps.otf
 
You can get useful informations about your fonts by using the <code>--info</code> option. For instance,
mtxrun --script fonts --list --info --pattern=Delicious*Roman
will return
MTXrun | fontname: deliciousroman
MTXrun | fullname: Delicious-Roman
MTXrun | filename: /usr/local/share/fonts/d/delicious_roman.otf
MTXrun |
MTXrun | gpos features:
MTXrun |
MTXrun | feature script languages
MTXrun |
MTXrun | kern latn dflt
MTXrun |
MTXrun | gsub features:
MTXrun |
MTXrun | feature script languages
MTXrun |
MTXrun | tlig all all
MTXrun | trep all all
 
== Installing new fonts ==
 
After installing new fonts, the font datamase must be rebuilt for LuaTeX to access them.
 
You can rebuild the database manually, using the already-mentioned command
mtxrun --script fonts --reload
 
Alternatively, you can get the database to be automatically rebuilt when needed -- that is, on 'font not found' errors. To do so, set either of
MTX.FONTS.AUTOLOAD
MTX_FONTS_AUTOLOAD
to "yes".
 
= Old contents =
==== Good ol' typescripts ====
</texcode>
==== Using System Fonts ====
 
LuaTeX can see system fonts if you set the <code>OSFONTDIR</code> variable, for instance
set OSFONTDIR=c:/windows/fonts//
OSFONTDIR can contain a list of directories separated by semicolons, such as
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"
After installing new fonts or changing the value of OSFONTDIR, you must regenerate the font name database:
mtxrun --script font --reload
= Old contents =
Just the simplest way to use an otf font — or any font that does appear in <tt>mtxrun --script font --list</tt> — in all the document.
== Example ==
 
First run
 
$ mtxrun --script fonts --list --pattern=*warnock*
 
You'll get a list of fonts containing the string ''warnock''
 
warnockprobold WarnockPro-Bold E:/Fonts/Warnock Pro/WarnockPro-Bold.otf
warnockproboldcapt WarnockPro-BoldCapt E:/Fonts/Warnock Pro/WarnockPro-BoldCapt.otf
warnockprobolddisp WarnockPro-BoldDisp E:/Fonts/Warnock Pro/WarnockPro-BoldDisp.otf
warnockproboldit WarnockPro-BoldIt E:/Fonts/Warnock Pro/WarnockPro-BoldIt.otf
warnockprobolditcapt WarnockPro-BoldItCapt E:/Fonts/Warnock Pro/WarnockPro-BoldItCapt.otf
warnockprobolditdisp WarnockPro-BoldItDisp E:/Fonts/Warnock Pro/WarnockPro-BoldItDisp.otf
warnockprobolditsubh WarnockPro-BoldItSubh E:/Fonts/Warnock Pro/WarnockPro-BoldItSubh.otf
warnockproboldsubh WarnockPro-BoldSubh E:/Fonts/Warnock Pro/WarnockPro-BoldSubh.otf
warnockprobook WarnockPro-Regular E:/Fonts/Warnock Pro/WarnockPro-Regular.otf
warnockprocapt WarnockPro-Capt E:/Fonts/Warnock Pro/WarnockPro-Capt.otf
warnockprocaptionbold WarnockPro-BoldCapt E:/Fonts/Warnock Pro/WarnockPro-BoldCapt.otf
warnockprocaptionbook WarnockPro-Capt E:/Fonts/Warnock Pro/WarnockPro-Capt.otf
warnockprodisp WarnockPro-Disp E:/Fonts/Warnock Pro/WarnockPro-Disp.otf
warnockprodisplaybold WarnockPro-BoldDisp E:/Fonts/Warnock Pro/WarnockPro-BoldDisp.otf
warnockprodisplaybook WarnockPro-Disp E:/Fonts/Warnock Pro/WarnockPro-Disp.otf
warnockproit WarnockPro-It E:/Fonts/Warnock Pro/WarnockPro-It.otf
warnockproitcapt WarnockPro-ItCapt E:/Fonts/Warnock Pro/WarnockPro-ItCapt.otf
warnockproitdisp WarnockPro-ItDisp E:/Fonts/Warnock Pro/WarnockPro-ItDisp.otf
warnockproitsubh WarnockPro-ItSubh E:/Fonts/Warnock Pro/WarnockPro-ItSubh.otf
warnockprolight WarnockPro-Light E:/Fonts/Warnock Pro/WarnockPro-Light.otf
warnockprolightcapt WarnockPro-LightCapt E:/Fonts/Warnock Pro/WarnockPro-LightCapt.otf
warnockprolightcaptionlight WarnockPro-LightCapt E:/Fonts/Warnock Pro/WarnockPro-LightCapt.otf
warnockprolightdisp WarnockPro-LightDisp E:/Fonts/Warnock Pro/WarnockPro-LightDisp.otf
warnockprolightdisplaylight WarnockPro-LightDisp E:/Fonts/Warnock Pro/WarnockPro-LightDisp.otf
warnockprolightit WarnockPro-LightIt E:/Fonts/Warnock Pro/WarnockPro-LightIt.otf
warnockprolightitcapt WarnockPro-LightItCapt E:/Fonts/Warnock Pro/WarnockPro-LightItCapt.otf
warnockprolightitdisp WarnockPro-LightItDisp E:/Fonts/Warnock Pro/WarnockPro-LightItDisp.otf
warnockprolightitsubh WarnockPro-LightItSubh E:/Fonts/Warnock Pro/WarnockPro-LightItSubh.otf
warnockprolightlight WarnockPro-Light E:/Fonts/Warnock Pro/WarnockPro-Light.otf
warnockprolightsubh WarnockPro-LightSubh E:/Fonts/Warnock Pro/WarnockPro-LightSubh.otf
warnockprolightsubheadlight WarnockPro-LightSubh E:/Fonts/Warnock Pro/WarnockPro-LightSubh.otf
warnockproregular WarnockPro-Regular E:/Fonts/Warnock Pro/WarnockPro-Regular.otf
warnockprosemibold WarnockPro-Semibold E:/Fonts/Warnock Pro/WarnockPro-Semibold.otf
warnockprosemiboldcapt WarnockPro-SemiboldCapt E:/Fonts/Warnock Pro/WarnockPro-SemiboldCapt.otf
warnockprosemibolddisp WarnockPro-SemiboldDisp E:/Fonts/Warnock Pro/WarnockPro-SemiboldDisp.otf
warnockprosemiboldit WarnockPro-SemiboldIt E:/Fonts/Warnock Pro/WarnockPro-SemiboldIt.otf
warnockprosemibolditcapt WarnockPro-SemiboldItCapt E:/Fonts/Warnock Pro/WarnockPro-SemiboldItCapt.otf
warnockprosemibolditdisp WarnockPro-SemiboldItDisp E:/Fonts/Warnock Pro/WarnockPro-SemiboldItDisp.otf
warnockprosemibolditsubh WarnockPro-SemiboldItSubh E:/Fonts/Warnock Pro/WarnockPro-SemiboldItSubh.otf
warnockprosemiboldsubh WarnockPro-SemiboldSubh E:/Fonts/Warnock Pro/WarnockPro-SemiboldSubh.otf
warnockprosmbdcaptiondemi WarnockPro-SemiboldCapt E:/Fonts/Warnock Pro/WarnockPro-SemiboldCapt.otf
warnockprosmbddemi WarnockPro-Semibold E:/Fonts/Warnock Pro/WarnockPro-Semibold.otf
warnockprosmbddisplaydemi WarnockPro-SemiboldDisp E:/Fonts/Warnock Pro/WarnockPro-SemiboldDisp.otf
warnockprosmbdsubheaddemi WarnockPro-SemiboldSubh E:/Fonts/Warnock Pro/WarnockPro-SemiboldSubh.otf
warnockprosubh WarnockPro-Subh E:/Fonts/Warnock Pro/WarnockPro-Subh.otf
warnockprosubheadbold WarnockPro-BoldSubh E:/Fonts/Warnock Pro/WarnockPro-BoldSubh.otf
warnockprosubheadbook WarnockPro-Subh E:/Fonts/Warnock Pro/WarnockPro-Subh.otf

Navigation menu