[Tex/LaTex] Sans Serif headings, Serif Body text

contextfontssectioningxetex

I'm using ConTeXt, with XeTex.
So I'm compiling my document: texexec --xetex foo.tex

I would like to follow the convertion of having my headings all in Sans Serif,
and my body text in Serif.
I want to do this with my own fonts:

%&context
\definetypeface[BerlinSSDB][ss][sans][Berlin Sans FB Demi]
\definetypeface[Minion][rm][Xserif][Minion Pro]
\setupbodyfont[Minion, 12pt]

\setuphead[chapter][
    style=\ss,
    sectionnumber=yes
    ]

\setuphead[section][
    style=\ss,
    sectionnumber=no
    ]

\starttext

\chapter{Welcome}
A well known text, used to fill space.

\section{H. Rackham 1914}
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness... But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?

\stoptext

Everything, headings, body and all is coming up in Minion Pro.
This seems reasonable since no where have I told it what font to use,
except to say "Use Minion".
(I believe \setupbodyfont, uses the word body with a different meaning to what I have here.)

Best Answer

The answer is surprisingly simple: in your example, the first term in the line

\definetypeface[BerlinSSDB][ss][sans][Berlin Sans FB Demi]

is just an identifier which can be anything. If you want to have a full set (rm + sans), you need to use the same identifier so ConTeXt knows that these fonts form one collection. So here's your example rewritten (I have tested with other fonts because I don't have the ones you use; better use generic fonts for your MWE):

\definetypeface [Oxinabox] [rm] [Xserif] [Minion Pro]
\definetypeface [Oxinabox] [ss] [Xsans]  [Berlin Sans FB Demi]
\setupbodyfont  [Oxinabox, 12pt]

\setuphead[chapter][
    style=\ss,
sectionnumber=yes
]

\setuphead[section][
style=\ss,
sectionnumber=no
]

\starttext

\chapter{Welcome}
A well known text, used to fill space.

\section{H. Rackham 1914}
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness... But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?

\stoptext

But as others have already said, if you're serious about using ConTeXt, better have a look at luatex/mkiv. It can almost everything that XeTeX can, and then so much more.

Related Question