ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Whacko font behaviour ? ( Or Am I ? :O)
Date: Mon, 14 Jul 2008 22:30:32 +0200	[thread overview]
Message-ID: <3712BF40-8198-44D1-9CFC-717C361B79C4@gmail.com> (raw)
In-Reply-To: <326847810807141222h63f39b8dp6d1a41bf5c1dbe68@mail.gmail.com>


Am 14.07.2008 um 21:22 schrieb Alan Stone:

> ConTeXt  ver: 2008.07.10 08:40 MKIV  fmt: 2008.7.10  int: english/ 
> english
>
> See test.tex in attachement.
>
> The following combinations give the following results after  
> compiling with
>
>   texmfstart texexec --lua test.tex
>
> -------------------------------------------------------------------------------
>
> (1) \definefont[myChapterFont][myHeadingsFont sa 1.728]  % with

You could either use a real font name like 'Arial' or a symbolic name
defined with \definefontsynonym like 'Serif', 'SerifBold', 'Sans',
'Dummy-Regular' etc. in the second argument of \definefont but not
the name for a font collection defined with \definetype, in your case

\definefont[myChapterFont][Sans sa 1.728]

or

\definefont[myChapterFont][DummyRegular sa 1.728]

> \setuphead[chapter][style=myChapterFont] % or
> \setuphead[chapter][style=\myChapterFont] % or
> \setuphead[chapter][style={\myChapterFont}]
>
> generates the following compile error...
>
> ! Font \**myChapterFont**:=myHeadingsFont at 20.736pt not loadable:  
> metric data not found or bad.
> <to be read again>
>                   \relax
> \dododefinefont ...ontspec {#2}\rawfontidentifier
>                                                  \let  
> \localrelativefontsiz...
> \dosetfontattribute ...me #1#2\@EA \endcsname \fi
>                                                  \empty
> \doplaceheadnumbertext ...bute {\??ko #1}\c!style
>                                                  \getvalue {\??ko  
> #1\c!comm...
> \dodododoconstructhead ...{\finalsectionnumber }}}
>                                                  \writesection {#1} 
> {#3}{#4}...
> l.54 \chapter{chapter test}
>
> ?
> ! Emergency stop.
> <to be read again>
>                   \relax
> \dododefinefont ...ontspec {#2}\rawfontidentifier
>                                                  \let  
> \localrelativefontsiz...
> \dosetfontattribute ...me #1#2\@EA \endcsname \fi
>                                                  \empty
> \doplaceheadnumbertext ...bute {\??ko #1}\c!style
>                                                  \getvalue {\??ko  
> #1\c!comm...
> \dodododoconstructhead ...{\finalsectionnumber }}}
>                                                  \writesection {#1} 
> {#3}{#4}...
> l.54 \chapter{chapter test}
>
> !  ==> Fatal error occurred, no output PDF file produced!
>
> -------------------------------------------------------------------------------
>
> (2) \definefont[myChapterFont][Sans sa 1.728]  % with
>
> \setuphead[chapter][style=myChapterFont] % or
> \setuphead[chapter][style=\myChapterFont] % or
> \setuphead[chapter][style={\myChapterFont}]
>
> displays the chapter heading with a scaled LMSans10-Regular font

This did happen because Latin Modern Sans is the default sans serif  
font,
you have to define a typescript with the desired font as sans style or  
you
use a symbolic name for 'myChapterFont', in your case 'Dummy-Regular'.

\starttypescript [myBodyFont]
    \definetypeface [myBodyFont] [rm] [serif] [myBodyFont] [default]
    \definetypeface [myBodyFont] [ss] [sans] [myHeadingsFont] [default]
\stoptypescript

works with the definition from you because it use now Arial as sans  
font.

> -------------------------------------------------------------------------------
>
> (3) this displays the chapter heading font correctly
>
> \setuphead[chapter][style={\tfc\myHeadingsFont}]
>
> -------------------------------------------------------------------------------
>
> (4) \setuphead[chapter][style={\tfc\Sans}]
>
> generates the following compile error...
>
> ! Undefined control sequence.
> \@@kochapterstyle ->\tfc \Sans
>
> \doifdefinedelse #1->\edef \p!defined {#1
>                                         }\ifcsname \detokenize \@EA  
> {\p!def...
> \doconvertfont #1->\doifdefinedelse {\@letter@ #1}
>                                                   {\doifelsenothing  
> {#1}\go...
> \dosetfontattribute ...me #1#2\@EA \endcsname \fi
>                                                  \empty
> \doplaceheadnumbertext ...bute {\??ko #1}\c!style
>                                                  \getvalue {\??ko  
> #1\c!comm...
> \dodododoconstructhead ...{\finalsectionnumber }}}
>                                                  \writesection {#1} 
> {#3}{#4}...
> l.54 \chapter{chapter test}
>
> ?
> ! Emergency stop.
> \@@kochapterstyle ->\tfc \Sans
>
> \doifdefinedelse #1->\edef \p!defined {#1
>                                         }\ifcsname \detokenize \@EA  
> {\p!def...
> \doconvertfont #1->\doifdefinedelse {\@letter@ #1}
>                                                   {\doifelsenothing  
> {#1}\go...
> \dosetfontattribute ...me #1#2\@EA \endcsname \fi
>                                                  \empty
> \doplaceheadnumbertext ...bute {\??ko #1}\c!style
>                                                  \getvalue {\??ko  
> #1\c!comm...
> \dodododoconstructhead ...{\finalsectionnumber }}}
>                                                  \writesection {#1} 
> {#3}{#4}...
> l.54 \chapter{chapter test}
>
> !  ==> Fatal error occurred, no output PDF file produced!

The correct definition is:

\setuphead[chapter][style={\tfc\ss}]


You should also read Aditya Mahajans about article about fonts:
http://wiki.contextgarden.net/Font_Switching
http://www.tug.org/TUGboat/Articles/tb28-2/tb89mahajan.pdf


Regards,
Wolfgang

___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-07-14 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 19:22 Alan Stone
2008-07-14 20:30 ` Wolfgang Schuster [this message]
2008-07-16  9:36 Alan Stone
2008-07-16 16:00 Alan Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3712BF40-8198-44D1-9CFC-717C361B79C4@gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).