https://wiki.contextgarden.net/api.php?action=feedcontributions&user=84.144.167.246&feedformat=atomWiki - User contributions [en]2024-03-29T07:21:34ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11914Simple Typescript Example2010-08-21T18:41:57Z<p>84.144.167.246: /* Small extension */</p>
<hr />
<div>[[Category:Fonts]]<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
To show how to call a typescript directly we extend the script a litte:<br />
<br />
<texcode><br />
...<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\starttypescript [nimbus]<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
\stoptypescript<br />
<br />
\usetypescript[nimbus]<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
...<br />
</texcode><br />
<br />
Annotations:<br />
* A third typescript is defined named ''[nimbus]''<br />
* usetypescript calls the ''typescript [nimbus]'' in which the ''typeface [nimbus]'' is defined<br />
* ''typeface [nimbus]'' and ''typescript [nimbus]'' are two totally different things<br />
* if the ''typescript [nimbus]'' would not be called via usetypescript then the ''typeface [nimbus]'' would not be defined<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11913Simple Typescript Example2010-08-21T16:50:30Z<p>84.144.167.246: </p>
<hr />
<div>[[Category:Fonts]]<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
To show how to call a typescript directly we extend the script a litte:<br />
<br />
<texcode><br />
...<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\starttypescript [nimbus]<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
\stoptypescript<br />
<br />
\usetypescript[nimbus]<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
...<br />
</texcode><br />
<br />
Annotations:<br />
* A thrid typescript is defined named ''[nimbus]''<br />
* usetypescript calls the ''typescript [nimbus]'' in which the ''typeface [nimbus]'' is defined<br />
* ''typeface [nimbus]'' and ''typescript [nimbus]'' are two totally different things<br />
* if the ''typescript [nimbus]'' would not be called via usetypescript then the ''typeface [nimbus]'' would not be defined<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11912Simple Typescript Example2010-08-21T16:47:52Z<p>84.144.167.246: /* Small extension */</p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
To show how to call a typescript directly we extend the script a litte:<br />
<br />
<texcode><br />
...<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\starttypescript [nimbus]<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
\stoptypescript<br />
<br />
\usetypescript[nimbus]<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
...<br />
</texcode><br />
<br />
Annotations:<br />
* A thrid typescript is defined named ''[nimbus]''<br />
* usetypescript calls the ''typescript [nimbus]'' in which the ''typeface [nimbus]'' is defined<br />
* ''typeface [nimbus]'' and ''typescript [nimbus]'' are two totally different things<br />
* if the ''typescript [nimbus]'' would not be called via usetypescript then the ''typeface [nimbus]'' would not be defined<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11911Simple Typescript Example2010-08-21T16:46:41Z<p>84.144.167.246: /* Small extension */</p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
We extend the script a litte:<br />
<br />
<texcode><br />
...<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\starttypescript [nimbus]<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
\stoptypescript<br />
<br />
\usetypescript[nimbus]<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
...<br />
</texcode><br />
<br />
Annotations:<br />
* A thrid typescript is defined named ''[nimbus]''<br />
* usetypescript calls the ''typescript [nimbus]'' in which the ''typeface [nimbus]'' is defined<br />
* ''typeface [nimbus]'' and ''typescript [nimbus]'' are two totally different things<br />
* if the ''typescript [nimbus]'' would not be called via usetypescript then the ''typeface [nimbus]'' would not be defined<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11910Simple Typescript Example2010-08-21T16:45:14Z<p>84.144.167.246: /* Small extension */</p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
We extend the script a litte:<br />
<br />
<texcode><br />
...<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\starttypescript [nimbus]<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
\stoptypescript<br />
<br />
\usetypescript[nimbus]<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
...<br />
</texcode><br />
<br />
Annotations:<br />
* A thrid typescript is defined named ''[nimbus]''<br />
* usetypescript calls the ''typescript [[nimbus]]'' in which the ''typeface [nimbus]'' is defined<br />
* ''typeface [nimbus]'' and ''typescript [nimbus]]'' are two totally different things<br />
* In this example: if the ''typescript [nimbus]'' is not called via usetypescript then the ''typeface [nimbus]'' is not defined<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11909Simple Typescript Example2010-08-21T16:36:30Z<p>84.144.167.246: /* Requirements */</p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11908Simple Typescript Example2010-08-21T16:35:53Z<p>84.144.167.246: /* References */</p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11907Simple Typescript Example2010-08-21T16:34:28Z<p>84.144.167.246: </p>
<hr />
<div>[[Category:Fonts]]<br />
<br />
(not finished now)<br />
<br />
==Task==<br />
<br />
To map Nimbus Sans on rm-fonts and Nimbus Serif on ss-fonts.<br />
<br />
==Requirements==<br />
<br />
The Nimbus Sans and Nimbus Serif fonts are installed at your System and also recognized by ConTeXt. If <br />
<br />
mtxrun --script fonts --list --all --pattern=nimbus*<br />
<br />
does not shows you minimum:<br />
<br />
nimbusromno9lmedi nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmedibold nimbusromno9lmedi utmb8a.afm<br />
nimbusromno9lmediital nimbusromno9lmediital utmbi8a.afm<br />
nimbusromno9lregu nimbusromno9lregu utmr8a.afm<br />
nimbusromno9lreguital nimbusromno9lreguital utmri8a.afm<br />
nimbusromno9lregunormal nimbusromno9lregu utmr8a.afm<br />
nimbussanlbold nimbussanlbold uhvb8a.afm<br />
nimbussanlboldital nimbussanlboldital uhvbo8a.afm<br />
nimbussanlregu nimbussanlregu uhvr8a.afm<br />
nimbussanlreguital nimbussanlreguital uhvro8a.afm<br />
nimbussanlregunormal nimbussanlregu uhvr8a.afm<br />
<br />
<br />
please visit the instruction [[Fonts_in_LuaTeX#Building_the_font_database|how to install fonts to MkIV]].<br />
<br />
You do not have to use this Nimbus fonts. For this example you can use any Unicode font you like. If you use different fonts do not forget to exchange the font names in the example script below.<br />
<br />
==Script==<br />
<br />
<texcode><br />
\enableregime[utf]<br />
\setupencoding[default=uc]<br />
<br />
\setupcapitals[sc=yes]<br />
<br />
\starttypescript [serif] [nimbus] <br />
\definefontsynonym [Serif] [name:nimbussanlregu]<br />
\definefontsynonym [SerifBold] [name:nimbussanlbold]<br />
\definefontsynonym [SerifItalic] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifSlanted] [name:nimbussanlreguital]<br />
\definefontsynonym [SerifBoldItalic] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifBoldSlanted] [name:nimbussanlboldital]<br />
\definefontsynonym [SerifCaps] [name:nimbussanlregu]<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [nimbus] <br />
\definefontsynonym [Sans] [name:nimbusromno9lregu]<br />
\definefontsynonym [SansBold] [name:nimbusromno9lbold]<br />
\definefontsynonym [SansItalic] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansSlanted] [name:nimbusromno9lreguital]<br />
\definefontsynonym [SansBoldItalic] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansBoldSlanted] [name:nimbusromno9lboldital]<br />
\definefontsynonym [SansCaps] [name:nimbusromno9lregu]<br />
\stoptypescript<br />
<br />
\definetypeface [nimbus] [rm] [serif] [nimbus]<br />
\definetypeface [nimbus] [ss] [sans] [nimbus]<br />
<br />
\setupbodyfont[nimbus,rm,10pt]<br />
<br />
\starttext<br />
<br />
Regular<br />
<br />
{\it Italic}<br />
<br />
{\bf Bold}<br />
<br />
{\bi Bold-Italic}<br />
<br />
{\sc KaPiTaLe}<br />
<br />
\showbodyfont<br />
<br />
\stoptext<br />
</texcode><br />
<br />
Annotations:<br />
* The first two lines say: <br />
** We only enter unicode <br />
** We only use unicode fonts<br />
* Thirds line (setupcapitals) say ConTeXt to use the Capital Letters defined in the fonts<br />
* Two scripts are defined:<br />
*# the scripts named ''[serif][nimbus]'' and<br />
*# the script named ''[sans][nimbus]''<br />
* Both scripts map the fonts names to the different (existing) font style.<br />
* Both definetypeface-lines define the typeface ''nimbus''. The first defines the rm-fonts and the second the ss-fonts. <br />
* setupbodyfont says to ConTeXt witch typeface to use with which parameters.<br />
<br />
The chain starts with setupbodyfont: it calls the ''typeface nimbus''. Then the ''typeface nimbus''<br />
# calls the ''typescript [serif][nimbus]'' for the rm-fonts<br />
# calls the ''typescript [sans][nimbus]'' for the ss-fonts.<br />
And inside these scripts the fonts are mapped to the different font styles.<br />
<br />
==Small extension==<br />
<br />
<br />
<br />
==References==<br />
<br />
* [[Reference/en/setupbodyfont|setupbodyfont]]<br />
* [[Reference/en/showbodyfont|showbodyfont]<br />
* definetypeface (not found in the references)<br />
* starttypescript / stoptypescript (not found in the references)<br />
* definefontsynonym (not found in the references)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Simple_Typescript_Example&diff=11906Simple Typescript Example2010-08-21T15:54:21Z<p>84.144.167.246: New page: (in progress)</p>
<hr />
<div>(in progress)</div>84.144.167.246https://wiki.contextgarden.net/index.php?title=Fonts_in_LuaTeX&diff=11905Fonts in LuaTeX2010-08-21T15:53:25Z<p>84.144.167.246: /* Loading typescripts */</p>
<hr />
<div>{{note|This page is not finished yet}}<br />
<br />
'''Please, someone, fill this page !'''<br />
<br />
'''This page is beeing regorganized'''<br />
<br />
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 [[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.<br />
<br />
= How LuaTeX handles system fonts =<br />
<br />
LuaTeX can use fonts in non-TeX format (e.g. 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 removes the need for tfm and vf files on your disk, but it is also a somewhat lengthy and often memory-hungry process. Fortunately, the result of that internal preprocessing are also saved inside the texmf cache. 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 instead.<br />
<br />
Mac OS users should note that the current version of LuaTeX (0.60) has severe problems dealing with the new TrueType collection fonts in Snow Leopard (Mac OS 10.6). The older Mac OS .dfont format works fine nowadays.<br />
<br />
== Building the font database ==<br />
<br />
You need to specify where the fonts should be looked for, by setting the <code>OSFONTDIR</code> environment variable. On Windows, this might be achieved by running<br />
set OSFONTDIR=c:/windows/fonts/<br />
if the fonts should be found in <code>c:/windows/fonts/</code>. For Unix machines,<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
indicate that the fonts should be found in both <code>/usr/local/share/fonts</code> and <code>$HOME/.fonts</code>.<br />
<br />
The font database will then be automatically generated in the next run of <code>context</code>. You can also generate it manually by typing <br />
mtxrun --script fonts --reload<br />
<br />
The output should look like<br />
MTXrun | fontnames: identifying tree font files with suffix otf<br />
MTXrun | fontnames: identifying tree font files with suffix OTF<br />
MTXrun | fontnames: 331 tree files identified, 332 hash entries added, runtime 7.653 seconds<br />
MTXrun | fontnames: identifying tree font files with suffix ttf<br />
MTXrun | fontnames: identifying tree font files with suffix TTF<br />
MTXrun | fontnames: 17 tree files identified, 14 hash entries added, runtime 4.645 seconds<br />
...<br />
MTXrun | fontnames: 94 system files identified, 94 hash entries added, runtime 0.554 seconds<br />
MTXrun | fontnames: 3837 files read, 3342 normal and 49 extra entries added, 5 rejected, 3386 valid<br />
<br />
If mtxrun has problem finding the mtx-fonts.lua file, it may be necessary to regenerate ConTeXt's file database:<br />
context --generate<br />
<br />
== Querying the font database ==<br />
<br />
The command<br />
mtxrun --script fonts --list --all --pattern=*<br />
will return the whole entries of the font database as a list, such as<br />
<br />
...<br />
warnockprobold WarnockPro-Bold E:/Fonts/Warnock Pro/WarnockPro-Bold.otf<br />
warnockproboldcapt WarnockPro-BoldCapt E:/Fonts/Warnock Pro/WarnockPro-BoldCapt.otf<br />
warnockprobolddisp WarnockPro-BoldDisp E:/Fonts/Warnock Pro/WarnockPro-BoldDisp.otf<br />
warnockproboldit WarnockPro-BoldIt E:/Fonts/Warnock Pro/WarnockPro-BoldIt.otf<br />
warnockprobolditcapt WarnockPro-BoldItCapt E:/Fonts/Warnock Pro/WarnockPro-BoldItCapt.otf<br />
warnockprobolditdisp WarnockPro-BoldItDisp E:/Fonts/Warnock Pro/WarnockPro-BoldItDisp.otf<br />
warnockprobolditsubh WarnockPro-BoldItSubh E:/Fonts/Warnock Pro/WarnockPro-BoldItSubh.otf<br />
warnockproboldsubh WarnockPro-BoldSubh E:/Fonts/Warnock Pro/WarnockPro-BoldSubh.otf<br />
...<br />
<br />
You can query the database against a particular pattern. For instance,<br />
mtxrun --script fonts --list --all --pattern=Delicious*<br />
will return<br />
deliciousbold Delicious-Bold /usr/local/share/fonts/d/delicious_bold.otf<br />
deliciousbolditalic Delicious-BoldItalic /usr/local/share/fonts/d/delicious_bolditalic.otf<br />
deliciousheavy Delicious-Heavy /usr/local/share/fonts/d/delicious_heavy.otf<br />
deliciousitalic Delicious-Italic /usr/local/share/fonts/d/delicious_italic.otf<br />
deliciousroman Delicious-Roman /usr/local/share/fonts/d/delicious_roman.otf<br />
delicioussmallcaps Delicious-SmallCaps /usr/local/share/fonts/d/delicious_smallcaps.otf<br />
<br />
You can get useful informations about your fonts by using the <code>--info</code> option. For instance,<br />
mtxrun --script fonts --list --info --pattern=Delicious*Roman<br />
will return<br />
MTXrun | fontname: deliciousroman<br />
MTXrun | fullname: Delicious-Roman<br />
MTXrun | filename: /usr/local/share/fonts/d/delicious_roman.otf<br />
MTXrun |<br />
MTXrun | gpos features:<br />
MTXrun |<br />
MTXrun | feature script languages<br />
MTXrun |<br />
MTXrun | kern latn dflt<br />
MTXrun |<br />
MTXrun | gsub features:<br />
MTXrun |<br />
MTXrun | feature script languages<br />
MTXrun |<br />
MTXrun | tlig all all<br />
MTXrun | trep all all<br />
<br />
== Installing new fonts ==<br />
<br />
After installing new fonts, the font database must be rebuilt for LuaTeX to access them.<br />
<br />
In current versions of Mark IV (earlier than July 2008) this is automatically done whenever a named font cannot be found.<br />
<br />
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. <br />
This normally only happens for fonts that are still in development like [[TeX Gyre]] and [[Latin Modern]].<br />
<br />
You can rebuild the database manually, using the already-mentioned command<br />
mtxrun --script fonts --reload<br />
<br />
Alternatively, you can turn off the automatic rebuild of the database, by setting either of<br />
MTX.FONTS.AUTOLOAD<br />
MTX_FONTS_AUTOLOAD<br />
to "no".<br />
<br />
== References ==<br />
<br />
[http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf The new manual chapter on fonts]<br />
<br />
= Using fonts =<br />
<br />
Handling fonts in LuaTeX can be done<br />
* in a simple but limited way, using the <code>simplefonts</code> module;<br />
* in the standard way, using [[TypeScripts]]<br />
<br />
== With the <code>simplefonts</code> module ==<br />
<br />
[http://www.ctan.org/tex-archive/macros/context/contrib/context-simplefonts simplefonts] is a third-party module written by Wolfgang Schuster.<br />
<br />
It simplifies the use of fonts in LuaTeX by<br />
* freeing the user from writing or using [[TypeScripts]];<br />
* offering an interface similar to the [http://www.ctan.org/tex-archive/macros/xetex/latex/fontspec/ fontspec package for XeTeX]<br />
<br />
For instance, assuming the [http://www.josbuivenga.demon.nl/delicious.html Delicious fonts] are properly installed and recognized by ConTeXt, you can simply write:<br />
<br />
<texcode><br />
\usemodule[simplefonts] % load the module<br />
\setmainfont[Delicious] % set Delicious as main (serif) font<br />
<br />
\starttext<br />
\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps<br />
\stoptext<br />
</texcode><br />
<br />
=== Installing <code>simplefonts</code> ===<br />
<br />
* If you're using LuaTeX along with TeXlive 2009, <code>simplefonts</code> is already installed<br />
* If you're running [[ConTeXt Minimals]], <code>simplefonts</code> can be installed like [http://wiki.contextgarden.net/ConTeXt_Minimals#Installing_third_party_modules any third-party module]:<br />
first-setup.sh --extras="t-simplefonts"<br />
<br />
== The standard way: Typescripts ==<br />
<br />
=== Installing typescripts ===<br />
<br />
Installing typescripts consists in the following:<br />
<br />
1. Copy the typescript files into either <br />
<texcode>$TEXMF/tex/texmf-fonts/tex/context/user<br />
$TEXMF/tex/texmf-project/tex/context/user</texcode><br />
2. Run <code>context --generate</code><br />
<br />
By convention, typescript files are named like <code>type-(fontname|foundry).tex</code>. <br />
<br />
It may happen that some <code>type-xx.tex</code> typescript file depends on mkiv-specific code located in a matching <code>type-xx.mkiv</code> file. In this case, both files need to be installed.<br />
<br />
=== Loading typescripts ===<br />
<br />
A typescript file named <code>type-xx.tex</code> should be loaded using<br />
\usetypescriptfile[type-xx]<br />
<br />
An alternative way is<br />
\usetypefile[xx]<br />
where ConTeXt prepends <code>type-</code> when it loads the file; but <br />
<cmd>usetypescriptfile</cmd> is the preferred command because it takes care of the<br />
<cmd>starttypescriptcollection</cmd>/<cmd>stoptypescriptcollection</cmd> environments.<br />
<br />
=== Very simple example of typescript ===<br />
<br />
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.<br />
<br />
=== Where to find existing typescripts ===<br />
<br />
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>)<br />
<br />
* Latin Modern (typescript name: <code>modern</code>; this is the default font set)<br />
* Latin Modern variant (ts name: <code>modernvariable</code>; LM variable typewriter for serif)<br />
* Postscript (ts name: <code>postscript</code>; Termes for serif, Heros for sans, Cursor for mono)<br />
* Antykwa Toruńska (ts name: <code>antykwa-torunska</code>; only serif; defines <tt>antykwa</tt> as keyword for <cmd>setupbodyfont</cmd>)<br />
* Iwona (ts name: <code>iwona</code>; only sans serif)<br />
* 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)<br />
* Pagella (ts name: <code>palatino</code>; only serif)<br />
* Termes (ts name: <code>times</code>; only serif, Heros for sans)<br />
<br />
=== Usage example ===<br />
<br />
<texcode><br />
\usetypescript[palatino]<br />
\setupbodyfont[palatino,18pt]<br />
<br />
\starttext<br />
Hello world, I'm Pagella!<br />
\stoptext<br />
</texcode><br />
<br />
The first line seems to order ConTeXt to "install" (for the current file) the given typescript (it accepts what I have earlier called a "typescript name"). The last one starts using it (you may omit the size if you are satisfied with the default).<br />
<br />
=== Combining predefined fonts in your own typescripts ===<br />
<br />
It is also possible to combine fonts from the TeX Gyre collection in your own typescripts. The example below combines Bonum (Bookman) roman, Adventor (AvantGarde) for sans serif, Cursor (Courier) for teletype, and Euler for math. The <code>rscale=...</code> option ensures that all fonts have the same x-height. (You can lookup the relative x-heigt of a font using fontforge.)<br />
<br />
<texcode><br />
\starttypescript [Bonum]<br />
\definetypeface [Bonum] [rm] [serif] [bonum] [default]<br />
\definetypeface [Bonum] [ss] [sans] [adventor] [default] [rscale=0.887]<br />
\definetypeface [Bonum] [tt] [mono] [cursor] [default] [rscale=1.163]<br />
\definetypeface [Bonum] [mm] [math] [euler] [default] [rscale=1.050]<br />
\stoptypescript<br />
<br />
\usetypescript[Bonum]<br />
\setupbodyfont[Bonum,12pt]<br />
<br />
\starttext<br />
Hello world, I'm Bonum!<br />
\stoptext<br />
</texcode><br />
<br />
= Old contents =<br />
<br />
* [[TrueType fonts in luaTeX]]<br />
<br />
==== Good ol' typescripts ====<br />
<br />
Of course, Mark IV allows you to use typescripts as you've always done; for example:<br />
<br />
<texcode><br />
\usetypescript[palatino]<br />
\setupbodyfont[palatino,12pt]<br />
effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek<br />
<br />
\sc effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek<br />
</texcode><br />
<br />
That's as simple as using a traditional ConTeXt typescript!<br />
<br />
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]] equivalent (“Pagella”) is called and we can use its Opentype “features”; read on.<br />
<br />
==== Opentype features ====<br />
<br />
A “feature”, in the Opentype jargon, is a set of rules describing changes in the appearance of the text. Hmm, that's not very precise. Let's show some examples. First of all, you have to know that features are referred to by 4-letter tags, and you will see this a lot. One of them is ‘smcp‘, for “small caps“. Let's consider the following Mark IV-only code:<br />
<br />
<texcode><br />
\definefontfeature[smallcaps][language=DFLT,script=latn,smcp=yes]<br />
\font\palasmallcaps=texgyrepagella-regular*smallcaps<br />
\palasmallcaps This is a text in small capitals.<br />
</texcode><br />
<br />
Here you basically define a (Mark IV) feature with the name ”smallcaps”, and associate it with the (Opentype) feature “smcp”. You have to specify which script you want to use it with; scripts in Opentype are also tagged with four letters, and “latn” is of course Latin.<br />
<br />
Then you define a TeX font with that feature.<br />
<br />
You can see what features are defined in a particular font with the following bit of code<br />
<br />
<texcode><br />
\ctxlua<br />
{<br />
fontname = 'texgyrepagella-regular.otf'<br />
<br />
--[[ First read the font data.<br />
This makes heavy use of some of the Mark IV code]]<br />
tfmdata = fonts.tfm.read_and_define("file:" .. fontname, 655360)<br />
font = tfmdata.shared.otfdata<br />
if font<br />
then<br />
gsubfeatures = fonts.otf.analyze_features(font.gsub)<br />
gposfeatures = fonts.otf.analyze_features(font.gpos)<br />
end<br />
<br />
if gsubfeatures then<br />
table.sort(gsubfeatures) % We want our list sorted alphabetically!<br />
tex.sprint("\\rm GSUB features: \\tt ") % Beware: you don't want \rm to be interpreted by lua (\rm would yield carriage return + letter m)!<br />
for _, feat in ipairs(gsubfeatures)<br />
do tex.sprint(feat) tex.sprint(' ')<br />
end<br />
else tex.sprint("\\rm No GSUB features")<br />
end<br />
tex.sprint("\\par")<br />
<br />
if gposfeatures then<br />
tex.sprint("\\rm GPOS features: \\tt ")<br />
table.sort(gposfeatures)<br />
for _, feat in ipairs(gposfeatures)<br />
do tex.sprint(feat) tex.sprint(' ')<br />
end<br />
else tex.sprint("\\rm No GPOS features")<br />
end<br />
}<br />
</texcode><br />
<br />
It prints the list on the page. You'll notice there are two sets of features, each one of them defined in a different table of the Opentype font: the <code>GSUB</code> table (for Glyph SUBstitution) gives rules for replacing glyphs in certains circumstances (think of ligatures: f + i -> fi); the <code>GPOS</code> table (Glyph POSititioning) gives rules for moving glyphs (think of kerning: A + V -> A <kerning> V).<br />
<br />
Incidentally, the above code gives some basic examples of LuaTeX programming, a mixture of both Lua and TeX programming with some special features (features in the general sense, not the Opentype one :-).<br />
<br />
==== A (Complete) Typescript Example ====<br />
<br />
<texcode><br />
\starttypescript [sans] [franklin]<br />
<br />
\definefontsynonym [FranklinBookRegular] [name:FranklinGothicBookITC-Regular] [features=default]<br />
\definefontsynonym [FranklinMediumRegular] [name:FranklinGothicMediumITC-Regular] [features=default]<br />
\definefontsynonym [FranklinDemiRegular] [name:FranklinGothicDemiITC-Regular] [features=default]<br />
\definefontsynonym [FranklinHeavyRegular] [name:FranklinGothicHeavyITC-Regular] [features=default]<br />
<br />
\definefontsynonym [FranklinBookItalic] [name:FranklinGothicBookITC-Italic] [features=default]<br />
\definefontsynonym [FranklinDemiItalic] [name:FranklinGothicMediumITC-Italic] [features=default]<br />
\definefontsynonym [FranklinHeavyItalic] [name:FranklinGothicDemiITC-Italic] [features=default]<br />
\definefontsynonym [FranklinMediumItalic] [name:FranklinGothicHeavyITC-Italic] [features=default]<br />
<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [franklin]<br />
<br />
\definefontsynonym [Sans] [FranklinBookRegular] [features=default]<br />
\definefontsynonym [SansItalic] [FranklinBookItalic] [features=default]<br />
\definefontsynonym [SansBold] [FranklinDemiRegular] [features=default]<br />
\definefontsynonym [SansBoldItalic] [FranklinDemiItalic] [features=default]<br />
\definefontsynonym [SansSlanted] [SansItalic] [features=default]<br />
\definefontsynonym [SansBoldSlanted] [SansBoldItalic] [features=default]<br />
\definefontsynonym [SansCaps] [Sans] [features=smallcaps]<br />
<br />
\stoptypescript<br />
<br />
\definetypeface[franklin][rm][sans][franklin][default]<br />
\definetypeface[franklin][ss][sans][franklin][default]<br />
\definetypeface[franklin][tt][mono][modern] [default][rscale=1.12]<br />
\definetypeface[franklin][mm][math][iwona] [default][rscale=1.02]<br />
<br />
\setupbodyfont[franklin,ss,10pt]<br />
</texcode><br />
<br />
<br />
<br />
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.<br />
<br />
I’m stick here :<br />
<br />
\definefontfeature [myfontfeature] [method=node, kern=yes, OTHER_FEATURE_COMMA_SEPERATED]<br />
\definefontsynonym [MyFontRegular] [name:TheFontName-Regular][features=myfontfeature]<br />
\definedfont [MyFontRegular at 16pt]<br />
<br />
This doesn’t run for my title which use « \tfc », only for the body of the text.<br />
<br />
*\definefontfeature<br />
**[myfontfeature] : you can use the name you want. It will be use at the next line ;<br />
**the fonts feature can be found with <tt>otfinfo -f TheFontFile.otf</tt>.<br />
*\definefontsynonym :<br />
**[MyFontRegular] : you can use the name you want. It will be use at the next line ;<br />
**The name after <tt>name:</tt> is the name given by <tt>mtxrun --script font --list</tt><br />
**The « name: » part can be replaced by <tt>file:TheFontFile.otf</tt><br />
<br />
<br />
== Example ==<br />
<br />
<br />
Now to access, say the regular warnock font, the following are valid. And I ought to mention that Hans recommends the first http://article.gmane.org/gmane.comp.tex.context/43685.<br />
<br />
<texcode><br />
% Hans recommends this format;<br />
\definefontsynonym [WarnockPro-Regular] [name:warnockproregular] <br />
</texcode><br />
<br />
and<br />
<br />
<texcode><br />
\definefontsynonym [WarnockPro-Regular] [name:WarnockPro-Regular]<br />
</texcode><br />
<br />
An entire typescript would be defined as;<br />
<br />
<texcode><br />
\definefontfeature[latin-smallcaps][smallcaps][script=latn]<br />
<br />
\starttypescript [serif] [warnockpro]<br />
\setups[font:fallback:sans]<br />
\definefontsynonym [WarnockPro-Regular] [name:WarnockPro-Regular] <br />
\definefontsynonym [WarnockPro-Bold] [name:WarnockPro-Bold] <br />
\definefontsynonym [WarnockPro-Italic] [name:WarnockPro-It] <br />
\definefontsynonym [WarnockPro-BoldItalic] [name:WarnockPro-BoldIt] <br />
\stoptypescript<br />
<br />
\starttypescript [serif] [warnockpro]<br />
\definefontsynonym [Serif] [WarnockPro-Regular] [features=default]<br />
\definefontsynonym [SerifBold] [WarnockPro-Bold] [features=default]<br />
\definefontsynonym [SerifItalic] [WarnockPro-Italic] [features=default]<br />
\definefontsynonym [SerifBoldItalic] [WarnockPro-BoldItalic] [features=default]<br />
\definefontsynonym [SerifCaps] [Serif] [features=latin-smallcaps]<br />
\stoptypescript<br />
<br />
\definetypeface[adobe][rm][serif][warnockpro][default]<br />
\setupbodyfont[adobe,11pt]<br />
<br />
</texcode><br />
<br />
= References =<br />
<references/><br />
<br />
[[Category:Fonts]]<br />
[[Category:International]]</div>84.144.167.246