ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* fonts in embedded tex in embedded metapost in context
@ 2000-12-08 16:37 Denis B. Roegel
  2000-12-08 19:14 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Denis B. Roegel @ 2000-12-08 16:37 UTC (permalink / raw)
  Cc: Denis B. Roegel

Ok, I now have some questions about fonts.
I guess they are most fairly easy:

1) First, how do I select the `Sans' font?
I have done

\setupbodyfont[cmr]
\Sans

but it doesn't work.

2) In embedded metapost, I have things like

  ... btex text $E=MC^2$ etex ...

I want the `text' to be in \Sans, but I don't want
to specify this all the time. So, I am looking for

\startMPinclusions
verbatimtex
%\Sans  ???
etex
...
\stopMPinclusions

What am I supposed to do?

Some of the labels are in ISO-Latin 1 encoding. How do I select this?

  ... btex ISO-Latin 1 text etex ...

Thanks,

Denis


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

* Re: fonts in embedded tex in embedded metapost in context
  2000-12-08 16:37 fonts in embedded tex in embedded metapost in context Denis B. Roegel
@ 2000-12-08 19:14 ` Hans Hagen
  2000-12-08 21:34   ` Denis B. Roegel
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2000-12-08 19:14 UTC (permalink / raw)
  Cc: ntg-context, Denis B. Roegel

At 05:37 PM 12/8/00 +0100, Denis B. Roegel wrote:
>Ok, I now have some questions about fonts.
>I guess they are most fairly easy:
>
>1) First, how do I select the `Sans' font?
>I have done
>
>\setupbodyfont[cmr]
>\Sans

\setupbodyfont[cmr,sansserif]

or (since cmr is already active) 

\ss 

keep in mind: \setupbodyfont changes the document fonts too, local changes
are \switchtobodyfont, which leaves the headers and footers untouched. 

>but it doesn't work.
>
>2) In embedded metapost, I have things like
>
>  ... btex text $E=MC^2$ etex ...
>
>I want the `text' to be in \Sans, but I don't want
>to specify this all the time. So, I am looking for
>
>\startMPinclusions
>verbatimtex
>%\Sans  ???
>etex
>...
>\stopMPinclusions

Given that sans is supported in math -) 

\startMPenvironment 
  whatever you like to be setup
\stopMPenvironment 

This wil be passes to the tex run done by mp. 

>What am I supposed to do?
>
>Some of the labels are in ISO-Latin 1 encoding. How do I select this?
>
>  ... btex ISO-Latin 1 text etex ...

\enableencoding [il1]

Although this depends on the font too of course. Basically, anything that
can be done in context, can be done in metapost, even \framed{text} works,
although mp does better framing. 

You can experiment with this using 

\starttext 

\startMPenvironment 
   ....
\stopMPenvironment

\startMPpage
  mp code 
\stopMPpage 

\stoptext 
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: fonts in embedded tex in embedded metapost in context
  2000-12-08 19:14 ` Hans Hagen
@ 2000-12-08 21:34   ` Denis B. Roegel
  2000-12-11  0:15     ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Denis B. Roegel @ 2000-12-08 21:34 UTC (permalink / raw)
  Cc: Denis B. Roegel, ntg-context, Denis B. Roegel

`Hans Hagen' wrote
>   

>   >Some of the labels are in ISO-Latin 1 encoding. How do I select this?
>   >
>   >  ... btex ISO-Latin 1 text etex ...
>   
>   \enableencoding [il1]

I tried

\starttext
\startMPenvironment 
\ss
\enableencoding [il1]
\stopMPenvironment 
\startuseMPgraphic{test}
label(btex élève etex,origin);
\stopuseMPgraphic
\useMPgraphic{test}
\stoptext

and it doesn't display ``é'' and ``è''.

When I look at the mpx file, I see

begingroup save _p,_r,_s,_n; picture _p; _p=nullpicture;
string _n[];
vardef _s(expr _t,_f,_m,_x,_y)=
  addto _p also _t infont _f scaled _m shifted (_x,_y); enddef;
_n0="cmss12";
_s("lve",_n0,1.00000,0.0000,0.0000);
setbounds _p to (0,0.0000)--(13.3110,0.0000)--
 (13.3110,8.3022)--(0,8.3022)--cycle;
_p endgroup
mpxbreak

so presumably, the problem is cmss12.

Can you explain how ``é'' is handled? In LaTeX, 
é becomes \'e (with the input encoding latin1) and
this is translated into some position in the font,
or some combination of characters. With cmss12, LaTeX
would map \'e to some \accent combination.

What is the context position on this matter?

Denis


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

* Re: fonts in embedded tex in embedded metapost in context
  2000-12-08 21:34   ` Denis B. Roegel
@ 2000-12-11  0:15     ` Hans Hagen
  2000-12-11 20:30       ` Denis B. Roegel
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2000-12-11  0:15 UTC (permalink / raw)
  Cc: ntg-context, Denis B. Roegel

At 10:34 PM 12/8/00 +0100, Denis B. Roegel wrote:

>\starttext
>\startMPenvironment 
>\ss
>\enableencoding [il1]
>\stopMPenvironment 
>\startuseMPgraphic{test}
>label(btex élève etex,origin);
>\stopuseMPgraphic
>\useMPgraphic{test}
>\stoptext
>
>and it doesn't display ``é'' and ``è''.
>
>When I look at the mpx file, I see
>
>begingroup save _p,_r,_s,_n; picture _p; _p=nullpicture;
>string _n[];
>vardef _s(expr _t,_f,_m,_x,_y)=
>  addto _p also _t infont _f scaled _m shifted (_x,_y); enddef;
>_n0="cmss12";
>_s("lve",_n0,1.00000,0.0000,0.0000);
>setbounds _p to (0,0.0000)--(13.3110,0.0000)--
> (13.3110,8.3022)--(0,8.3022)--cycle;
>_p endgroup
>mpxbreak
>
>so presumably, the problem is cmss12.
>
>Can you explain how ``é'' is handled? In LaTeX, 
>é becomes \'e (with the input encoding latin1) and
>this is translated into some position in the font,
>or some combination of characters. With cmss12, LaTeX
>would map \'e to some \accent combination.
>
>What is the context position on this matter?

\'e is mapped onto a glyph when present, or composed, like in cmr when not

the same goes for é but here it can either be a direct mapping on a glyph
or an active character expanding into \'e and thereby mapped onto a glyph
or composed char

so anything can be the case: 

\command char => accented glyph
\command char => accent + glyph
char          => accented glyph [with same code]
active char   => accented glyph
active char   => accent + glyph

the 

\command char mapping is called an encoding
direct mapping is just direct mapping
active char mapping is called a regime 

[there is also unicode mapping with intermediate remapping as well as pdf
remapping at the output level] 

So, when you need for cmr, since there are no direct glyphs, is either \'e
or a regime that makes the il1 chars into active chars and maps them. 

You may try: 

\enableregime[win] 
\enableregime[ibm] 

or whatever matches il1, else we need to make one. [see enco-win for an
example]

A regime is enabled in the document and an encoding is either enables in
the document or assiciated with a font file name. 

Ah, and there are also special character sequences [grep for
languagespecifics] which map for instance "e onto \"e onto
glyph/accent+char. This is for instance used in germany.   

So, the machinery [and in many cases the fuel too] is there.  

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: fonts in embedded tex in embedded metapost in context
  2000-12-11  0:15     ` Hans Hagen
@ 2000-12-11 20:30       ` Denis B. Roegel
  2000-12-12 17:26         ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Denis B. Roegel @ 2000-12-11 20:30 UTC (permalink / raw)
  Cc: Denis B. Roegel, ntg-context, Denis B. Roegel

`Hans Hagen' wrote

>   So, when you need for cmr, since there are no direct glyphs, is either \'e
>   or a regime that makes the il1 chars into active chars and maps them. 
>   
>   You may try: 
>   
>   \enableregime[win] 
>   \enableregime[ibm] 
>   
>   or whatever matches il1, else we need to make one. [see enco-win for an
>   example]
>   

None of these two lines works on

\starttext
\startMPenvironment 
\ss
\enableencoding [il1]
\enableregime[win] 
%\enableregime[ibm] 
\stopMPenvironment 
\startuseMPgraphic{test}
label(btex élève etex,origin);
\stopuseMPgraphic
\useMPgraphic{test}
\stoptext

Presumably, the regime is similar to a mapping function
(I checked the enco* files).
What I would like to know is what regime I am supposed to use
in the following cases:

  - input in il1 and cmr10 font
  - input in il1 and ecrm1000 font
  - normal 7 bit input (such as \'e) and cmr10 font
  - normal 7 bit input (such as \'e) and ecrm1000 font

Also, \enableencoding [il1] is not clear to me. What does it do?
Does it merely make a bunch of characters active?

Denis


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

* Re: fonts in embedded tex in embedded metapost in context
  2000-12-11 20:30       ` Denis B. Roegel
@ 2000-12-12 17:26         ` Hans Hagen
  2000-12-28  3:11           ` another question on regimes and encoding Denis B. Roegel
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2000-12-12 17:26 UTC (permalink / raw)
  Cc: ntg-context, Denis B. Roegel

At 09:30 PM 12/11/00 +0100, Denis B. Roegel wrote:

>Presumably, the regime is similar to a mapping function

No, an encoding maps input or commands to a font char, a mapping takes care
of upper/lowercase handling, and a regime is a input char translation thing. 

>(I checked the enco* files).
>What I would like to know is what regime I am supposed to use
>in the following cases:
>
>  - input in il1 and cmr10 font

a regime, like [latin1] which will go into enco-lat but is not yet defined

>  - input in il1 and ecrm1000 font

an encoding, this time [ec]

>  - normal 7 bit input (such as \'e) and cmr10 font

nothing, works by default

>  - normal 7 bit input (such as \'e) and ecrm1000 font

in this case, we need font-ecr i suppose, something like font-csr and
font-plr, this time with an il1 spec, or in tex world terms
encoding=ec

>Also, \enableencoding [il1] is not clear to me. What does it do?
>Does it merely make a bunch of characters active?

no, there is no il1, it's [ec]

You may make me a [latin1] regime fo you want. 

imagine the steps for cmr: 

  composed(e,") -> regime[latin1] -> \"e -> composed tex char  
  \"e                                    -> composed tex char

and for ecmr

  composed(e,") -> encoding as triggered by font -> composed(e,")
  \"e           -> idem                          -> composed(e,")

[there is btw an aer font file that may suit your needs]

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* another question on regimes and encoding
  2000-12-12 17:26         ` Hans Hagen
@ 2000-12-28  3:11           ` Denis B. Roegel
  2000-12-28 17:12             ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Denis B. Roegel @ 2000-12-28  3:11 UTC (permalink / raw)
  Cc: ntg-context, Denis B. Roegel

That's a late reply to your message of December 12.

`Hans Hagen' wrote
>   
...
>   imagine the steps for cmr: 
>   
>     composed(e,") -> regime[latin1] -> \"e -> composed tex char  
>     \"e                                    -> composed tex char
>   
>   and for ecmr
>   
>     composed(e,") -> encoding as triggered by font -> composed(e,")
>     \"e           -> idem                          -> composed(e,")

One more question: if I wanted ``ë'' to be mapped on ``é'' in ecrm1000,
I would presumably

\enableencoding[ec]      since I am using ecrm1000

\enableregime[mystrangeregime]

  (where enco-mystrangeregime.tex would contain

        \defineactivecharacter ë {\'e}
  )

Is that right?

Thanks,

Denis


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

* Re: another question on regimes and encoding
  2000-12-28  3:11           ` another question on regimes and encoding Denis B. Roegel
@ 2000-12-28 17:12             ` Hans Hagen
  2000-12-28 23:24               ` Denis B. Roegel
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2000-12-28 17:12 UTC (permalink / raw)
  Cc: ntg-context, Denis B. Roegel

At 04:11 AM 12/28/00 +0100, Denis B. Roegel wrote:
>That's a late reply to your message of December 12.
>
>`Hans Hagen' wrote
>>   
>...
>>   imagine the steps for cmr: 
>>   
>>     composed(e,") -> regime[latin1] -> \"e -> composed tex char  
>>     \"e                                    -> composed tex char
>>   
>>   and for ecmr
>>   
>>     composed(e,") -> encoding as triggered by font -> composed(e,")
>>     \"e           -> idem                          -> composed(e,")
>
>One more question: if I wanted ``ë'' to be mapped on ``é'' in ecrm1000,
>I would presumably
>
>\enableencoding[ec]      since I am using ecrm1000
>
>\enableregime[mystrangeregime]
>
>  (where enco-mystrangeregime.tex would contain
>
>        \defineactivecharacter ë {\'e}
>  )
>
>Is that right?

Right. Like enco-win, enco-ibm and enco-lat. 

But, if you can wait for a few more days, it's there for you. I'm currently
redefining some encoding vectors so that we can more easilly remap to
unicode which is needed for pdf resources [especially for our central
european friends].

The endings will now look like: 

\startencoding [ec]

\definecharacter eacute 234

\stopencoding 

and in this case \startencoding [ec][ec] will also produce the regime codes.

It means that inside context \eacute will more around as fully expandable
something. This is not that different from the current approach but more
readable. All chars will be accessible that way, independ of their encoding. 

So, in your case: 

<active char 234> regimes onto <\somechar> encodes onto [\char234
uchar{1}{123} ...] etc, depending on the setting. 

I still have to sort out a few guillemot things and so.

There will also be tracing features and one can generate tables that show
if a char is a composed one [accent/pseudo accent] or a direct one. 

It will be a group effort to get the vectors complete since i don't know
all chars [so i may have missed a few] and i want fall backs for all cases. 

Hans

-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: another question on regimes and encoding
  2000-12-28 17:12             ` Hans Hagen
@ 2000-12-28 23:24               ` Denis B. Roegel
  0 siblings, 0 replies; 9+ messages in thread
From: Denis B. Roegel @ 2000-12-28 23:24 UTC (permalink / raw)
  Cc: Denis B. Roegel, ntg-context, Denis B. Roegel

`Hans Hagen' wrote
>   
>   But, if you can wait for a few more days, it's there for you. 

Great!

This encoding stuff has been of the things that kept me from conTeXt.
I think that it would be a good idea to have something in the
documentation that explains how it works to LaTeX users, 
because these typically have a very precise idea of input 
and output encodings, and this regime stuff might be hard to grasp,
although it appears very close to LaTeX's input encodings.

Denis


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

end of thread, other threads:[~2000-12-28 23:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-08 16:37 fonts in embedded tex in embedded metapost in context Denis B. Roegel
2000-12-08 19:14 ` Hans Hagen
2000-12-08 21:34   ` Denis B. Roegel
2000-12-11  0:15     ` Hans Hagen
2000-12-11 20:30       ` Denis B. Roegel
2000-12-12 17:26         ` Hans Hagen
2000-12-28  3:11           ` another question on regimes and encoding Denis B. Roegel
2000-12-28 17:12             ` Hans Hagen
2000-12-28 23:24               ` Denis B. Roegel

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