Changes

Jump to navigation Jump to search
m
Reverted edits by 62.80.184.178 (Talk) to last version by Khaled
< [[XeTeX]] | [[Fonts]] >
Fonts get special treatment in [[XeTeX]]. By supporting a rich, within-TeX means of font specification, one avoids the usual difficulties associated with the TeX font mess: no dealing with map files, encodings, Karl Berry naming schemes, tfms, or virtual fonts. This page describes the various typescripts introduced with [[source:type-otf.tex|type-otf.tex]] (shared with LuaTeX, up-to-date) and [[source:type-xtx.tex|type-xtx.tex]] (XeTeX specific - might need a revision). <font color="red">Note that typescripts were slightly broken after version 2007.01.xx and before 2007.09.28. Please update.Also, on Mac, old fonts that store their code in the resource fork (Postscript Type 1, Postscript Type 3) don't seem to work with xdvipdfmx. Using xdv2pdf instead of xdvipdfmx is possible with some tweaking.</font> <b>NB:<tt/b>Major changes that need updates both on wiki and in type-xtx: * <code>encoding=uc</ttcode>. Common among all these typescripts is the made obsolete: no font encoding specification is needed any mode since only Unicode font encoding: is supported anyway* <code>features=default</code> will set tex-text option, but note that that file is not present in minimals yet* <ttcode>[name:\typescripttwo\xetexcolon mapping=tex-text][encoding=uc]</ttcode> should be replaced by <code>[name:\typescripttwo][features=default]</code>* some others ...
==Quick start==
If you want to start using some of the fonts installed in your system(e.g. Serapion Pro), start with the following snippet:
<texcode>
''(An image will be put here as soon as XeTeX will be enabled on contextgarden.)''
 
==Using PostScript fonts==
 
Note: It's '''not''' possible to use oldfashioned Mac resource fork fonts (where you have a "suitcase" with screen fonts) with ConTeXt!
 
This example uses PostScript fonts installed in the texmf tree:
 
<texcode>
\starttypescript [sans] [urw-grotesk]
% PostScript name file name instead of an encoding
\definefontsynonym [URWGroteskT-LighNarr] [file:u004242t] [features=default]
\definefontsynonym [URWGroteskT-MediNarr] [file:u004244t] [features=default]
\definefontsynonym [URWGroteskT-LighNarrObli] [file:u004262t] [features=default]
\definefontsynonym [URWGroteskT-MediNarrObli] [file:u004264t] [features=default]
\stoptypescript
 
\starttypescript [sans] [urw-grotesk]
\definefontsynonym [Sans] [URWGroteskT-LighNarr]
\definefontsynonym [SansItalic] [URWGroteskT-LighNarrObli]
\definefontsynonym [SansBold] [URWGroteskT-MediNarr]
\definefontsynonym [SansBoldItalic] [URWGroteskT-MediNarrObli]
\definefontsynonym [SansSlanted] [SansItalic]
\definefontsynonym [SansBoldSlanted] [SansBoldItalic]
\stoptypescript
 
\starttypescript [my] [urw-grotesk]
% \definetypeface [urw-grotesk] [rm] [serif] [schola] [default]
\definetypeface [urw-grotesk] [ss] [sans] [urw-grotesk] [default] [encoding=uc]
\stoptypescript
 
\usetypescript [my][urw-grotesk]
\setupbodyfont [urw-grotesk,ss,8pt]
 
</texcode>
 
If you'd like to use active (OS-installed) fonts, replace "file:filename" with "name:public name" like this:
 
<texcode>
\definefontsynonym [Eco-Regular] [name:Eco101Roman] [features=default]
\definefontsynonym [Eco-Bold] [name:Eco301Bold] [features=default]
\definefontsynonym [Eco-Italic] [name:Eco102Italic] [features=default]
\definefontsynonym [Eco-BoldItalic] [name:Eco302BoldItalic] [features=default]
</texcode>
 
(Sample from [[http://archive.contextgarden.net/message/20080120.125423.babb9aea.en.html this thread]].)
[[Category:Fonts]]

Navigation menu