accents in text included in Metapost chain
Hi contexers, I try to copy a nice graphic effect (shadow) on text from metafun manual (Hello in p. 187) --thank you Hans. I cannot get proper accentuation in a french text. See code and pdf result attached. Thanks for answers. -- olivier Turlier \useregime[il1] \enableregime[il1] \useencoding[ffr] \mainlanguage[fr] \enableregime[windows] \usetypescript[palatino][texnansi] \setupbodyfont[palatino,rm,12pt] \setuplayout [header=0pt, footer=0pt, backspace=1.5cm, width=middle, topspace=1cm, height=middle] \startMPenvironment[global] \useregime[il1] \enableregime[il1] \useencoding[ffr] \mainlanguage[fr] \enableregime[windows] \stopMPenvironment \setupcolors[state=start] \definecolor [Gris] [r=.86, g=.85, b=.54] \definecolor [Noir] [r=0.0, g=0.0, b=0.0] \definecolor [Avant-titre] [Noir] % titre chapitres \definecolor [Fond-titre] [Gris] % titre second plan chapitres \starttext \startstandardmakeup \vfill \midaligned{ \switchtobodyfont[24pt]\blue{Where are the accent} \switchtobodyfont[12pt]\green{ gone?}} \inright{\rotate[rotation=270]{Is that the}} \blank[2cm] \startuseMPgraphic{Doubletitre} def SampleText (expr t, f, c) = draw t infont f scaled 5 withcolor c ; enddef ; def BigText (expr t, f, c) = draw t infont f scaled 8 withcolor c ; enddef ; BigText("Réponse ?","\truefontname{RegularSlanted}" , \MPcolor{Fond-titre}) ; %R\'eponses not working SampleText("Réponse ?","\truefontname{Regular}" , \MPcolor{Avant-titre}) ; \stopuseMPgraphic \useMPgraphic{Doubletitre} \vfill \stopstandardmakeup \chapter[chap:ques]{Question} After the accent problem solved, I wish to implement such kind of graphic effect/setup for headers like chapters. The goal is to only write once \quote{Question} in \type{\chapter[chap:ques]{Question}} for getting the same result than in the first page, or in below (\quote{shadowed} effect must only apply to text, not to header number). \startuseMPgraphic{Doubletitre} def SampleText (expr t, f, c) = draw t infont f scaled 5 withcolor c ; enddef ; def BigText (expr t, f, c) = draw t infont f scaled 8 withcolor c ; enddef ; BigText("Question","\truefontname{RegularSlanted}" , \MPcolor{Fond-titre}) ; %R\'eponses not working SampleText("Question","\truefontname{Regular}" , \MPcolor{Avant-titre}) ; \stopuseMPgraphic \useMPgraphic{Doubletitre} \stoptext
olivier Turlier wrote:
Hi contexers, I try to copy a nice graphic effect (shadow) on text from metafun manual (Hello in p. 187) --thank you Hans. I cannot get proper accentuation in a french text. See code and pdf result attached.
\useregime[il1] \enableregime[il1] \useencoding[ffr] \mainlanguage[fr] \enableregime[windows]
^ ^ you can omit this of you have the global def below
\startMPenvironment[global] \useregime[il1] \enableregime[il1] \useencoding[ffr] \mainlanguage[fr] \enableregime[windows] \stopMPenvironment
you enable regime il1 and after that regime windows but neither seem to match your input, which may be latin2 Here, not using any regime at all works ok (since texnansi has the glyps in those slots) \startMPenvironment[global] \useencoding[ffr] \mainlanguage[fr] \stopMPenvironment 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 -----------------------------------------------------------------
olivier Turlier wrote:
The goal is to only write once \quote{Question} in \type{\chapter[chap:ques]{Question}} for getting the same result than in the first page, or in below (\quote{shadowed} effect must only apply to text, not to header number).
\usetypescript[palatino][texnansi] \setupbodyfont[palatino,rm,12pt] \setupcolors[state=start] \definefont[BigFontOne][RegularSlanted sa 3] \definefont[BigFontTwo][RegularSlanted sa 2] \definecolor[BigColorOne][r=.86,g=.850,b=.54] \definecolor[BigColorTwo][r=.43,g=.425,b=.27] \setuphead [chapter] [textcommand=\MyChapterText, color=BigColorTwo, style=\BigFontTwo] \def\MyChapterText#1{\rlap{\BigFontOne\BigColorOne#1}#1} \chapter[chap:ques]{Question} \chapter[chap:answ]{Answer} \stoptext it's up to you to submit it in the wiki ----------------------------------------------------------------- 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 (2)
-
Hans Hagen
-
olivier Turlier