<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>∃xistential Type &#187; truetype</title>
	<atom:link href="http://existentialtype.net/tag/truetype/feed/" rel="self" type="application/rss+xml" />
	<link>http://existentialtype.net</link>
	<description>For People Who Like Type and Types</description>
	<lastBuildDate>Fri, 29 Oct 2010 15:00:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Fonts in LaTeX, Errata</title>
		<link>http://existentialtype.net/2009/04/04/fonts-in-latex-errata/</link>
		<comments>http://existentialtype.net/2009/04/04/fonts-in-latex-errata/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 17:14:31 +0000</pubDate>
		<dc:creator>washburn</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[errata]]></category>
		<category><![CDATA[opentype]]></category>
		<category><![CDATA[otftotfm]]></category>
		<category><![CDATA[pdflatex]]></category>
		<category><![CDATA[tex]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[ttf2tfm]]></category>

		<guid isPermaLink="false">http://existentialtype.net/?p=280</guid>
		<description><![CDATA[About seven months ago, Vasile Gaburici alerted me to the fact that otftotfm has had experimental support for OpenType fonts TrueType outlines for quite some time. Furthermore, it will use kerning tables that ttf2tfm will ignore.  I am now finally getting around to writing a post to highlight this fact. It seems likely that otftotfm [...]]]></description>
			<content:encoded><![CDATA[<p>About seven months ago, <a href="http://existentialtype.net/2008/07/19/fonts-in-latex-part-three-pdftex-and-truetype/#comment-23826">Vasile Gaburici alerted me</a> to the fact that <code>otftotfm</code> has had experimental support for OpenType fonts TrueType outlines for quite some time.  Furthermore, it will use kerning tables that <code>ttf2tfm</code> will ignore.  I am now finally getting around to writing a post to highlight this fact.</p>
<p>It seems likely that <code>otftotfm</code> may also work on pre-OpenType TrueType fonts because the OpenType font format is essentially the same as the TrueType format with potentially additional tables.  At least, when I did cursory search on my computer I could not find any TrueType fonts that proved to be incompatible with <code>otftotfm</code>.</p>
<p>Therefore, if you want to use a TrueType font with pdfLaTeX you should ignore the instructions I give in <a href="http://existentialtype.net/2008/07/19/fonts-in-latex-part-three-pdftex-and-truetype/">∃xistential Type Fonts in LaTeX, Part Three: pdfTeX and TrueType</a> and use the same instructions as I gave for OpenType fonts in <a href="http://existentialtype.net/2008/07/12/fonts-in-latex-part-two-pdftex-and-opentype/">Fonts in LaTeX, Part Two: pdfTeX and OpenType</a>.  For your convenience, I have also created an updated the <a href="http://existentialtype.net/wp-content/uploads/2009/04/fonts-tutorial.zip">zip file</a> for the example that uses <code>otftotfm</code> instead of <code>ttf2tfm</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://existentialtype.net/2009/04/04/fonts-in-latex-errata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonts in LaTeX, Part Three: pdfTeX and TrueType</title>
		<link>http://existentialtype.net/2008/07/19/fonts-in-latex-part-three-pdftex-and-truetype/</link>
		<comments>http://existentialtype.net/2008/07/19/fonts-in-latex-part-three-pdftex-and-truetype/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 16:13:22 +0000</pubDate>
		<dc:creator>washburn</dc:creator>
				<category><![CDATA[typography]]></category>
		<category><![CDATA[deja vu sans]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[pdflatex]]></category>
		<category><![CDATA[pdftex]]></category>
		<category><![CDATA[tex]]></category>
		<category><![CDATA[tex gyre pagella]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[ttf2tfm]]></category>

		<guid isPermaLink="false">http://existentialtype.net/?p=259</guid>
		<description><![CDATA[Update: The information in this post is out of date: otftotfm does presently have support for TrueType outlines. See my errata post for more information. In the previous part of this tutorial, I explained how to put together the minimal infrastructure needed to use an OpenType font with pdfLaTeX.  However, I used the tool otftotfm [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: The information in this post is out of date: <code>otftotfm</code> does presently have support for TrueType outlines.  See my <a href="http://existentialtype.net/2009/04/04/fonts-in-latex-errata/">errata post</a> for more information.</p>
<p>In the <a href="http://existentialtype.net/2008/07/12/fonts-in-latex-part-two-pdftex-and-opentype/">previous part of this tutorial</a>, I explained how to put together the minimal infrastructure needed to use an <a href="http://en.wikipedia.org/wiki/OpenType">OpenType</a> font with pdfLaTeX.  However, I used the tool <code>otftotfm</code> to generate the font metrics TeX needs to lay out text. However, <code>otftotfm</code> only supports OpenType fonts that use PostScript font outlines, as opposed to <a href="http://en.wikipedia.org/wiki/TrueType">TrueType</a> font outlines. So in this part of the tutorial I will explain how to put together the necessary infrastructure for TrueType fonts. In preparation for that, we will first make a few changes to what we had done earlier.</p>
<p>For those that would find it useful, I've put together a  <a href="http://existentialtype.net/wp-content/uploads/2008/07/fonts-tutorial.zip">zip file</a> containing all the files from the tutorials (except the fonts, which I don't want to deal with distributing).</p>
<p>Firstly, we are going to move the uses of <code>\DeclareUnicodeCharacter</code> out of <code>UPagella.fd</code> and into <code>uenc.def</code>:</p>
<pre class="latex">&nbsp;
<span style="color: #800000; font-weight: normal;">\ProvidesFile</span>{<span style="color: #2222D0; font-weight: normal;">uenc.def</span>}
<span style="color: #808080; font-style: italic;">% We are declaring an encoding named &quot;U&quot;</span>
<span style="color: #800000; font-weight: normal;">\DeclareFontEncoding</span>{<span style="color: #2222D0; font-weight: normal;">U}{}{</span>}
&nbsp;
<span style="color: #808080; font-style: italic;">% Technically these are not &quot;allowed&quot; in .def files,</span>
<span style="color: #808080; font-style: italic;">% but this is really the logical place to put the</span>
<span style="color: #808080; font-style: italic;">% declarations.</span>
&nbsp;
<span style="color: #808080; font-style: italic;">% τ (0x03C4) maps to 0xF8 in the encoding</span>
<span style="color: #800000; font-weight: normal;">\DeclareUnicodeCharacter</span>{<span style="color: #2222D0; font-weight: normal;">03C4}{<span style="color: #800000; font-weight: normal;">\char</span>&quot;F8</span>}
<span style="color: #808080; font-style: italic;">% ε (0x03B5) maps to 0xF9 in the encoding</span>
<span style="color: #800000; font-weight: normal;">\DeclareUnicodeCharacter</span>{<span style="color: #2222D0; font-weight: normal;">03B5}{<span style="color: #800000; font-weight: normal;">\char</span>&quot;F9</span>}
<span style="color: #808080; font-style: italic;">% χ (0x03C7) maps to 0xFA in the encoding</span>
<span style="color: #800000; font-weight: normal;">\DeclareUnicodeCharacter</span>{<span style="color: #2222D0; font-weight: normal;">03C7}{<span style="color: #800000; font-weight: normal;">\char</span>&quot;FA</span>}</pre>
<p>As I mention in the comments, the documentation on font encoding definition files does not list <code>\DeclareUnicodeCharacter</code> to be one of the allowed declarations in a such a file, but it works, and it seems like the more logical place to configure it than in the font definition file.</p>
<p>Now that we have removed the uses of <code>\DeclareUnicodeCharacter</code> from <code>UPagella.fd</code>, it looks like:</p>
<pre class="latex">&nbsp;
<span style="color: #800000; font-weight: normal;">\ProvidesFile</span>{<span style="color: #2222D0; font-weight: normal;">UPagella.fd</span>}
&nbsp;
<span style="color: #808080; font-style: italic;">% Delcaring a font family called &quot;Pagella&quot; for the encoding &quot;U&quot;</span>
<span style="color: #800000; font-weight: normal;">\DeclareFontFamily</span>{<span style="color: #2222D0; font-weight: normal;">U}{Pagella}{</span>}
&nbsp;
<span style="color: #808080; font-style: italic;">% Declare that font family &quot;Pagella&quot;, for encoding &quot;U&quot;, has a shape</span>
<span style="color: #808080; font-style: italic;">% with weight medium (m) and normal (n) slant (in otherwords, upright)</span>
<span style="color: #800000; font-weight: normal;">\DeclareFontShape</span>{<span style="color: #2222D0; font-weight: normal;">U}{Pagella}{m}{n</span>}{
  <span style="color: #808080; font-style: italic;">% For all sizes...</span>
  &amp;lt;-&amp;gt;
  <span style="color: #808080; font-style: italic;">% ... use the font named</span>
  TeXGyrePagella-Regular--custom--base
}{}</pre>
<p>I am going to use <a href="http://dejavu.sourceforge.net/wiki/index.php/Download">Deja Vu Sans</a> as the example TrueType font.  Fortunately, if you followed everything from the second part of the tutorial, there is not much that needs to be done.</p>
<p>First, we need to generate metrics for Deja Vu Sans.  As before, if you are using <a href="http://www.tug.org/texlive/">TeX Live</a>, you'll have the necessary program:</p>
<pre>
% ttf2tfm DejaVuSans.ttf -q -T custom
ttf2tfm: WARNING: Cannot find character `compwordmark'
         specified in input encoding.
...
...
ttf2tfm: WARNING: Cannot find character `zdotaccent'
         specified in input encoding.
DejaVuSans   DejaVuSans.ttf Encoding=custom.enc</pre>
<p>The program <code>ttf2tfm</code> is kind of unusual in that it first takes the filename argument and then all the options.  So we've passed it the TrueType font we want to generate metrics for, <code>DejaVuSans.ttf</code>, the option <code>-q</code> to tell it not to print quite so much information, and the option <code>-T custom</code> which tells it to use the encoding defined in the file <code>custom.enc</code> we created in previous part.</p>
<p>Unlike <code>otftotfm</code>, <code>ttf2tfm</code> does not generate an entry that we could use in our <code>map</code> file, <code>custom.map</code>, so we need to write one ourselves.  You will want to start with the <code>map</code> we generated by <code>otftotfm</code> for Tex Gyre Pagella, and you will want to add the line:</p>
<pre>DejaVuSans &lt;custom.enc &lt;DejaVuSans.ttf</pre>
<p>This says to map the TeX font name <code>DejaVuSans</code> to the file <code>DejaVuSans.ttf</code> using the encoding <code>custom.enc</code>.  To learn more about the format of <code>map</code> files, there is a section on them in the <a href="http://sarovar.org/docman/view.php/106/66/pdftex-s.pdf">pdfTeX manual</a>.</p>
<p>Now we just need to create a font definition file for Deja Vu Sans.  However, it is essentially the same as the one we created for TeX Gyre Pagella:</p>
<pre class="latex">&nbsp;
<span style="color: #800000; font-weight: normal;">\ProvidesFile</span>{<span style="color: #2222D0; font-weight: normal;">UDejaVuSans.fd</span>}
&nbsp;
<span style="color: #808080; font-style: italic;">% Delcaring a font family called &quot;DejaVuSans&quot; for the encoding &quot;U&quot;</span>
<span style="color: #800000; font-weight: normal;">\DeclareFontFamily</span>{<span style="color: #2222D0; font-weight: normal;">U}{DejaVuSans}{</span>}
&nbsp;
<span style="color: #808080; font-style: italic;">% Declare that font family &quot;DejaVuSans&quot;, for encoding &quot;U&quot;, has a shape</span>
<span style="color: #808080; font-style: italic;">% with weight medium (m) and normal (n) slant (in otherwords, upright)</span>
<span style="color: #800000; font-weight: normal;">\DeclareFontShape</span>{<span style="color: #2222D0; font-weight: normal;">U}{DejaVuSans}{m}{n</span>}{
  <span style="color: #808080; font-style: italic;">% For all sizes...</span>
  &amp;lt;-&amp;gt;
  <span style="color: #808080; font-style: italic;">% ... use the font named</span>
  DejaVuSans
}{}</pre>
<p>We have just replaced all occurrences of <code>Pagella</code> with <code>DejaVuSans</code>.</p>
<p>Finally, we just need to update our example document to use Deja Vu Sans:</p>
<pre class="latex">&nbsp;
<span style="color: #800000; font-weight: normal;">\documentclass</span>{<span style="color: #2222D0; font-weight: normal;">article</span>}
<span style="color: #800000; font-weight: normal;">\usepackage</span>[<span style="color: #2222D0; font-weight: normal;">utf8</span>]{<span style="color: #2222D0; font-weight: normal;">inputenc</span>}
<span style="color: #800000; font-weight: normal;">\usepackage</span>[<span style="color: #2222D0; font-weight: normal;">U</span>]{<span style="color: #2222D0; font-weight: normal;">fontenc</span>}
<span style="color: #800000; font-weight: normal;">\pdfmapfile</span>{<span style="color: #2222D0; font-weight: normal;">+custom.map</span>}
<span style="color: #800000; font-weight: normal;">\renewcommand</span>{<span style="color: #2222D0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\rmdefault</span>}{Pagella</span>}
<span style="color: #800000; font-weight: normal;">\renewcommand</span>{<span style="color: #2222D0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\sfdefault</span>}{DejaVuSans</span>} 
&nbsp;
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\begin</span></span>{<span style="color: #2222D0; font-weight: normal;">document</span>}
Testing pdfLaTeX!
&nbsp;
Greek: τεχ.
&nbsp;
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\begin</span></span>{<span style="color: #2222D0; font-weight: normal;">sffamily</span>}
Testing pdfLaTeX!
&nbsp;
Greek: τεχ.
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\end</span></span>{<span style="color: #2222D0; font-weight: normal;">sffamily</span>}
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\end</span></span>{<span style="color: #2222D0; font-weight: normal;">document</span>}</pre>
<p>Here we have used <code>\renewcommand</code> to set the default sans serif font, <code>\sfdefault</code>, to be <code>DejaVuSans</code>.  In the body of the document, we've copied the text and surrounded it with the <code>sffamily</code> environment to have it typeset in sans serif.</p>
<p>Now we have everything we need to run <code>pdflatex</code>:</p>
<pre>
% pdflatex test-pdflatex.tex
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&amp;-line parsing enabled.
...
...
(./test-pdflatex.aux) (./upagella.fd) (./udejavusans.fd) [1]
(./test-pdflatex.aux) ){custom.enc}{a_qnnnfc.enc}&lt;./TeXGyrePage
lla-Regular.pfb&gt;
Output written on test-pdflatex.pdf (1 page, 34857 bytes).
Transcript written on test-pdflatex.log.</pre>
<p>And we have the desired output:</p>
<div style="text-align: center"><a href="http://existentialtype.net/wp-content/uploads/2008/07/test-pdflatex.png"><img class="aligncenter size-full wp-image-260" title="test-pdflatex" src="http://existentialtype.net/wp-content/uploads/2008/07/test-pdflatex.png" alt="Testing pdfLaTeX with both OpenType and TrueType fonts" width="245" height="140" /></a></div>
<p>And that's everything you need to get started with TrueType fonts and pdfLaTeX.  Again, if you encounter any problems or notice any omissions, let me kow. I'll do some investigation and there will possibly be a fourth part on using <a href="http://www.tug.org/applications/fontinst/">fontinst</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://existentialtype.net/2008/07/19/fonts-in-latex-part-three-pdftex-and-truetype/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fonts in LaTeX, an intermission</title>
		<link>http://existentialtype.net/2008/07/13/fonts-in-latex-an-intermission/</link>
		<comments>http://existentialtype.net/2008/07/13/fonts-in-latex-an-intermission/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 15:58:01 +0000</pubDate>
		<dc:creator>washburn</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[fontinst]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[luatex]]></category>
		<category><![CDATA[opentype]]></category>
		<category><![CDATA[pdftex]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[xetex]]></category>

		<guid isPermaLink="false">http://existentialtype.net/?p=258</guid>
		<description><![CDATA[Part one of my tutorial attracted a considerable number of visitors, far more than any single entry in the past, partly because it was posted to reddit. Looking at the comments on reddit, I figured that I would say that luatex does resolve pdfTeX's internal limitation of 256 glyphs that I mentioned in part two, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://existentialtype.net/2008/07/12/fonts-in-latex-part-one-xelatex/">Part one</a> of my tutorial attracted a considerable number of visitors, far more than any single entry in the past, partly because it was posted to <a href="http://www.reddit.com/r/programming/info/6rg7f/comments/">reddit</a>.</p>
<p>Looking at the comments on reddit, I figured that I would say that <a href="http://www.luatex.org/">luatex</a> does resolve pdfTeX's internal limitation of 256 glyphs that I mentioned in <a href="http://existentialtype.net/2008/07/12/fonts-in-latex-part-two-pdftex-and-opentype/">part two</a>, and it should directly support OpenType fonts with PostScript outlines.</p>
<p>However, my understanding is that the authors of luatex do not intend to make using TrueType and OpenType fonts as simple as XeTeX directly.  Instead, luatex merely makes the machinery available for someone else to build upon.  So someone will need to write a LaTeX package for luatex to put it all together, and as far as I know, no one has done this yet (let me know if I'm wrong!).  Also, while the plan is for luatex to eventually be merged back into pdfTeX, I think it is an overstatement to say that it will happen "soon".  The current luatex roadmap says that a "production" ready version will be available in <a href="http://www.luatex.org/roadmap.html">August 2009</a>.  I doubt that the merge back to pdfTeX will happen any sooner than 2010 given that.  But yes, in the long term I think luatex will be a great thing.</p>
<p>It also sounds like I should probably write a fourth part to my tutorial on using <a href="http://www.tug.org/applications/fontinst/">fontinst</a>.  I've never personally used it myself, and when I first started working with OpenType fonts and LaTeX I wasn't aware of its existence.  Therefore, I wrote <a href="http://free-the-mallocs.com/otftofd">otftofd</a>.  So it might take a bit longer to write as I will have to learn it at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://existentialtype.net/2008/07/13/fonts-in-latex-an-intermission/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fonts in LaTeX, Part One: XeLaTeX</title>
		<link>http://existentialtype.net/2008/07/12/fonts-in-latex-part-one-xelatex/</link>
		<comments>http://existentialtype.net/2008/07/12/fonts-in-latex-part-one-xelatex/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 11:02:58 +0000</pubDate>
		<dc:creator>washburn</dc:creator>
				<category><![CDATA[typography]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[fontspec]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[opentype]]></category>
		<category><![CDATA[pagella]]></category>
		<category><![CDATA[tex]]></category>
		<category><![CDATA[tex gyre]]></category>
		<category><![CDATA[tex live]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[xelatex]]></category>
		<category><![CDATA[xetex]]></category>

		<guid isPermaLink="false">http://existentialtype.net/?p=251</guid>
		<description><![CDATA[Now and then I get asked about how to use some TrueType or OpenType font with LaTeX, so I figured I would take the time to write up some simple tutorials on how to do so. The first part will focus on the easiest route to making use of TrueType and OpenType fonts in LaTeX: [...]]]></description>
			<content:encoded><![CDATA[<p>Now and then I get asked about how to use some <a href="http://en.wikipedia.org/wiki/TrueType">TrueType</a> or <a href="http://en.wikipedia.org/wiki/OpenType">OpenType</a> font with LaTeX, so I figured I would take the time to write up some simple tutorials on how to do so. The first part will focus on the easiest route to making use of TrueType and OpenType fonts in LaTeX: <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=xetex">XeTeX and XeLaTeX</a>.</p>
<p>XeLaTeX also has the advantage of not only giving easy access to modern fonts, but also accepting Unicode input files.</p>
<p>The first thing you need to do is find out if you have XeLaTeX installed, and if it is a sufficiently up to date version.  This is easiest to do from the command-line:<br />
<code><br />
% xelatex<br />
This is XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6)<br />
%&amp;-line parsing enabled.<br />
**^C<br />
</code><br />
This is the version that I am using for the tutorial, and is what comes with <a href="http://www.tug.org/texlive/">TeX Live 2007</a>.  I highly recommend just installing and using the entire TeX Live CD/DVD, even if you're using a Linux system that offers TeX Live packages, because, in particular for <a href="http://www.debian.org/">Debian</a>/<a href="http://www.ubuntu.com/">Ubuntu</a>, I've found that the default installation often doesn't install some important packages, and it can be a pain sort through all the available packages using Synaptics or whatnot to find what it didn't install.</p>
<p>I am also assuming that you are using a (modern) Unix or MacOS X system.  I assume that most of this material should also apply when using Windows, but if someone can comment, let me know.</p>
<p>Now, as an example, say you want to use the <a href="http://www.gust.org.pl/projects/e-foundry/tex-gyre/pagella">Pagella</a> font from the <a href="http://www.gust.org.pl/projects/e-foundry/tex-gyre">TeX Gyre</a> project.  First download them and install the fonts (the <code>otf</code> files) as you normally would on your computer.  Under MacOS X, this means using Font Book.  If you double-click on an <code>otf</code> file it will load Font Book for you and there will be dialog with a button to install the font.  If you load Font Book yourself, you can use the "Add Fonts..." menu item under the File menu to select the files.  Under a modern Unix, I would recommend just placing the <code>otf</code> files in your <code>~/.fonts</code> folder, though I think file managers like Nautilus also understand how to install fonts.</p>
<p>And that was all the installation work necessary; as I said, XeLaTeX is the easiest solution unless you have specialized needs.  Now just create a small LaTeX document:</p>
<pre class="latex">&nbsp;
<span style="color: #800000; font-weight: normal;">\documentclass</span>{<span style="color: #2222D0; font-weight: normal;">article</span>}
<span style="color: #800000; font-weight: normal;">\usepackage</span>{<span style="color: #2222D0; font-weight: normal;">fontspec</span>}
<span style="color: #800000; font-weight: normal;">\setromanfont</span>{<span style="color: #2222D0; font-weight: normal;">TeX Gyre Pagella</span>}
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\begin</span></span>{<span style="color: #2222D0; font-weight: normal;">document</span>}
Testing XeLaTeX!
&nbsp;
Greek: τεχ.
<span style="color: #800000; font-weight: normal;"><span style="color: #F00000; font-weight: normal;">\end</span></span>{<span style="color: #2222D0; font-weight: normal;">document</span>}</pre>
<p>The <code>fontspec</code> package isn't necessary, but it makes dealing with fonts in XeLaTeX much easier, for example it defines the convenient <code>\setromanfont</code> command.  You can learn more about all of its great features from its beautifully formatted <a href="http://www.ctan.org/get/macros/xetex/latex/fontspec/fontspec.pdf">manual</a>.</p>
<p>The other thing you might need to know is what XeLaTeX thinks your font is called.  If you're using TeX Live, like I suggest, you will have the program <code>otfinfo</code> at your disposal that can do that for you:<br />
<code><br />
% otfinfo --family texgyrepagella-regular.otf<br />
TeX Gyre Pagella<br />
</code><br />
Note that despite its name, <code>otfinfo</code> will also work on <code>ttf</code> files, assuming that they include OpenType data in them.  The other option is to use Font Book on MacOS X or <code>fc-list</code> from the command-line in Unix.</p>
<p>Now you just run <code>xelatex</code>:<br />
<code><br />
% xelatex test.tex<br />
This is XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6)<br />
%&amp;-line parsing enabled.<br />
entering extended mode<br />
(./test.tex<br />
...<br />
...<br />
Output written on test.pdf (1 page).<br />
Transcript written on test.log.<br />
</code><br />
And you have your document:</p>
<p><a href="http://existentialtype.net/wp-content/uploads/2008/07/test.png"><img class="aligncenter size-full wp-image-252" title="test" src="http://existentialtype.net/wp-content/uploads/2008/07/test.png" alt="XeLaTeX test" width="356" height="121" /></a></p>
<p>I think that is about everything you need to know, but if you try this tutorial out and find that something doesn't work, let me know.  If you have more specialized or demanding typographical needs, you may want to use pdfTeX and pdfLaTeX, and part two of the tutorial will explain how to do the necessary configuration to use TrueType and OpenType fonts with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://existentialtype.net/2008/07/12/fonts-in-latex-part-one-xelatex/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

