[Tex/LaTex] Verdana and Cambria Font

fonts

I would like to manually set a small section of my text to either Verdana or Cambria (with font sizes ranging from 11, 12, 18 or 20) but have no idea how to do that.

I've tried

\usepackage[T1]{fontenc}
\usepackage{lxfonts}

To get Verdana loaded but it just went ahead and rewrote all my text in Verdana.

Best Answer

If you are free to use LuaLaTeX or XeLaTeX, and if fonts named Verdana and Cambria are installed on your computer system, all you need to do is load the fontspec package, issue a suitable \setmainfont directive, and issue two \newfontfamily directives to specify how to make the text font switch over to Cambria and Verdana, respectively. Use grouping to delimit the scope of the \Cambria and \Verdana directives.

Aside: In both \newfontfamily directives, I'd use the option Scale=MatchLowercase to ensure that the fonts mesh reasonably well (at least size-wise) with the main text font. And, if you need the basic "TeX ligatures" such as en- and em-dashes, be sure to specify the option Ligatures=TeX.

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman} % or some other suitable font

\newfontfamily\Cambria{Cambria}[Scale=MatchLowercase,
                                Ligatures=TeX]
\newfontfamily\Verdana{Verdana}[Scale=MatchLowercase,
                                Ligatures=TeX]
\newcommand\qbf{The quick brown fox jumps over the lazy dog}
\begin{document}
\qbf. --- Times New Roman 

{\Cambria \qbf. --- Cambria}

{\Verdana \qbf. --- Verdana}
\end{document}