From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81686 Path: news.gmane.org!not-for-mail From: Tim Li Newsgroups: gmane.comp.tex.context Subject: Re: Different fonts for titles Date: Mon, 15 Apr 2013 01:17:20 +0000 Message-ID: References: <516AA262.4080509@mmnetz.de>, <6AA76928-A71A-4686-9CF8-C2A439467B5C@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1467636255==" X-Trace: ger.gmane.org 1365988694 26239 80.91.229.3 (15 Apr 2013 01:18:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2013 01:18:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 15 03:18:18 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from [195.12.62.10] (helo=balder.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URY3l-0000Su-FB for gctc-ntg-context-518@m.gmane.org; Mon, 15 Apr 2013 03:18:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 01B9110264; Mon, 15 Apr 2013 03:17:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xJ8dGP+Mt72k; Mon, 15 Apr 2013 03:17:36 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3CB1610248; Mon, 15 Apr 2013 03:17:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0C51310248 for ; Mon, 15 Apr 2013 03:17:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Z-fdHNCsDwJo for ; Mon, 15 Apr 2013 03:17:30 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 0D09F1023F for ; Mon, 15 Apr 2013 03:17:29 +0200 (CEST) Original-Received: from blu0-omc2-s20.blu0.hotmail.com (blu0-omc2-s20.blu0.hotmail.com [65.55.111.95]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3F1HLqS002882 for ; Mon, 15 Apr 2013 03:17:22 +0200 Original-Received: from BLU152-W38 ([65.55.111.71]) by blu0-omc2-s20.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 14 Apr 2013 18:17:21 -0700 X-EIP: [JgLL0BorBDkGe0Ica7JAWBI7evFXpInY] X-Originating-Email: [timli2013@outlook.com] Importance: Normal In-Reply-To: <6AA76928-A71A-4686-9CF8-C2A439467B5C@gmail.com> X-OriginalArrivalTime: 15 Apr 2013 01:17:21.0023 (UTC) FILETIME=[FA65E8F0:01CE3976] X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=65.55.111.95; country=US; region=WA; city=Redmond; postalcode=98052; latitude=47.6801; longitude=-122.1206; metrocode=819; areacode=425; http://maps.google.com/maps?q=47.6801,-122.1206&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NJo1hlqp - 69f353919091 - 20130415 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81686 Archived-At: --===============1467636255== Content-Type: multipart/alternative; boundary="_7819c4ae-0b4f-4cb1-a1fe-9d37a2fd7b1f_" --_7819c4ae-0b4f-4cb1-a1fe-9d37a2fd7b1f_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable maybe you can use another method that I usually use \definefontsynonym[PalatinoRoman][name:palatinolinotypebold][features=3Dde= fault]\definefont[TitleFont][PalatinoRoman sa 1]...> From: schuster.wolfgan= g@gmail.com > Date: Sun=2C 14 Apr 2013 23:42:16 +0200 > To: ntg-context@ntg.nl > Subject: Re: [NTG-context] Different fonts for titles >=20 >=20 > Am 14.04.2013 um 14:34 schrieb H. =D6zoguz : >=20 > > Hoping for some hints .... :) >=20 > What you=92re looking for is the \definefont command=2C in one way a low = level method to access a font > but also a usefull command to create styles for headings etc. >=20 >=20 > Let me start with the following example: >=20 > \definefont[Test][texgyrepagellaregular at 12pt] >=20 > \starttext > \Test VA ffl > \stoptext >=20 > What I do here is to create the new command \Test which loads the file = =93texgrepagellaregular=94 > at a size 12pt. With the optional prefix on front of the font name you ca= n specify the search method=2C > context provides the three different methods a) file b) name and c) spec. >=20 > a) \definefont[Test][file:texgyrepagellaregular] > b) \definefont[Test][name:texgyrepagellaregular] > c) \definefont[Test][spec:texgyrepagella-normal-normal] >=20 >=20 > Instead of a fixed size for the font you can also use a relative size whi= ch depends on the bodyfont. >=20 > \definefont[Test][texgyrepagellaregular sa 1] >=20 > \starttext > \Test VA ffl \switchtobodyfont[20pt]\Test VA ffl > \stoptext >=20 > When you use =93sa XX=94 as argument for the size your font scales also w= hen you change the bodyfont > in the middle of the document. >=20 >=20 > One problem of the definitions above is that kerning=2C ligatures etc. ar= en=92t activated for the font > because no feature isn=92t applied. To apply a feature set you have to us= e 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. >=20 > \definefont[Test][texgyrepagellaregular*default sa 1] >=20 > \starttext > \Test VA ffl > \stoptext >=20 >=20 > Instead of the real name of a file you can also use a symbolic name from = a typescript. >=20 > \definefont[Test][SansBold sa 1] >=20 > \starttext > \Test VA ffl > \stoptext >=20 > In this example I used the bold version of the sans style for my \Test fo= nt=2C in this case > you don=92t have to add the name of a feature because it has been already= set in the typescript. >=20 >=20 > A complete example in a document could be look like this: >=20 > \definetypeface[mainface][rm][specserif][Antykwa Poltawskiego] > \definetypeface[mainface][ss][specsans] [Iwona] >=20 > \definefont[ChapterStyle][SansBold sa 3] >=20 > \setuphead[chapter][style=3DChapterStyle] >=20 > \setupbodyfont[mainface] >=20 > \starttext >=20 > \chapter{Knuth} >=20 > \input knuth >=20 > \stoptext >=20 >=20 > Wolfgang > _________________________________________________________________________= __________ > If your question is of interest to others as well=2C please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ = --_7819c4ae-0b4f-4cb1-a1fe-9d37a2fd7b1f_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
maybe you can use another method= that I usually use
 =3B
\definefontsynonym[PalatinoRoman][name:p= alatinolinotypebold][features=3Ddefault]
\definefont[TitleFont][Palatino= Roman sa 1]
...
>=3B Fro= m: schuster.wolfgang@gmail.com
>=3B Date: Sun=2C 14 Apr 2013 23:42:16 = +0200
>=3B To: ntg-context@ntg.nl
>=3B Subject: Re: [NTG-context]= Different fonts for titles
>=3B
>=3B
>=3B Am 14.04.2013 u= m 14:34 schrieb H. =D6zoguz <=3Bh.oezoguz@mmnetz.de>=3B:
>=3B
= >=3B >=3B Hoping for some hints .... :)
>=3B
>=3B What you= =92re looking for is the \definefont command=2C in one way a low level meth= od to access a font
>=3B but also a usefull command to create styles f= or headings etc.
>=3B
>=3B
>=3B Let me start with the foll= owing example:
>=3B
>=3B \definefont[Test][texgyrepagellaregul= ar at 12pt]
>=3B
>=3B \starttext
>=3B \Test VA ffl
&= gt=3B \stoptext
>=3B
>=3B What I do here is to create the new = command \Test which loads the file =93texgrepagellaregular=94
>=3B at = a size 12pt. With the optional prefix on front of the font name you can spe= cify the search method=2C
>=3B context provides the three different me= thods a) file b) name and c) spec.
>=3B
>=3B a) \definefont[Te= st][file:texgyrepagellaregular]
>=3B b) \definefont[Test][name:texgy= repagellaregular]
>=3B c) \definefont[Test][spec:texgyrepagella-norm= al-normal]
>=3B
>=3B
>=3B Instead of a fixed size for the = font you can also use a relative size which depends on the bodyfont.
>= =3B
>=3B \definefont[Test][texgyrepagellaregular sa 1]
>=3B >=3B \starttext
>=3B \Test VA ffl \switchtobodyfont[20pt]\Test= VA ffl
>=3B \stoptext
>=3B
>=3B When you use =93sa XX=94= as argument for the size your font scales also when you change the bodyfon= t
>=3B in the middle of the document.
>=3B
>=3B
>=3B = One problem of the definitions above is that kerning=2C ligatures etc. aren= =92t activated for the font
>=3B because no feature isn=92t applied. T= o apply a feature set you have to use a different method than
>=3B the= one which is used in a typescript because \definefont has no feature-key. = What you have to
>=3B do to apply the set is to append it after the na= me name and separate both with a asterisks.
>=3B
>=3B \definef= ont[Test][texgyrepagellaregular*default sa 1]
>=3B
>=3B \start= text
>=3B \Test VA ffl
>=3B \stoptext
>=3B
>=3B >=3B Instead of the real name of a file you can also use a symbolic nam= e from a typescript.
>=3B
>=3B \definefont[Test][SansBold sa 1= ]
>=3B
>=3B \starttext
>=3B \Test VA ffl
>=3B \s= toptext
>=3B
>=3B In this example I used the bold version of the= sans style for my \Test font=2C in this case
>=3B you don=92t have to= add the name of a feature because it has been already set in the typescrip= t.
>=3B
>=3B
>=3B A complete example in a document could b= e look like this:
>=3B
>=3B \definetypeface[mainface][rm][specse= rif][Antykwa Poltawskiego]
>=3B \definetypeface[mainface][ss][specsans= ] [Iwona]
>=3B
>=3B \definefont[ChapterStyle][SansBold sa 3]
= >=3B
>=3B \setuphead[chapter][style=3DChapterStyle]
>=3B
&= gt=3B \setupbodyfont[mainface]
>=3B
>=3B \starttext
>=3B >=3B \chapter{Knuth}
>=3B
>=3B \input knuth
>=3B
&g= t=3B \stoptext
>=3B
>=3B
>=3B Wolfgang
>=3B _________= __________________________________________________________________________<= br>>=3B If your question is of interest to others as well=2C please add a= n entry to the Wiki!
>=3B
>=3B maillist : ntg-context@ntg.nl / h= ttp://www.ntg.nl/mailman/listinfo/ntg-context
>=3B webpage : http://w= ww.pragma-ade.nl / http://tex.aanhet.net
>=3B archive : http://foundr= y.supelec.fr/projects/contextrev/
>=3B wiki : http://contextgarden= .net
>=3B ____________________________________________________________= _______________________
= --_7819c4ae-0b4f-4cb1-a1fe-9d37a2fd7b1f_-- --===============1467636255== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1467636255==--