ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* metafun example & utf8 input problem
@ 2004-12-24 23:35 VnPenguin
  2004-12-25 10:20 ` Adam Lindsay
  0 siblings, 1 reply; 3+ messages in thread
From: VnPenguin @ 2004-12-24 23:35 UTC (permalink / raw)


Hi all,
I'm trying the example at page 236 Graphics and macros (metafun-s.pdf).
I use vietnamese utf-8 input with T5.:
--------------------------- code ---------------
\enableregime[utf]
\setupencoding[default=t5]
\loadmapfile[urwvn]
\usetypescript[all][computer-modern][t5]
\setupbodyfont[reset]

\usetypescript[berry][t5]
\usetypescript[postscript][t5]
\setupbodyfont[postscript,12pt]

\starttext
\startuseMPgraphic{FunnyFrame} 
picture p ; 
numeric w, h, o ; 
p := textext.rt(\MPstring{FunnyFrame}) ; 
w := OverlayWidth ; 
h := OverlayHeight ; 
o := BodyFontSize ; 
p := p shifted (2o,h-ypart center p) ; 
draw p ; 
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; 
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; 
draw boundingbox p ; 
setbounds currentpicture to unitsquare xyscaled(w,h) ; 
\stopuseMPgraphic

\defineoverlay
	[FunnyFrame]
	[\useMPgraphic{FunnyFrame}]
\defineframedtext
	[FunnyText]
	[frame=off,background=FunnyFrame]

\def\StartFrame{\startFunnyText} 
\def\StopFrame {\stopFunnyText } 
\def\FrameTitle#1% 
	{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} 
\setMPtext{FunnyFrame}{}

\FrameTitle{Những nhận định} 
\StartFrame 
Những nhận định trên đây có thể đúng, có thể không đúng!
Những nhận định trên đây có thể đúng, có thể không đúng!
Những nhận định trên đây có thể đúng, có thể không đúng!
\StopFrame

\stoptext
-------- end of code --------------------

The text in \StartFrame ....\StopFrame is correctly printed. 
But the \FrameTitle is not. I lossed all accented characters.
In Acroread, I found that the framed title uses CMR12 font instead of
VnNimbusRomNo9L-Regu font like the body.
Any help will be very appreciated.
Thank you,

Quy NGUYEN-DAI

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

* Re: metafun example & utf8 input problem
  2004-12-24 23:35 metafun example & utf8 input problem VnPenguin
@ 2004-12-25 10:20 ` Adam Lindsay
  2004-12-25 19:01   ` VnPenguin
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Lindsay @ 2004-12-25 10:20 UTC (permalink / raw)


VnPenguin said this at Sat, 25 Dec 2004 00:35:36 +0100:

>I'm trying the example at page 236 Graphics and macros (metafun-s.pdf).
>I use vietnamese utf-8 input with T5.:
>--------------------------- code ---------------
>\enableregime[utf]
>\setupencoding[default=t5]
>\loadmapfile[urwvn]
>\usetypescript[all][computer-modern][t5]
>\setupbodyfont[reset]
>
>\usetypescript[berry][t5]
>\usetypescript[postscript][t5]
>\setupbodyfont[postscript,12pt]

Hello again,

Replace all this preamble stuff with something that gets sent to both
ConTeXt and MetaFun:

\startMPenvironment[global]
  \enableregime[utf]
  \setupencoding[default=t5]
  \loadmapfile[urwvn]
  \usetypescript[berry][t5]
  \usetypescript[postscript][t5]
  \setupbodyfont[postscript,12pt]
\stopMPenvironment

(BTW, the example text you sent got mangled in mailing--try checking your
mailer's encoding.)

Also, this was discussed in the archives as recently as July/August.
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: metafun example & utf8 input problem
  2004-12-25 10:20 ` Adam Lindsay
@ 2004-12-25 19:01   ` VnPenguin
  0 siblings, 0 replies; 3+ messages in thread
From: VnPenguin @ 2004-12-25 19:01 UTC (permalink / raw)


On Sat, 25 Dec 2004 10:20:28 +0000, Adam Lindsay <atl@comp.lancs.ac.uk> wrote:
> Hello again,
> 
> Replace all this preamble stuff with something that gets sent to both
> ConTeXt and MetaFun:
> 
> \startMPenvironment[global]
>   \enableregime[utf]
>   \setupencoding[default=t5]
>   \loadmapfile[urwvn]
>   \usetypescript[berry][t5]
>   \usetypescript[postscript][t5]
>   \setupbodyfont[postscript,12pt]
> \stopMPenvironment

Thank you so much. It works well now.
 
> (BTW, the example text you sent got mangled in mailing--try checking your
> mailer's encoding.)

Hmm, my mailer is .... Google :)

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

end of thread, other threads:[~2004-12-25 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-24 23:35 metafun example & utf8 input problem VnPenguin
2004-12-25 10:20 ` Adam Lindsay
2004-12-25 19:01   ` VnPenguin

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