ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Tim Li <timli2013@outlook.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Different fonts for titles
Date: Mon, 15 Apr 2013 01:17:20 +0000	[thread overview]
Message-ID: <BLU152-W38B35DC20E608099EDE6C2A9CC0@phx.gbl> (raw)
In-Reply-To: <6AA76928-A71A-4686-9CF8-C2A439467B5C@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3480 bytes --]

maybe you can use another method that I usually use
 \definefontsynonym[PalatinoRoman][name:palatinolinotypebold][features=default]\definefont[TitleFont][PalatinoRoman sa 1]...> From: schuster.wolfgang@gmail.com
> Date: Sun, 14 Apr 2013 23:42:16 +0200
> To: ntg-context@ntg.nl
> Subject: Re: [NTG-context] Different fonts for titles
> 
> 
> Am 14.04.2013 um 14:34 schrieb H. Özoguz <h.oezoguz@mmnetz.de>:
> 
> > Hoping for some hints .... :)
> 
> What you’re looking for is the \definefont command, in one way a low level method to access a font
> but also a usefull command to create styles for headings etc.
> 
> 
> Let me start with the following example:
> 
>   \definefont[Test][texgyrepagellaregular at 12pt]
> 
>   \starttext
>   \Test VA ffl
>   \stoptext
> 
> What I do here is to create the new command \Test which loads the file “texgrepagellaregular”
> at a size 12pt. With the optional prefix on front of the font name you can specify the search method,
> context provides the three different methods a) file b) name and c) spec.
> 
>   a) \definefont[Test][file:texgyrepagellaregular]
>   b) \definefont[Test][name:texgyrepagellaregular]
>   c) \definefont[Test][spec:texgyrepagella-normal-normal]
> 
> 
> Instead of a fixed size for the font you can also use a relative size which depends on the bodyfont.
> 
>   \definefont[Test][texgyrepagellaregular sa 1]
> 
>   \starttext
>   \Test VA ffl \switchtobodyfont[20pt]\Test VA ffl
>   \stoptext
> 
> When you use “sa XX” as argument for the size your font scales also when you change the bodyfont
> in the middle of the document.
> 
> 
> One problem of the definitions above is that kerning, ligatures etc. aren’t activated for the font
> because no feature isn’t applied. To apply a feature set you have to use a different method than
> the one which is used in a typescript because \definefont has no feature-key. What you have to
> do to apply the set is to append it after the name name and separate both with a asterisks.
> 
>   \definefont[Test][texgyrepagellaregular*default sa 1]
> 
>   \starttext
>   \Test VA ffl
>   \stoptext
> 
> 
> Instead of the real name of a file you can also use a symbolic name from a typescript.
> 
>   \definefont[Test][SansBold sa 1]
> 
>   \starttext
>   \Test VA ffl
>   \stoptext
> 
> In this example I used the bold version of the sans style for my \Test font, in this case
> you don’t have to add the name of a feature because it has been already set in the typescript.
> 
> 
> A complete example in a document could be look like this:
> 
> \definetypeface[mainface][rm][specserif][Antykwa Poltawskiego]
> \definetypeface[mainface][ss][specsans] [Iwona]
> 
> \definefont[ChapterStyle][SansBold sa 3]
> 
> \setuphead[chapter][style=ChapterStyle]
> 
> \setupbodyfont[mainface]
> 
> \starttext
> 
> \chapter{Knuth}
> 
> \input knuth
> 
> \stoptext
> 
> 
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 4256 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

  reply	other threads:[~2013-04-15  1:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-14 12:34 "H. Özoguz"
2013-04-14 21:42 ` Wolfgang Schuster
2013-04-15  1:17   ` Tim Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-04-15  5:49 "H. Özoguz"
2013-04-15  5:57 ` Aditya Mahajan
2013-04-13  9:47 "H. Özoguz"

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=BLU152-W38B35DC20E608099EDE6C2A9CC0@phx.gbl \
    --to=timli2013@outlook.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).