# How to change font without changing document font [duplicate]

Surely this is easy, but I'm just beginning.

I've created a font and I want to change "My Words Here" without modifying the document font for the rest of the page. I'm sure I just have the syntax wrong. How do I fix it?

\newfontface\Gentium{Gentium}

\begin{Gentium}
\begin{center}
\begin{huge}
\textsc{My Words Here}
\end{huge}
\end{center}
\end{Gentium}

-

## marked as duplicate by doncherry, lockstep, Alan Munn, Jubobs, Stefan Kottwitz♦Nov 27 '13 at 23:22

Why did you use those tags? If gregorio is involved, your example should mention it; the first line means nothing. –  egreg Nov 27 '13 at 22:58
Sorry - I just realized those tokens and then I saw your comment. I use a script to replace them. I'll remove them. –  BGM Nov 27 '13 at 23:04

Just confine the font change in the environment. Note that Gentium doesn't provide small caps.

\documentclass{article}
\usepackage{fontspec}

\newfontfamily\Gentium[Ligatures=TeX]{Gentium}

\begin{document}
This is in the normal font
\begin{center}
\Gentium\huge
This is in the Gentium font
\end{center}
and back in the normal font.
\end{document}


-
Thanks, egreg - that' just what I wanted. –  BGM Nov 27 '13 at 23:29

A (probably) general LaTeX solution:

\newcommand{\BGMfont}{%
\fontencoding{EncodingOfYourFont}%
\fontfamily{NameOfYourFont}%