ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Font switching question
@ 2009-05-11 12:08 Yue Wang
  2009-05-11 14:38 ` Yue Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Yue Wang @ 2009-05-11 12:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi, Hans:

I am working on Chinese support on XeTeX/ConTeXt and I almost finished
that. I will later upload a module called t-zhspacing to the garden
(or CTAN?). But there is one last problem. Let me explain like this.

Suppost I have two typescripts (typeA and typeB) and both with
complete typeface defined (rm/ss/tt, bf/it/bfit/smcp....)

Now I want to do something like this:

\usetypescript[typeA]
\usetypescript[typeB]
\setupbodyfont[typeA]
This should be typeA/rm/normal \it and this should be typeA/rm/it \ss
and this should be typeA/ss/it %here everything is ok in context
\typeB this should be typeB/ss/it %(but context gives me
typeB/rm/normal. How can I automatically get what I want?)

Yue Wang
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Font switching question
  2009-05-11 12:08 Font switching question Yue Wang
@ 2009-05-11 14:38 ` Yue Wang
  2009-05-11 15:23   ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Yue Wang @ 2009-05-11 14:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans:

let me give a better explanation.

we define a typescript foobar. so we can call  \foobar to load the
foobar typeface.
then we should define a macro like this:
\def\switchtofoobar{\savecurrentstyle\foobar\getcurrentstyle}
and call it like that:

text 1 {\swichtofoobar text2} text 3
when \savecurrentstyle is called, it define a macro named
\getcurrentstyle in order to save the style of text 1 (like \ss\it,
10pt) into that. that's all we want.

So it's not complicated to do so as font fallback.
(we already done that in latex, but don't know how to do that in
ConTeXt due to lack of knowledge of font mechanism)

Yue Wang

On Mon, May 11, 2009 at 8:08 PM, Yue Wang <yuleopen@gmail.com> wrote:
> Hi, Hans:
>
> I am working on Chinese support on XeTeX/ConTeXt and I almost finished
> that. I will later upload a module called t-zhspacing to the garden
> (or CTAN?). But there is one last problem. Let me explain like this.
>
> Suppost I have two typescripts (typeA and typeB) and both with
> complete typeface defined (rm/ss/tt, bf/it/bfit/smcp....)
>
> Now I want to do something like this:
>
> \usetypescript[typeA]
> \usetypescript[typeB]
> \setupbodyfont[typeA]
> This should be typeA/rm/normal \it and this should be typeA/rm/it \ss
> and this should be typeA/ss/it %here everything is ok in context
> \typeB this should be typeB/ss/it %(but context gives me
> typeB/rm/normal. How can I automatically get what I want?)
>
> Yue Wang
>
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Font switching question
  2009-05-11 14:38 ` Yue Wang
@ 2009-05-11 15:23   ` Wolfgang Schuster
  2009-05-11 16:26     ` Yue Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2009-05-11 15:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.05.2009 um 16:38 schrieb Yue Wang:

> Hi Hans:
>
> let me give a better explanation.
>
> we define a typescript foobar. so we can call  \foobar to load the
> foobar typeface.
> then we should define a macro like this:
> \def\switchtofoobar{\savecurrentstyle\foobar\getcurrentstyle}
> and call it like that:
>
> text 1 {\swichtofoobar text2} text 3
> when \savecurrentstyle is called, it define a macro named
> \getcurrentstyle in order to save the style of text 1 (like \ss\it,
> 10pt) into that. that's all we want.

 From font-ini.mkii (\push/\popcurrentfont):

% \definetypeface[one][rm][serif][computer-roman][default]
% \definetypeface[two][rm][serif][computer-roman][default][rscale=.9]
%
% {\one \bf test \two test}
% {\one \bf test \pushcurrentfont \two \popcurrentfont test}

there are more helper macros like \savefont and \restorefont

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Font switching question
  2009-05-11 15:23   ` Wolfgang Schuster
@ 2009-05-11 16:26     ` Yue Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Yue Wang @ 2009-05-11 16:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, May 11, 2009 at 11:23 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 11.05.2009 um 16:38 schrieb Yue Wang:
>
>> Hi Hans:
>>
>> let me give a better explanation.
>>
>> we define a typescript foobar. so we can call  \foobar to load the
>> foobar typeface.
>> then we should define a macro like this:
>> \def\switchtofoobar{\savecurrentstyle\foobar\getcurrentstyle}
>> and call it like that:
>>
>> text 1 {\swichtofoobar text2} text 3
>> when \savecurrentstyle is called, it define a macro named
>> \getcurrentstyle in order to save the style of text 1 (like \ss\it,
>> 10pt) into that. that's all we want.
>
> From font-ini.mkii (\push/\popcurrentfont):
>
> % \definetypeface[one][rm][serif][computer-roman][default]
> % \definetypeface[two][rm][serif][computer-roman][default][rscale=.9]
> %
> % {\one \bf test \two test}
> % {\one \bf test \pushcurrentfont \two \popcurrentfont test}
>
> there are more helper macros like \savefont and \restorefont


Thank you very much, Wolfgang!


>
> 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  : https://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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2009-05-11 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-11 12:08 Font switching question Yue Wang
2009-05-11 14:38 ` Yue Wang
2009-05-11 15:23   ` Wolfgang Schuster
2009-05-11 16:26     ` Yue Wang

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