Re: [NTG-context] ``fallback in Typescript

2013-04-23 Thread Wolfgang Schuster

Am 23.04.2013 um 04:05 schrieb Tim Li timli2...@outlook.com:

 Thanks.  I am reading these codes.

That won’t help to understand what’s the meaning of these lines.

To demonstrate what these lines are for a wrote a small example.

\starttypescript[serif][palatino-clone]
  \definefontsynonym [Serif]   [file:texgyrepagellaregular] 
[features=default]
  \definefontsynonym [SerifItalic] [file:texgyrepagellaitalic]  
[features=default]
\stoptypescript

\starttypescript[sans][helvetica-clone]
  \definefontsynonym [Sans]   [file:texgyreherosregular] [features=default]
  \definefontsynonym [SansItalic] [file:texgyreherositalic]  [features=default]
\stoptypescript

\definetypeface[mainface][rm][serif][palatino-clone] [default]
\definetypeface[mainface][ss][sans] [helvetica-clone][default]

%\setupbodyfont[modern]
\setupbodyfont[mainface]

\starttext

\rm\tf Regular \it Italic \sl Slanted

\ss\tf Regular \it Italic \sl Slanted

\stoptext

When you put the code in a file and process you will notice that “\sl Slanted” 
always uses
the upright Pagella font, this happens because no font was set for this style 
in the typescripts
and a default font is used.

You prevent this unwanted result by adding additional \definefontsynonym lines 
to the
typescript where you say context to use the italic font for the slanted style.

\starttypescript[serif][palatino-clone]
  \definefontsynonym [Serif][file:texgyrepagellaregular] 
[features=default]
  \definefontsynonym [SerifItalic]  [file:texgyrepagellaitalic]  
[features=default]
  \definefontsynonym [SerifSlanted] [SerifItalic]
\stoptypescript

\starttypescript[sans][helvetica-clone]
  \definefontsynonym [Sans][file:texgyreherosregular] [features=default]
  \definefontsynonym [SansItalic]  [file:texgyreherositalic]  [features=default]
  \definefontsynonym [SansSlanted] [SansItalic]
\stoptypescript

Still this wouldn’t be enough when you want to use also the bold and bolditalic
styles for your font even more fallback definitions are needed. The complete
typescript for the serif font has to look now like this.

\starttypescript[serif][palatino-clone]
  \definefontsynonym [Serif][file:texgyrepagellaregular] 
[features=default]
  \definefontsynonym [SerifItalic]  [file:texgyrepagellaitalic]  
[features=default]
  \definefontsynonym [SerifSlanted] [SerifItalic]
  \definefontsynonym [SerifBold][Serif]
  \definefontsynonym [SerifBoldItalic]  [SerifBold]
  \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
  \definefontsynonym [SerifCaps][Serif]
\stoptypescript

Because such fallback definitions are needed for many font (especially the 
slanted
to italic mappings) you can predefined lists in type-fbk.mkiv which you can load
at the begin at your typescript to save a few lines and we can abbreviate the 
above
typescript in this form.

\starttypescript[serif][palatino-clone]
  \setups[font:fallback:serif]
  \definefontsynonym [Serif][file:texgyrepagellaregular] 
[features=default]
  \definefontsynonym [SerifItalic]  [file:texgyrepagellaitalic]  
[features=default]
\stoptypescript

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
___

Re: [NTG-context] ``fallback in Typescript

2013-04-23 Thread Tim Li
Wolfgang, many thanks to you, for your comprehensive explaination. After 
reading your mail, as a ConTeXt user, I think I can apply the `fallback' to my 
typescript definition well. Tim
 From: schuster.wolfg...@gmail.com
Date: Tue, 23 Apr 2013 09:28:15 +0200
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] ``fallback in Typescript


Am 23.04.2013 um 04:05 schrieb Tim Li timli2...@outlook.com:Thanks.  I am 
reading these codes.

That won’t help to understand what’s the meaning of these lines.
To demonstrate what these lines are for a wrote a small example.
\starttypescript[serif][palatino-clone]  \definefontsynonym [Serif]   
[file:texgyrepagellaregular] [features=default]  \definefontsynonym 
[SerifItalic] [file:texgyrepagellaitalic]  [features=default]\stoptypescript
\starttypescript[sans][helvetica-clone]  \definefontsynonym [Sans]   
[file:texgyreherosregular] [features=default]  \definefontsynonym [SansItalic] 
[file:texgyreherositalic]  [features=default]\stoptypescript
\definetypeface[mainface][rm][serif][palatino-clone] 
[default]\definetypeface[mainface][ss][sans] [helvetica-clone][default]
%\setupbodyfont[modern]\setupbodyfont[mainface]
\starttext
\rm\tf Regular \it Italic \sl Slanted
\ss\tf Regular \it Italic \sl Slanted
\stoptext
When you put the code in a file and process you will notice that “\sl Slanted” 
always usesthe upright Pagella font, this happens because no font was set for 
this style in the typescriptsand a default font is used.
You prevent this unwanted result by adding additional \definefontsynonym lines 
to thetypescript where you say context to use the italic font for the slanted 
style.
\starttypescript[serif][palatino-clone]  \definefontsynonym [Serif]
[file:texgyrepagellaregular] [features=default]  \definefontsynonym 
[SerifItalic]  [file:texgyrepagellaitalic]  [features=default]  
\definefontsynonym [SerifSlanted] [SerifItalic]\stoptypescript
\starttypescript[sans][helvetica-clone]  \definefontsynonym [Sans]
[file:texgyreherosregular] [features=default]  \definefontsynonym [SansItalic]  
[file:texgyreherositalic]  [features=default]  \definefontsynonym [SansSlanted] 
[SansItalic]\stoptypescript
Still this wouldn’t be enough when you want to use also the bold and 
bolditalicstyles for your font even more fallback definitions are needed. The 
completetypescript for the serif font has to look now like this.
\starttypescript[serif][palatino-clone]  \definefontsynonym [Serif]
[file:texgyrepagellaregular] [features=default]  \definefontsynonym 
[SerifItalic]  [file:texgyrepagellaitalic]  [features=default]  
\definefontsynonym [SerifSlanted] [SerifItalic]  \definefontsynonym 
[SerifBold][Serif]  \definefontsynonym [SerifBoldItalic]  [SerifBold]  
\definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]  \definefontsynonym 
[SerifCaps][Serif]\stoptypescript
Because such fallback definitions are needed for many font (especially the 
slantedto italic mappings) you can predefined lists in type-fbk.mkiv which you 
can loadat the begin at your typescript to save a few lines and we can 
abbreviate the abovetypescript in this form.
\starttypescript[serif][palatino-clone]  \setups[font:fallback:serif]  
\definefontsynonym [Serif][file:texgyrepagellaregular] 
[features=default]  \definefontsynonym [SerifItalic]  
[file:texgyrepagellaitalic]  [features=default]\stoptypescript
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
___
   ___
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
___

[NTG-context] ``fallback in Typescript

2013-04-22 Thread Tim Li
Hi, In the wiki, fallback often appears in the definition of typescript. I am 
curious about this ``fallback, is there a place to learn the fallback in 
detail? I haven't found this place in our wiki. Regards, Tim
  ___
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
___

Re: [NTG-context] ``fallback in Typescript

2013-04-22 Thread Philipp Gesang
Hi Tim,

···date: 2013-04-22, Monday···from: Tim Li···

 Hi, In the wiki, fallback often appears in the definition of
 typescript. I am curious about this ``fallback, is there a place
 to learn the fallback in detail? I haven't found this place in
 our wiki. Regards, Tim  

use the source, Luke:


http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/font-col.mkvi#l94

As the manual says:

  It really makes sense to take a look at the font and type
  definition files (font-*.tex and type-*.tex). There are
  fallbacks defined, as well as generic definitions. Studying
  styles and manual source code may also teach you a few tricks.

I assure you the effort is well worth it.

Best regards
Philipp


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpNoHGPwBiCP.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] ``fallback in Typescript

2013-04-22 Thread Hans Hagen

On 4/22/2013 8:11 PM, Philipp Gesang wrote:

Hi Tim,

···date: 2013-04-22, Monday···from: Tim Li···


Hi, In the wiki, fallback often appears in the definition of
typescript. I am curious about this ``fallback, is there a place
to learn the fallback in detail? I haven't found this place in
our wiki. Regards, Tim  


use the source, Luke:

 
http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/font-col.mkvi#l94


http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/type-fbk.mkiv



As the manual says:

   It really makes sense to take a look at the font and type
   definition files (font-*.tex and type-*.tex). There are
   fallbacks defined, as well as generic definitions. Studying
   styles and manual source code may also teach you a few tricks.

I assure you the effort is well worth it.

Best regards
Philipp




___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] ``fallback in Typescript

2013-04-22 Thread Tim Li
Thanks.  I am reading these codes. Tim
  Date: Mon, 22 Apr 2013 20:31:25 +0200
 From: pra...@wxs.nl
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] ``fallback in Typescript
 
 On 4/22/2013 8:11 PM, Philipp Gesang wrote:
  Hi Tim,
 
  ・・・date: 2013-04-22, Monday・・・from: Tim Li・・・
 
  Hi, In the wiki, fallback often appears in the definition of
  typescript. I am curious about this ``fallback, is there a place
  to learn the fallback in detail? I haven't found this place in
  our wiki. Regards, Tim 
 
  use the source, Luke:
 
   
  http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/font-col.mkvi#l94
 
 http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/type-fbk.mkiv
 
 
  As the manual says:
 
 It really makes sense to take a look at the font and type
 definition files (font-*.tex and type-*.tex). There are
 fallbacks defined, as well as generic definitions. Studying
 styles and manual source code may also teach you a few tricks.
 
  I assure you the effort is well worth it.
 
  Best regards
  Philipp
 
 
 
 
  ___
  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
  ___
 
 
 
 -- 
 
 -
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
   | www.pragma-pod.nl
 -
 ___
 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
 ___
  ___
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
___