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
andCambria
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 toCambria
andVerdana
, respectively. Use grouping to delimit the scope of the\Cambria
and\Verdana
directives.Aside: In both
\newfontfamily
directives, I'd use the optionScale=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 optionLigatures=TeX
.