2

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}
  • 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. – bgmCoder Nov 27 '13 at 23:04
4

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}

enter image description here

1

A (probably) general LaTeX solution:

\newcommand{\BGMfont}{%
  \fontencoding{EncodingOfYourFont}% 
  \fontfamily{NameOfYourFont}%
  \fontsize{22}{25}% % about \huge
  \selectfont}
{\BGMfont My Words Here}

Without an illustration of the result, of course, because it is an answer for the first version of your question, when the name of the font was not known.

Not the answer you're looking for? Browse other questions tagged or ask your own question.