\startMPenvironment : personal font weirdness
Greetings all, I've been experimenting with MetaPost/Fun of late. It is indeed fun. In trying to have a uniform font in both text and MP areas, however, I am running into some difficulty. With a little file like this: --- \setupcolors[state=start] \setuppagenumbering[state=stop] \startMPenvironment [global] \usetypescript[palatino][ec] \switchtobodyfont[palatino,12pt] \stopMPenvironment \starttext The following example should be very interesting: \blank \startuseMPgraphic{very-interesting} z40 = (2cm,0cm) ; z41 = (3cm,0cm) ; z42 = (3cm,1cm) ; z43 = (2cm,1cm) ; z46 = (2.5cm,.5cm) ; path F ; F := (z40--z41--z42--z43--cycle) ; linejoin := mitered ; drawpath F ; label("very", z46) ; \stopuseMPgraphic \useMPgraphic{very-interesting} \stoptext --- everything works very nicely (fonts identical). When I use my own typescript file, however: --- \startMPenvironment [global] \usetypescriptfile[minionpro-diss] \usetypescript[Minion] \switchtobodyfont[Minion,12pt] \stopMPenvironment --- The text appears in the correct font, but the MP section, _while at first showing the correct font_, then changes to CM before my eyes. (my pdf viewer auto-updates). Any clues? Many thanks, David
David Wooten wrote:
Greetings all,
I've been experimenting with MetaPost/Fun of late. It is indeed fun. In trying to have a uniform font in both text and MP areas, however, I am running into some difficulty. With a little file like this:
---
\setupcolors[state=start] \setuppagenumbering[state=stop]
\startMPenvironment [global] \usetypescript[palatino][ec] \switchtobodyfont[palatino,12pt] \stopMPenvironment
\starttext
The following example should be very interesting: \blank
\startuseMPgraphic{very-interesting}
z40 = (2cm,0cm) ; z41 = (3cm,0cm) ; z42 = (3cm,1cm) ; z43 = (2cm,1cm) ; z46 = (2.5cm,.5cm) ;
path F ; F := (z40--z41--z42--z43--cycle) ;
linejoin := mitered ;
drawpath F ; label("very", z46) ;
\stopuseMPgraphic
\useMPgraphic{very-interesting}
\stoptext
---
everything works very nicely (fonts identical). When I use my own typescript file, however:
---
\startMPenvironment [global] \usetypescriptfile[minionpro-diss] \usetypescript[Minion] \switchtobodyfont[Minion,12pt] \stopMPenvironment
dangerous to use such a upper/lowercase mix (typos)
---
The text appears in the correct font, but the MP section, _while at first showing the correct font_, then changes to CM before my eyes. (my pdf viewer auto-updates).
hm, looks like a bronwser problem what happens if you only include the graphic, \startMPpage z40 = (2cm,0cm) ; z41 = (3cm,0cm) ; z42 = (3cm,1cm) ; z43 = (2cm,1cm) ; z46 = (2.5cm,.5cm) ; path F ; F := (z40--z41--z42--z43--cycle) ; linejoin := mitered ; drawpath F ; label("very", z46) ; \stopMPpage so, no other text Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
\startMPenvironment [global] \usetypescriptfile[minionpro-diss] \usetypescript[Minion] \switchtobodyfont[Minion,12pt] \stopMPenvironment
dangerous to use such a upper/lowercase mix (typos)
I see what you mean.
hm, looks like a bronwser problem
what happens if you only include the graphic,
\startMPpage z40 = (2cm,0cm) ; z41 = (3cm,0cm) ; z42 = (3cm,1cm) ; z43 = (2cm,1cm) ; z46 = (2.5cm,.5cm) ;
path F ; F := (z40--z41--z42--z43--cycle) ;
linejoin := mitered ;
drawpath F ; label("very", z46) ; \stopMPpage
so, no other text
Same results, and I also checked with a different viewer. Points to my typescript file as a problem, does it? (Which works fine in non-MP ConTeXt).
David Wooten wrote:
Hans Hagen wrote:
\startMPenvironment [global] \usetypescriptfile[minionpro-diss] \usetypescript[Minion] \switchtobodyfont[Minion,12pt] \stopMPenvironment
dangerous to use such a upper/lowercase mix (typos)
I see what you mean.
hm, looks like a bronwser problem
what happens if you only include the graphic,
\startMPpage z40 = (2cm,0cm) ; z41 = (3cm,0cm) ; z42 = (3cm,1cm) ; z43 = (2cm,1cm) ; z46 = (2.5cm,.5cm) ;
path F ; F := (z40--z41--z42--z43--cycle) ;
linejoin := mitered ;
drawpath F ; label("very", z46) ; \stopMPpage
so, no other text
Same results, and I also checked with a different viewer. Points to my typescript file as a problem, does it? (Which works fine in non-MP ConTeXt).
what is the label font then? probably defaultfont so you need to set that as well also, label does not use tex, use label(\textext("very"),z46) and friends Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
what is the label font then? probably defaultfont so you need to set that as well also, label does not use tex, use
label(\textext("very"),z46)
That's it, indeed (though without the back-slash for textext): label(textext("very"),z46)
and friends
Hans
Many thanks! David
On 8/4/06, David Wooten wrote:
Hans Hagen wrote:
what is the label font then? probably defaultfont so you need to set that as well also, label does not use tex, use
label(\textext("very"),z46)
should be \textext{very}
That's it, indeed (though without the back-slash for textext):
label(textext("very"),z46)
I would use label(\sometxt{very},z46); It works much better and you don't need to specify anything in the MPenvironment. The default document font will be used. Mojca To Hans: \textext is not documented anywhere yet. Would it make sense to make it a synonym for \sometxt perhaps?
On Aug 4, 2006, at 10:46, Mojca Miklavec wrote:
On 8/4/06, David Wooten wrote:
Hans Hagen wrote:
what is the label font then? probably defaultfont so you need to set that as well also, label does not use tex, use
label(\textext("very"),z46)
should be \textext{very}
That's it, indeed (though without the back-slash for textext):
label(textext("very"),z46)
I would use label(\sometxt{very},z46);
It works much better and you don't need to specify anything in the MPenvironment. The default document font will be used.
Mojca
To Hans: \textext is not documented anywhere yet. Would it make sense to make it a synonym for \sometxt perhaps?
Please don't. I have experienced a difference between textext and sometext, the former needed when metapost variables are combined. Hans van der Meer
Mojca Miklavec wrote:
On 8/4/06, David Wooten wrote:
Hans Hagen wrote:
what is the label font then? probably defaultfont so you need to set that as well also, label does not use tex, use
label(\textext("very"),z46)
should be \textext{very}
indeed -)
That's it, indeed (though without the back-slash for textext):
label(textext("very"),z46)
I would use label(\sometxt{very},z46);
It works much better and you don't need to specify anything in the MPenvironment. The default document font will be used.
usable in 90% of the cases (not in loops)
To Hans: \textext is not documented anywhere yet. Would it make sense to make it a synonym for \sometxt perhaps?
too confusing Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
David Wooten
-
Hans Hagen
-
Hans van der Meer
-
Mojca Miklavec