[XeTeX] Using OTF fonts in custom letter class file
Peter Dyballa
Peter_Dyballa at Web.DE
Tue Dec 16 11:14:06 CET 2008
Am 16.12.2008 um 07:46 schrieb R (Chandra) Chandrasekhar:
> \DeclareFixedFont{\viiipl}{OT1}{ppl}{m}{n}{8} % 8 pt
\newfontfamily\viiipl{Palatino} + \fontfamily{viiipl}\fontsize
{<whatever>}{8pt}\selectfont <some address text>
For more (old) LaTeX compatibility you might consider to \renewcommand
{\viiipl} to perform font and size selection, i.e., the + part from
above.
The latter is untested. Feedback desirable.
The questions you asked could be answered this way, I think:
\documentclass[a4paper,11pt]{article}
\usepackage{ifpdf,ifxetex}
\ifxetex
\immediate\write16{==We're with XeTeX==}
\usepackage[no-math]{fontspec}
\usepackage{xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\newfontfamily\Pal{Palatino}
\renewcommand*{\viiipl}{\fontfamily{Pal}\fontsize{9pt}{8pt}
\selectfont}
% \DeclareGraphicsExtensions{.pdf,.png,.jpeg,.bmp} % formats
with xdvipdfmx
% \DeclareGraphicsExtensions{.mac,.pict,.psd,.sgi,.tga,.tif,.gif}
% additionally with xdv2pdf
\else
\immediate\write16{==We're without XeTeX==}
\ifpdf
\immediate\write16{==\jobname: Bonjour, PDF!==}
\usepackage{cmap}
% \DeclareGraphicsExtensions{.pdf,.png,.jpeg} % in pdfTeX
allowed graphics formats
\usepackage[activate={true,nocompatibility}]{microtype}
% \usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{<some font>}
...
\else
\immediate\write16{==¡Hola \jobname: DVI!==}
% \DeclareGraphicsExtensions{.ps,.eps} % in dvips allowed
graphics formats
\usepackage[protrusion=true,expansion=false]{microtype}
\usepackage{<some font>}
\fi
\usepackage[utf8x]{inputenc}
% \usepackage[utf8]{inputenc}
\usepackage[full]{textcomp}
% \usepackage[LUC,T1]{fontenc}
\usepackage[T1]{fontenc} % other font encodings: T2A, T2B,
T2C, X2, LCY, OT2 (LY1, T5)
\DeclareFixedFont{\viiipl}{OT1}{ppl}{m}{n}{8} % 8 pt
% for compatibility definitions of XeTeX and XeLaTeX logos
\fi
In the text body you can also use \ifxetex and \ifpdf to let perform
particular XeTeX or pdfTeX or (DVI)TeX related things.
--
Greetings
Pete
People say that if you play Microsoft CD's backwards, you hear
satanic things, but that's nothing, because if you play them
forwards, they install MS Windows.
More information about the XeTeX
mailing list