ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ``fallback" in Typescript
@ 2013-04-22 17:48 Tim Li
  2013-04-22 18:11 ` Philipp Gesang
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Li @ 2013-04-22 17:48 UTC (permalink / raw)
  To: ntg-context


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

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 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 731 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: ``fallback" in Typescript
  2013-04-22 17:48 ``fallback" in Typescript Tim Li
@ 2013-04-22 18:11 ` Philipp Gesang
  2013-04-22 18:31   ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Philipp Gesang @ 2013-04-22 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 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: ``fallback" in Typescript
  2013-04-22 18:11 ` Philipp Gesang
@ 2013-04-22 18:31   ` Hans Hagen
  2013-04-23  2:05     ` Tim Li
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2013-04-22 18:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: ``fallback" in Typescript
  2013-04-22 18:31   ` Hans Hagen
@ 2013-04-23  2:05     ` Tim Li
  2013-04-23  7:28       ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Li @ 2013-04-23  2:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thanks.  I am reading these codes. Tim
 > Date: Mon, 22 Apr 2013 20:31:25 +0200
> From: pragma@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
> ___________________________________________________________________________________
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 3503 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: ``fallback" in Typescript
  2013-04-23  2:05     ` Tim Li
@ 2013-04-23  7:28       ` Wolfgang Schuster
  2013-04-23  9:06         ` Tim Li
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-04-23  7:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 23.04.2013 um 04:05 schrieb Tim Li <timli2013@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

[-- Attachment #1.2: Type: text/html, Size: 5112 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: ``fallback" in Typescript
  2013-04-23  7:28       ` Wolfgang Schuster
@ 2013-04-23  9:06         ` Tim Li
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Li @ 2013-04-23  9:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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.wolfgang@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 <timli2013@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
___________________________________________________________________________________ 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 6099 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

end of thread, other threads:[~2013-04-23  9:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 17:48 ``fallback" in Typescript Tim Li
2013-04-22 18:11 ` Philipp Gesang
2013-04-22 18:31   ` Hans Hagen
2013-04-23  2:05     ` Tim Li
2013-04-23  7:28       ` Wolfgang Schuster
2013-04-23  9:06         ` Tim Li

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