You have a few issues here. One is that you’re trying to mix legacy NFSS font families and modern fonts with fontspec
. (This is possible, but more complicated than you need.) The second is that you want to format your chapter/section titles, but you haven’t loaded a package to do that (such as KOMA-Script’s scrlayer
or titlesec
). A third, trivial one is that you’re using even and odd pages without the twoside
option to your document class.
Here’s a really ugly hack that makes only the minimal changes to your document:
\documentclass[twoside]{article}
\usepackage{fontspec} % I'm using XeLaTeX
\usepackage{fancyhdr}
\defaultfontfeatures{Scale=MatchLowercase}
\newfontfamily\DroidSerif{Droid Serif}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO]{\textbf{\rightmark}}
\fancyfoot{}
\fancyfoot[LE,RO]{\fontfamily{\rmdefault}\thepage}
\begin{document}
\begin{titlepage}
\centering\DroidSerif
My title with droid font
\end{titlepage}
\section{\DroidSerif A section}
This text is in lmr style, but not the section title.
\end{document}
This is so basic, the section number is in a different font than the section title.
Here is a more full-featured solution using KOMA-Script:
\documentclass[headsepline, twoside]{scrartcl}
\usepackage{fontspec} % I'm using XeLaTeX
\usepackage{scrlayer-scrpage}
\defaultfontfeatures{Scale=MatchLowercase}
\newfontfamily\DroidSerif{Droid Serif}
\title{My Title with Droid Serif}
\author{Martin}
\pagestyle{scrheadings}
\lefoot{\pagemark}
\rofoot{\pagemark}
\automark[section]{section}
\automark*[subsection]{}
\addtokomafont{pagehead}{\DroidSerif\bfseries\upshape}
\addtokomafont{pagefoot}{\rmfamily}
\addtokomafont{title}{\DroidSerif}
\addtokomafont{section}{\DroidSerif}
\addtokomafont{subsection}{\DroidSerif}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\section{A section}
This text is in lmr style, but not the section title.
\newpage
Lorem ipsum dolor sit amet.
\end{document}
If you’re required to use PDFLaTeX, you need to remove \usepackage{fontspec}
and add the appropriate NFSS commands. Load droid
, and then lmodern
to override it. The font family of Droid Serif is fdr
. Although I don’t recommend this if you can use XeLaTeX, here’s a MWE:
\documentclass[headsepline, twoside]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage{droid}
\usepackage{lmodern}
\usepackage{scrlayer-scrpage}
\newcommand\DroidSerif{\fontfamily{fdr}\selectfont}
\title{My Title with Droid Serif}
\author{Martin}
\pagestyle{scrheadings}
\lefoot{\pagemark}
\rofoot{\pagemark}
\automark[section]{section}
\automark*[subsection]{}
\addtokomafont{pagehead}{\DroidSerif\bfseries\upshape}
\addtokomafont{pagefoot}{\rmfamily}
\addtokomafont{title}{\DroidSerif}
\addtokomafont{section}{\DroidSerif}
\addtokomafont{subsection}{\DroidSerif}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\section{A section}
This text is in lmr style, but not the section title.
\newpage
Lorem ipsum dolor sit amet.
\end{document}