Re: [NTG-context] Euler with fallback

2014-03-03 Thread Sanjoy Mahajan
Aditya Mahajan adit...@umich.edu writes:

 This is to announce that the latest beta supports creating virtual math 
 fonts with fallback. The main test case is to use Euler font with missing 
 characters taken from Pagella but the mechanism is general and can be used 
 to replace a specific set of math glyphs from a font.

 This feature is not extensively tested. As such it will be useful if 
 everyone interested in math fallback mechanism could test this out and 
 report any bugs or inconsistencies.

One inconsistency or maybe bug is that text subscripts come out in Euler
instead of Palatino.  

Here's an example (using 2014.02.14 beta).  The Sun subscript using
_{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII
setup, but is in Euler now.  The workaround of an hbox with \tfxx or
\tfx doesn't get quite the right size.

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\starttext

\placeformula\startformula
M_{\rm Sun}\quad M_{\hbox{\tfx Sun}} \quad M_{\hbox{\tfxx Sun}} \quad M_{\tf 
Sun}
\stopformula

\stoptext
___
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] Euler with fallback

2014-03-03 Thread Aditya Mahajan

On Mon, 3 Mar 2014, Sanjoy Mahajan wrote:


Aditya Mahajan adit...@umich.edu writes:


This is to announce that the latest beta supports creating virtual math
fonts with fallback. The main test case is to use Euler font with missing
characters taken from Pagella but the mechanism is general and can be used
to replace a specific set of math glyphs from a font.

This feature is not extensively tested. As such it will be useful if
everyone interested in math fallback mechanism could test this out and
report any bugs or inconsistencies.


One inconsistency or maybe bug is that text subscripts come out in Euler
instead of Palatino.

Here's an example (using 2014.02.14 beta).  The Sun subscript using
_{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII
setup, but is in Euler now.  The workaround of an hbox with \tfxx or
\tfx doesn't get quite the right size.


That is because in math mode, \rm is symonym with \mathrm etc. The 
standard way to write this is _{\text{Sun}}.


Aditya
___
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] Euler with fallback

2014-03-03 Thread Sanjoy Mahajan
Aditya,

 Here's an example (using 2014.02.14 beta).  The Sun subscript using
 _{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII
 setup, but is in Euler now.  The workaround of an hbox with \tfxx or
 \tfx doesn't get quite the right size.

 That is because in math mode, \rm is symonym with \mathrm etc. The 
 standard way to write this is _{\text{Sun}}.

I agree about \rm.  However, _{\tf blah} once (in MkII) selected the
text font.  e.g.

\starttext
\placeformula\startformula
M_{\tf Sun}
\stopformula
\stoptext

Is the II-IV change in \tf semantics intended?  It's not hard to adjust
for by using 'sed'.  I raise the issue only in case the change is not
intended.

Actually, the example just as above (i.e. using modern fonts) works fine
works in MkII and MkIV.  It also works if \setupbodyfont[palatino] is
inserted as the first line.

It's fails only when using Palatino with Euler (at least, in the way
that I did it).

That data doesn't say what the right behavior is.  But it may help you
decide.

-Sanjoy
___
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] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
Wolfgang,

Thank you for the preamble.  It works well standalone.

For some reason it doesn't work with components.  I think I've seen this
problem before but can't remember the resolution.  Here's a minimal
example (with 2014.02.14 beta).  The text comes out in Euler.  The same
happens putting the font setup in a project file and referring to it
with \project.

\startcomponent test

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface,10.5pt]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]


\input knuth

\stopcomponent
___
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] Euler with fallback

2014-02-17 Thread Wolfgang Schuster

Am 17.02.2014 um 15:12 schrieb Sanjoy Mahajan san...@olin.edu:

 Wolfgang,
 
 Thank you for the preamble.  It works well standalone.
 
 For some reason it doesn't work with components.  I think I've seen this
 problem before but can't remember the resolution.  Here's a minimal
 example (with 2014.02.14 beta).  The text comes out in Euler.  The same
 happens putting the font setup in a project file and referring to it
 with \project.

Put you font definitions before \startcomponent or better put them
in a environment file and load this file before \startcomponent.

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] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 Put your font definitions before \startcomponent or better put them
 in a environment file and load this file before \startcomponent.

Sorry, I should have said that I had tried that, but it has the same
problem (Euler font for everything).

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface,10.5pt]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\startcomponent test

\input knuth

\stopcomponent
___
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] Euler with fallback

2014-02-17 Thread Wolfgang Schuster

Am 17.02.2014 um 15:29 schrieb Sanjoy Mahajan san...@olin.edu:

 Put your font definitions before \startcomponent or better put them
 in a environment file and load this file before \startcomponent.
 
 Sorry, I should have said that I had tried that, but it has the same
 problem (Euler font for everything).

I can’t reproduce this, when I process your example the text is typeset with 
the pagella font.

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] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 I can’t reproduce this, when I process your example the text is
 typeset with the pagella font.

You are right.  I am not sure what I had done, but it works as you say.

I also put the font setup in an environment file that is loaded by
testproject.tex, and that also works.

  \project testproject
  \startcomponent test

  \input knuth

  \stopcomponent

Because of font loading, is this recommended way to use components
(rather than the old way of the \project line after \startcomponent)?
If so, I'll make a note on the wiki.

-Sanjoy
___
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] Euler with fallback

2014-02-17 Thread Aditya Mahajan

On Mon, 17 Feb 2014, Sanjoy Mahajan wrote:


 \project testproject
 \startcomponent test

 \input knuth

 \stopcomponent

Because of font loading, is this recommended way to use components
(rather than the old way of the \project line after \startcomponent)?
If so, I'll make a note on the wiki.


Yes. This is one of the changes from MkII to MkIV. I think that Hans had a 
This Way document on this.


Aditya
___
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] Euler with fallback

2014-02-17 Thread Wolfgang Schuster

Am 17.02.2014 um 21:07 schrieb Sanjoy Mahajan san...@olin.edu:

 I can’t reproduce this, when I process your example the text is
 typeset with the pagella font.
 
 You are right.  I am not sure what I had done, but it works as you say.
 
 I also put the font setup in an environment file that is loaded by
 testproject.tex, and that also works.
 
  \project testproject
  \startcomponent test
 
  \input knuth
 
  \stopcomponent
 
 Because of font loading, is this recommended way to use components
 (rather than the old way of the \project line after \startcomponent)?
 If so, I'll make a note on the wiki.

This does not only apply to component etc. but also to normal files because
context sets and resets some values with \starttext etc. and to avoid some
problems it’s better to put all setup commands before it.

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] Euler with fallback

2014-02-17 Thread Jeong Dal

 
 Am 17.02.2014 um 15:29 schrieb Sanjoy Mahajan san...@olin.edu:
 
 Put your font definitions before \startcomponent or better put them
 in a environment file and load this file before \startcomponent.
 
 Sorry, I should have said that I had tried that, but it has the same
 problem (Euler font for everything).
 
 I can?t reproduce this, when I process your example the text is typeset with 
 the pagella font.
 
 Wolfgang

I run the sample code and got the correct output( patella for text and euler 
for math).
My ConTeXt version is 

ConTeXt  ver: 2013.12.20 23:45 MKIV beta  fmt: 2013.12.22  int: english/english

best regards,

Dalyoung
___
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] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 Because of font loading, is this recommended way to use components
 (rather than the old way of the \project line after \startcomponent)?
 If so, I'll make a note on the wiki.

 This does not only apply to component etc. but also to normal files because
 context sets and resets some values with \starttext etc. and to avoid some
 problems it’s better to put all setup commands before it.

Agreed.  The wiki page for Project Structure has always shown setups
(via \project ... ) going after the \startcomponent or \startproduct.
I've edited the examples to have setups before the
\start(product|component).  If I did it wrong, let me know.

-Sanjoy
___
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] Euler with fallback

2014-02-16 Thread Sanjoy Mahajan
Aditya Mahajan adit...@umich.edu writes:

 This is to announce that the latest beta supports creating virtual math 
 fonts with fallback. The main test case is to use Euler font with missing 
 characters taken from Pagella but the mechanism is general and can be used 
 to replace a specific set of math glyphs from a font.

 This feature is not extensively tested. As such it will be useful if 
 everyone interested in math fallback mechanism could test this out and 
 report any bugs or inconsistencies.

I would like to test and hopefully use this setup for _Street-Fighting
Science and Engineering_.  It should also give the setup a thorough
workout.  But I can't quite get the preamble right.

The test file below typesets text and math in palatino.

  \usetypescriptfile[euler-with-pagella]
  \definebodyfontenvironment[10.5pt]
  \setupbodyfont[palatino,10.5pt]

  \starttext

  \input knuth

  \placeformula\startformula
  a^2 + b^2 = c^2.
  \stopformula

  \stoptext

If I add

  \appendtoks \rm \to \everymathematics
  \setupmathematics[lcgreek=normal, ucgreek=normal]

just before \starttext, the math is typeset in roman pagella.

What am I doing silly?

Also, one of my reservations about using Euler for math, which readers
complained about in _Street-Fighting Mathematics_, is that v and \nu
(kinematic viscosity) look so similar.  Do you know any way to make them
more distinguishable, e.g. by substituting a different character?

-Sanjoy


 To use this feature you have to use `pagellaovereuler` as your math font. 
 For example, to use Euler with DejaVu fonts, use:


 \usetypescriptfile[euler]
 \starttypescript[mainface]
   \definetypeface[mainface][rm][serif][dejavu]  [default]
   \definetypeface[mainface][ss][sans] [dejavu]  [default]
   \definetypeface[mainface][tt][mono] [dejavu]  [default]
   \definetypeface[mainface][mm][math] [pagellaovereuler][default]
 \stoptypescript

 \setupbodyfont[mainface]

 \appendtoks \rm \to \everymathematics
 \setupmathematics
 [lcgreek=normal, ucgreek=normal]


 There is a built-in typescript `euler-with-pagella` to use 
 `pagellaovereuler` as the math font and `pagella` as the text font.
___
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] Euler with fallback

2014-02-16 Thread Wolfgang Schuster

Am 16.02.2014 um 17:51 schrieb Sanjoy Mahajan san...@olin.edu:

 Aditya Mahajan adit...@umich.edu writes:
 
 This is to announce that the latest beta supports creating virtual math 
 fonts with fallback. The main test case is to use Euler font with missing 
 characters taken from Pagella but the mechanism is general and can be used 
 to replace a specific set of math glyphs from a font.
 
 This feature is not extensively tested. As such it will be useful if 
 everyone interested in math fallback mechanism could test this out and 
 report any bugs or inconsistencies.
 
 I would like to test and hopefully use this setup for _Street-Fighting
 Science and Engineering_.  It should also give the setup a thorough
 workout.  But I can't quite get the preamble right.
 
 The test file below typesets text and math in palatino.
 
  \usetypescriptfile[euler-with-pagella]

You have to load the typescript file for euler.

  \definebodyfontenvironment[10.5pt]
  \setupbodyfont[palatino,10.5pt]

When you use the palatino typeface context uses only the pagella math fonts.

To use palatino as text font and euler for math you have to create your own 
typeface collection:

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default] 
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface,10.5pt]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\starttext

\input knuth

\startplaceformula
  \startformula
a^2 + b^2 = c^2.
  \stopformula
\stopplaceformula

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


[NTG-context] Euler with fallback

2013-08-10 Thread Aditya Mahajan

Hi all,

This is to announce that the latest beta supports creating virtual math 
fonts with fallback. The main test case is to use Euler font with missing 
characters taken from Pagella but the mechanism is general and can be used 
to replace a specific set of math glyphs from a font.


This feature is not extensively tested. As such it will be useful if 
everyone interested in math fallback mechanism could test this out and 
report any bugs or inconsistencies.


To use this feature you have to use `pagellaovereuler` as your math font. 
For example, to use Euler with DejaVu fonts, use:



\usetypescriptfile[euler]
\starttypescript[mainface]
\definetypeface[mainface][rm][serif][dejavu]  [default]
\definetypeface[mainface][ss][sans] [dejavu]  [default]
\definetypeface[mainface][tt][mono] [dejavu]  [default]
\definetypeface[mainface][mm][math] [pagellaovereuler][default]
\stoptypescript

\setupbodyfont[mainface]

\appendtoks \rm \to \everymathematics
\setupmathematics
   [lcgreek=normal, ucgreek=normal]


There is a built-in typescript `euler-with-pagella` to use 
`pagellaovereuler` as the math font and `pagella` as the text font.


If you are interested in implementing similar fallback mechanisms for 
other fonts, see type-imp-euler.mkiv and euler-math.lfg for details.


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