[Tex/LaTex] latex, xetex – and zapfino

fontspecxetex

I know how to use LaTeX (not an expert, but still quite some experience – wrote couple of papers and my thesis, can make TikZ pictures etc.), but I don't have the slightest idea, what XeTeX, LuaTeX, etc. are.

For an invitation card I'd like to design I found this beautiful font named zapfino. But it's for XeTeX or LuaTex.
This website has a nice example:
http://nitens.org/taraborelli/latex#glyph
I downloaded that tex code, but I can't compile the code on my ubuntu machine (with texlive) – neither using LaTeX (no surprise there), nor xetex, nor luatex, nor xelatex. I always have issues.
Best works xelatex, it only complains about the font not being found before it exits. I downloaded the font from <removed> and put the .otf file into /usr/local/share/texmf (where the TEXMFLOCAL variable points to), but that does not change anything. What do I do wrong?

Is there a possibility to make zapfino work with latex? and if not, how can I compile that small example on my machine, what do I have to do? Furthermore – is there a way of combining XeTeX (for the font) with LaTeX (for TikZ-tricks)?

Best Answer

The file is quite old, in comparison to the big developments on XeTeX and fontspec that have been made in the last eight years.

Here's a fixed version that works well. Note that I'm on a Mac OS X machine, where Zapfino is provided along with the operating system. However, the font is not free, so you have to buy it in order to be able of exploiting its features.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

% Dario Taraborelli (2008)
% The Beauty of LaTeX
% URL: http://nitens.org/taraborelli/latex
% Some rights reserved: CC-BY-SA
% (modified by egreg for TeX.StackExchange.com)

\documentclass[11pt]{article}
\usepackage{fontspec, graphicx}
\usepackage[usenames]{color}
\usepackage[
  colorlinks,
  breaklinks,
  pdftitle={The Beauty of LaTeX},
  pdfauthor={Taraborelli, Dario}
]{hyperref}

\definecolor{Gray}{rgb}{.7,.7,.7}
\definecolor{lightblue}{rgb}{.2,.5,1}

\newcommand{\red}{\color{red}}
\newcommand{\reda}{\color{red}\addfontfeatures{Variant=2}}
\newcommand{\redb}{\color{red}\addfontfeatures{Variant=3}}
\newcommand{\redc}{\color{red}\addfontfeatures{Variant=4}}
\newcommand{\redd}{\color{red}\addfontfeatures{Variant=5}}
\newcommand{\rede}{\color{red}\addfontfeatures{Variant=6}}
\newcommand{\redf}{\color{red}\addfontfeatures{Variant=7}}
\newcommand{\redg}{\color{red}\addfontfeatures{Variant=8}}
\newcommand{\lbl}{\color{lightblue}}
\newcommand{\lbla}{\color{lightblue}\addfontfeatures{Variant=2}}
\newcommand{\lblb}{\color{lightblue}\addfontfeatures{Variant=3}}
\newcommand{\lblc}{\color{lightblue}\addfontfeatures{Variant=4}}
\newcommand{\lbld}{\color{lightblue}\addfontfeatures{Variant=5}}
\newcommand{\lble}{\color{lightblue}\addfontfeatures{Variant=6}}
\newcommand{\lblf}{\color{lightblue}\addfontfeatures{Variant=7}}
\newcommand{\lblg}{\color{lightblue}\addfontfeatures{Variant=8}}

\setmainfont{Hoefler Text}

\newfontfamily{\zapfinofont}{Zapfino}[
  Ligatures={Common, Rare},
  Variant=1,
]

\begin{document}

\begin{center}
\fontsize{25pt}{30pt}\zapfinofont

{\red d}roo{\lbl g}\hfill{\reda d}roo{\lbla g}

{\redb d}roo{\lblb g}\hfill{\redf d}roo{\lblf g}

{\redc d}roo{\lblc g}\hfill{\redd d}roo{\lbld g}

{\rede d}roo{\lble g}\hfill{\redg d}roo{\lblg g}
\end{center}

\vfill

\begin{flushright}
D. Taraborelli (2008), 
\href{http://nitens.org/taraborelli/latex}{The Beauty of \LaTeX}\\
\emph{Some rights reserved}. 
\href{http://creativecommons.org/licenses/by-sa/3.0/}{\textsc{cc-by-sa}}
\end{flushright}

\end{document}

enter image description here