ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Different fonts for titles
@ 2013-04-15  5:49 "H. Özoguz"
  2013-04-15  5:57 ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: "H. Özoguz" @ 2013-04-15  5:49 UTC (permalink / raw)
  To: ntg-context

Thanks @Wolfgang and Tim, specially for your long and well 
understandable explenations, Wolfgang! Should be integrated into the wiki.

Huseyin
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Different fonts for titles
  2013-04-15  5:49 Different fonts for titles "H. Özoguz"
@ 2013-04-15  5:57 ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2013-04-15  5:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 109 bytes --]

On Mon, 15 Apr 2013, "H. Özoguz" wrote:

> Should be integrated into the wiki.

Please do that!

Aditya

[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Different fonts for titles
  2013-04-14 21:42 ` Wolfgang Schuster
@ 2013-04-15  1:17   ` Tim Li
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Li @ 2013-04-15  1:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Different fonts for titles
  2013-04-14 12:34 "H. Özoguz"
@ 2013-04-14 21:42 ` Wolfgang Schuster
  2013-04-15  1:17   ` Tim Li
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-04-14 21:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Different fonts for titles
@ 2013-04-14 12:34 "H. Özoguz"
  2013-04-14 21:42 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: "H. Özoguz" @ 2013-04-14 12:34 UTC (permalink / raw)
  To: ntg-context

Hoping for some hints .... :)
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Different fonts for titles
@ 2013-04-13  9:47 "H. Özoguz"
  0 siblings, 0 replies; 6+ messages in thread
From: "H. Özoguz" @ 2013-04-13  9:47 UTC (permalink / raw)
  To: ntg-context

Hi there,

how can I use a different font for titles using simplefont? (chapter, 
section, subsection, ....)

At now, I use (e.g.) \definedfont[name:fontname at 12pt], but for many 
fonts, that results in bad kerning (empty space between characters), but 
for some fonts, that works.

So, is there a better way to change easily the font (using Simplefont 
maybe), and how to set the title-fonts (no typescript, if possible :))

Thanks!
Huseyin
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-15  5:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15  5:49 Different fonts for titles "H. Özoguz"
2013-04-15  5:57 ` Aditya Mahajan
  -- strict thread matches above, loose matches on Subject: below --
2013-04-14 12:34 "H. Özoguz"
2013-04-14 21:42 ` Wolfgang Schuster
2013-04-15  1:17   ` Tim Li
2013-04-13  9:47 "H. Özoguz"

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).