# How to use Windows fonts with memoir class

I am writing my thesis using the memoir class within MiKTeX on Windows 7. However, I want to use some of the Windows fonts (e.g., Cambria). Is it possible to be done?

-
Yes, with XeTeX or LuaTeX you can use all system fonts. –  Stephan Lukasczyk Apr 8 '13 at 14:40
Could you give me some example, please? –  alchemist_ bg Apr 8 '13 at 14:41
The fontspec package provides support for this in XeTeX and LuaTeX. Please consult its documentation. @Mario S. E. mentioned the two necessary commands in his answer. –  Stephan Lukasczyk Apr 8 '13 at 14:46
Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Peter Jansson Apr 8 '13 at 14:54

As per fontspec package documentation in LuaTeX and XeTeX, you could set this by using:

\usepackage{fontspec}
\setmainfont{Cambria}

-

The code that I tried with:

\documentclass[]{article}

\usepackage{polyglossia}
\setmainlanguage{bulgarian}
\setotherlanguage{english}

\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX}}
\setmainfont{Cambria}
\setsansfont{Corbel}

\usepackage[math-style=ISO,bold-style=ISO]{unicode-math}
\setmathfont[Color=000066]{Cambria Math}
% Symbol \perp is not defined in Cambria Math, so we fix this bug
\AtBeginDocument{\def\perp{\mathrel\bot}}

\begin{document}
Здравей.
\end{document}


I am using TexStudio with it's default command for XeTeX. MikTex is 32 bit on Windows 64bit.

-
I think that problem was with encoding of source file. –  alchemist_ bg Apr 9 '13 at 7:26

A better way to use Windows (Open Type) fonts is to switch from pdftex engine to xetex or to luatex. I prefer xetex since MikTeX's luatex is extremely slow. Here is a working example from my current textbook:

\documentclass{...}% any class at your choice

\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX}}
\setmainfont[Numbers={Proportional}]{Cambria}
\setsansfont{Corbel}

\usepackage[math-style=ISO,bold-style=ISO]{unicode-math}
\setmathfont[Color=000066]{Cambria Math}
% Symbol \perp is not defined in Cambria Math, so we fix this bug
\AtBeginDocument{\def\perp{\mathrel\bot}}

\usepackage[english,ngerman,swedish,main=russian]{babel}


Then run xelatex.exe instead of pdflatex.exe. All eps graphics should be preliminarily converted to pdf.

Note that Cambria Math is the best math font fit for Cambria text font. Both Cambria text and Cambria Math come with Windows 7 as well as Corbel sans-serif font. Unfortunately there is no free good math pair for other text Open Type fonts included with Windows.

That's all, folks!

P.S. In general, it is recommended to use polyglossia package instead of babel when compiling your document under luatex/xetex if babel fails for your language.

-
I tried with your piece of code and it is working with english. But for other languages there is a problem. –  alchemist_ bg Apr 8 '13 at 20:53