ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Using stylistic sets in math
@ 2010-07-15 19:24 Khaled Hosny
  2010-07-15 19:45 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Khaled Hosny @ 2010-07-15 19:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

In XITS I have stylistic sets (ss01-07) for accessing additional
alphabets not bresent in Unicode, or variants of exising ones.

For example, ss01 maps the script alphabets to an alternate calligraphic
one, so I did:

\starttext
\setupbodyfont[xits]
\ctxlua{fonts.otf.features.register_base_substitution('ss01')}
\definefontfeature[ss01][mode=base,script=math,ss01=yes]
$\addff{ss01}\cal ABCDEFG$
\stoptext

(I was not expecting \addff to work in math, but anyway).

This works, however, but I don't want to set the feature globally:

\starttext
\ctxlua{fonts.otf.features.register_base_substitution('ss01')}
\definefontfeature[math-text][mode=base,script=math,ss01=yes]
\setupbodyfont[xits]
$\cal ABCDEF$
\stoptext

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___________________________________________________________________________________
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: Using stylistic sets in math
  2010-07-15 19:24 Using stylistic sets in math Khaled Hosny
@ 2010-07-15 19:45 ` Hans Hagen
  2010-07-17  3:49   ` Khaled Hosny
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2010-07-15 19:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 15-7-2010 9:24, Khaled Hosny wrote:
> In XITS I have stylistic sets (ss01-07) for accessing additional
> alphabets not bresent in Unicode, or variants of exising ones.
>
> For example, ss01 maps the script alphabets to an alternate calligraphic
> one, so I did:
>
> \starttext
> \setupbodyfont[xits]
> \ctxlua{fonts.otf.features.register_base_substitution('ss01')}
> \definefontfeature[ss01][mode=base,script=math,ss01=yes]
> $\addff{ss01}\cal ABCDEFG$
> \stoptext
>
> (I was not expecting \addff to work in math, but anyway).
>
> This works, however, but I don't want to set the feature globally:
>
> \starttext
> \ctxlua{fonts.otf.features.register_base_substitution('ss01')}
> \definefontfeature[math-text][mode=base,script=math,ss01=yes]
> \setupbodyfont[xits]
> $\cal ABCDEF$
> \stoptext

math currently operates in base mode; what i can do is map it onto some 
private range; as the number of math fonts is small it's no big deal to 
keep either a list of features that provide this; we'd best cook up such 
a list in small committee

also, context does math different than e.g. latex so having the glyphs 
in some well defined spot helps macro packages

actually, since there are probably more symbols not in unicode, i think 
that we need to define some extensions ourselves in the private use 
area.

so, to start with you need some 7 alphabets of 26 chars ? do you think 
that there will be more? for instance we can reserve 0xFE700-0xFE8FF

0xFE700  ss01
0xFE720  ss02
0xFE740  ss03
0xFE760  ss04
0xFE780  ss05
0xFE7A0  ss06
0xFE7C0  ss07

or we could even move to a much lower range (taco might know a good 
one); it does not matter much as we can define an offset

@aditya & mojca: didn't we have some pending symbols as well? I do use 
some slots for some lm left-overs but there might be more.

Hans

-----------------------------------------------------------------
                                           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: Using stylistic sets in math
  2010-07-15 19:45 ` Hans Hagen
@ 2010-07-17  3:49   ` Khaled Hosny
  2010-07-17  5:43     ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Khaled Hosny @ 2010-07-17  3:49 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Thu, Jul 15, 2010 at 09:45:57PM +0200, Hans Hagen wrote:
> On 15-7-2010 9:24, Khaled Hosny wrote:
> >In XITS I have stylistic sets (ss01-07) for accessing additional
> >alphabets not bresent in Unicode, or variants of exising ones.
> >
> >For example, ss01 maps the script alphabets to an alternate calligraphic
> >one, so I did:
> >
> >\starttext
> >\setupbodyfont[xits]
> >\ctxlua{fonts.otf.features.register_base_substitution('ss01')}
> >\definefontfeature[ss01][mode=base,script=math,ss01=yes]
> >$\addff{ss01}\cal ABCDEFG$
> >\stoptext
> >
> >(I was not expecting \addff to work in math, but anyway).
> >
> >This works, however, but I don't want to set the feature globally:
> >
> >\starttext
> >\ctxlua{fonts.otf.features.register_base_substitution('ss01')}
> >\definefontfeature[math-text][mode=base,script=math,ss01=yes]
> >\setupbodyfont[xits]
> >$\cal ABCDEF$
> >\stoptext
> 
> math currently operates in base mode; what i can do is map it onto
> some private range; as the number of math fonts is small it's no big
> deal to keep either a list of features that provide this; we'd best
> cook up such a list in small committee
> 
> also, context does math different than e.g. latex so having the
> glyphs in some well defined spot helps macro packages
> 
> actually, since there are probably more symbols not in unicode, i
> think that we need to define some extensions ourselves in the
> private use area.

I'm not a big fan of private use area myself, it just makes things more
unportable. The approach I used is mapping the new characters to the
closest matching existing ones, so calligraphic is mapped to script,
sans serif Greek is mapped to serif and so on. What I want is a way to
use different font for specific parts in the equation, for example a
\mathaltcal or \mathsfbfgreek etc that could have a different feature
than the main math font.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___________________________________________________________________________________
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: Using stylistic sets in math
  2010-07-17  3:49   ` Khaled Hosny
@ 2010-07-17  5:43     ` Taco Hoekwater
  2010-07-17  5:56       ` Khaled Hosny
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2010-07-17  5:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 07/17/2010 05:49 AM, Khaled Hosny wrote:
>
> I'm not a big fan of private use area myself, it just makes things more
> unportable. The approach I used is mapping the new characters to the
> closest matching existing ones, so calligraphic is mapped to script,
> sans serif Greek is mapped to serif and so on. What I want is a way to
> use different font for specific parts in the equation, for example a
> \mathaltcal or \mathsfbfgreek etc that could have a different feature
> than the main math font.

You could use stylistic alternate sets, it should be easy to support
those in context (it may even work out of the box).

Best wishes,
Taco
___________________________________________________________________________________
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: Using stylistic sets in math
  2010-07-17  5:43     ` Taco Hoekwater
@ 2010-07-17  5:56       ` Khaled Hosny
  2010-07-17  6:07         ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Khaled Hosny @ 2010-07-17  5:56 UTC (permalink / raw)
  To: Taco Hoekwater; +Cc: mailing list for ConTeXt users, Hans Hagen

On Sat, Jul 17, 2010 at 07:43:46AM +0200, Taco Hoekwater wrote:
> On 07/17/2010 05:49 AM, Khaled Hosny wrote:
> >
> >I'm not a big fan of private use area myself, it just makes things more
> >unportable. The approach I used is mapping the new characters to the
> >closest matching existing ones, so calligraphic is mapped to script,
> >sans serif Greek is mapped to serif and so on. What I want is a way to
> >use different font for specific parts in the equation, for example a
> >\mathaltcal or \mathsfbfgreek etc that could have a different feature
> >than the main math font.
> 
> You could use stylistic alternate sets, it should be easy to support
> those in context (it may even work out of the box).

With which feature tag?

Stylistic set (ss01-ss20) already work, but I can only enable it for
formula wide, I just don't know how to define a new font in math mode.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___________________________________________________________________________________
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: Using stylistic sets in math
  2010-07-17  5:56       ` Khaled Hosny
@ 2010-07-17  6:07         ` Taco Hoekwater
  0 siblings, 0 replies; 6+ messages in thread
From: Taco Hoekwater @ 2010-07-17  6:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 07/17/2010 07:56 AM, Khaled Hosny wrote:
> On Sat, Jul 17, 2010 at 07:43:46AM +0200, Taco Hoekwater wrote:
>> On 07/17/2010 05:49 AM, Khaled Hosny wrote:
>>>
>>> I'm not a big fan of private use area myself, it just makes things more
>>> unportable. The approach I used is mapping the new characters to the
>>> closest matching existing ones, so calligraphic is mapped to script,
>>> sans serif Greek is mapped to serif and so on. What I want is a way to
>>> use different font for specific parts in the equation, for example a
>>> \mathaltcal or \mathsfbfgreek etc that could have a different feature
>>> than the main math font.
>>
>> You could use stylistic alternate sets, it should be easy to support
>> those in context (it may even work out of the box).
>
> With which feature tag?
>
> Stylistic set (ss01-ss20) already work, but I can only enable it for
> formula wide, I just don't know how to define a new font in math mode.

You just have to set them up, then the \mathaltcal macro becomes
something like:

   \def\mathaltcal#1{\addff{ss09}#1\subff{ss09}}

Best wishes,
Taco
___________________________________________________________________________________
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:[~2010-07-17  6:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15 19:24 Using stylistic sets in math Khaled Hosny
2010-07-15 19:45 ` Hans Hagen
2010-07-17  3:49   ` Khaled Hosny
2010-07-17  5:43     ` Taco Hoekwater
2010-07-17  5:56       ` Khaled Hosny
2010-07-17  6:07         ` Taco Hoekwater

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