Thanks Otared. That clears up that little item :-)

BTW I know how to reduce font size in the headers (chapter titles) that appear on the recto pages, which I can do with something like \setupheader [style={\ss\switchtobodyfont[10pt]}], but it doesn't seem to affect the header (title of the book) on the verso pages, which is drawn from the simple statement:

\startdocument
  [metadata:title={Book title}]

Shouldn't  \setupheader affect both headers? Or is it possible I have left something out of my \setupheader declaration?

Julian

On 4/9/20 5:30 am, Otared Kavian wrote:
Hi Julian,

The tilde ~ in {\bf\ss #1.~#2} is only there to have an unbreakable fixed space 
between the dot and the first character of the chapter title.  Also in this way 
one can see that one has put a space there… :-)

Best tegards: Otared

On 2 Sep 2020, at 23:29, jbf <roma83...@gmail.com> wrote:

Thanks Otared,

Still off list. You are very patient but also very thorough, and this is making 
a huge difference to what is in fact a considerable challenge for me, but one I 
am coming to grips with. I believe this aspect of things is now clear to me. No 
hurry, but when you have a moment can you explain the significance of the ~ in 
the {\bf\ss #1.~#2}}part of the definition, before the 2nd element?

After this I'll go back on list! I still have a couple of other queries (not 
font related) about things that are not functioning as they ought at the 
moment, which means I'll need either some understanding or some tweaking, but 
as always there are people on the list like yourself who are prompt with their 
assistance.

Kind regards,

Julian

On 3/9/20 12:34 am, Otared Kavian wrote:
Hi Julian,

First of all, your definition of mychapterfont is incomplete: a font family 
should contain also math fonts, because even if you don't have mathematics in 
your text where you use that font, ConTeXt may pick some characters from math 
fonts. So in my opinion you should define a whole font family named 
mychapterfont, where in particular the sans serif comes from what you are 
indicating.

The second point is that you should not setup bodyfont twice: when you say 
twice \setupbodyfont, ConTeXt will take the last one for the rest of your 
document…
So you say only once
        \setupbodyfont[mainface]
and then only where you want to change the font you say
        \start \switchtobodyfont[mychapterfont] \ss My special text. \stop

By the way, as we said earlier, you can also use braces instead of \start\stop, 
and even better you can say

        \start \switchtobodyfont[mychapterfont,sans] My special text. \stop

A third point is that if you are using mychapterfont only to set the titles of 
chapters, in my opinion it would be better to define a command which takes care 
of all the formatting you are wishing, and then use it in the chapter header. 
Something like

\define[2]\MyChapterCommand{\switchtobodyfont[mychapterfont,12pt] {\bf\ss 
#1.~#2}}
\setuphead[chapter][command=\MyChapterCommand]

In this way you can just say

\startchapter[title={This is my first chapter}]

\input ward.tex

\stopchapter

without the hassles of formatting each title. If only some chapters have the 
special font, then you can define a new family of chapters which may share the 
same counter as the rest of your chapters.

Best regards: Otared

On 2 Sep 2020, at 03:30, jbf <roma83...@gmail.com> wrote:

Otared, I thought I had it right - and it is partly right, but that newly 
declared font now applies to everything, not just the chapter title. So I 
haven't got it quite right! Maybe I shouldn't bother the list with these extra 
bits so am writing off list. Here is what my font definitions now look like 
(new one highlighted):

\definefontfamily [mainface] [rm] [alegreya] [sc=file:alegreyasc-bold]
\definefontfamily [mainface] [ss] [dax][tf=file:dax-regular,bf=file:dax-medium]
\definefontfamily [mainface] [mm] [alegreya]
\definefontfamily [mychapterfont] [ss] [itcavantgardepromd] 
[ss=file:itcavantgardepro-md]
\setupbodyfont[mainface]
\setupbodyfont[mychapterfont]

I presumed I would have to \setupbodyfont[mychapterfont], but is this where I 
have gone wrong?.

Then in the first chapter, I wrote as follows:

\chapter{{\switchtobodyfont[mychapterfont] \ss Introduction to the BDACE Online 
Project}} and I am getting my AvanteGardePro-MD font alright, but it now 
applies to the whole document!

I tried following title with \start switchtobodyfont[mainface] \rm and then my 
body text (followed by \stop obviously, at the end of the chapter). But this 
did not work.

I then thought that I could use this [mychapterfont] and include it somehow in 
my \setuphead[chapter] so it would work for all chapter titles, along the lines 
of: \setuphead [chapter] [header=empty, {\switchtobodyfont[mychapterfont] \ss}] 
but that hasn't worked either - my body text throughout is still in the sans 
serif, not the usual [mainface] [rm]

I think the problem is that if I define two or more \setupbodyfont items, it is 
the last of them that controls what happens. But if I don't set up the 
newly-defined [mychapterfont] then it is not recognised when I call it in. So 
what am I doing wrong? You see, I seem to back to the very first question I 
asked, which involved setting up two separate bodyfonts. So what is it I 
haven't understood?

Julian



On 2/9/20 9:59 am, Otared Kavian wrote:
Hi Julian,

What Aditya means is that you define two (or more) font families: one is named 
mainface as yu have already done, the other named mychapterfont (for instance) 
where you attribute whatever fonts you wish to sans serif and else. Then when 
you want to use the special font in some of the titles you use

{\switchtobodyfont[mychapterfont]\ss my text}

You can use also

\start \switchtobodyfont[mychapterfont] \ss my text \stop

in case the braces are not convenient for a longer text.

Best regards: Otared


On 2 Sep 2020, at 01:22, jbf <roma83...@gmail.com>
  wrote:

I presume you mean, {\switchtobodyfont[itcavantgarde]\ss My text} for the case 
I mentioned?

Because at no point in the example I gave of \definefontfamily[mainface] had I 
defined ss as an AvanteGarde typeface, and that is the heart of my question. 
Can I somehow define two kinds of sans serif for different uses?

It was earlier suggested (Hraban) I might be able to do away with the serif 
font or use calligraphy, but I need the rm and I don't need cg (though, was the 
suggestion that I could use the initials cg but set up the typeface in fact as 
a sans serif, in this case AvantGarde? Is that possible? In which case I could 
also use hw as well for a different typeface as well?). As you can see, I am 
trying to get to grips with this whole typeface issue which I find a bit 
complicated.

Julian


On 2/9/20 9:08 am, Aditya Mahajan wrote:

On Tue, 1 Sep 2020, jbf wrote:


Perhaps someone can assist me with the following query. I have a
situation where I need to use more than one sans serif fonts (especially
within complicated chapter heads). I currently have the following:

\definefontfamily [mainface] [rm] [alegreya]
\definefontfamily [mainface] [ss] [dax][tf=
file:dax-regular
]
\definefontfamily [mainface] [mm] [alegreya]
\setupbodyfont[mainface]
\setupbodyfont[11pt]

But what if I need to have, in addition to the Dax sans serif typeface,
an additional sans serif typeface such as ITCAvantGarde? How do I
declare that? Do I just give it another name, e.g.
\definefontfamily[chapter][itcavantgarde] etc? If I did that, how then
do I refer to it? Obviously not just as {\ss my text} since that would
call in the dax font.

{\switchtobodyfont[chapter]\ss my text}

I tried to improve the explanation on the wiki:
https://wiki.contextgarden.net/Font_Switching#Switching_typefaces


Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist :
ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  :
http://www.pragma-ade.nl / http://context.aanhet.net

archive  :
https://bitbucket.org/phg/context-mirror/commits/

wiki     :
http://contextgarden.net

___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist :
ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  :
http://www.pragma-ade.nl / http://context.aanhet.net

archive  :
https://bitbucket.org/phg/context-mirror/commits/

wiki     :
http://contextgarden.net

___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist :
ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  :
http://www.pragma-ade.nl / http://context.aanhet.net

archive  :
https://bitbucket.org/phg/context-mirror/commits/

wiki     :
http://contextgarden.net

___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to