ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* accents in text included in Metapost chain
@ 2004-10-19 21:19 olivier Turlier
  2004-10-20  9:55 ` Hans Hagen
  2004-10-20 10:06 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: olivier Turlier @ 2004-10-19 21:19 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

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

[-- Attachment #2: pb-accents-text-mp.pdf --]
[-- Type: application/pdf, Size: 53349 bytes --]

[-- Attachment #3: pb-accents-text-mp.tex --]
[-- Type: text/plain, Size: 2317 bytes --]

\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

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: accents in text included in Metapost chain
  2004-10-19 21:19 accents in text included in Metapost chain olivier Turlier
@ 2004-10-20  9:55 ` Hans Hagen
  2004-10-20 10:06 ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2004-10-20  9:55 UTC (permalink / raw)


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

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

* Re: accents in text included in Metapost chain
  2004-10-19 21:19 accents in text included in Metapost chain olivier Turlier
  2004-10-20  9:55 ` Hans Hagen
@ 2004-10-20 10:06 ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2004-10-20 10:06 UTC (permalink / raw)


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

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

* Re: accents in text included in Metapost chain
@ 2004-10-22 20:28 olivier Turlier
  0 siblings, 0 replies; 5+ messages in thread
From: olivier Turlier @ 2004-10-22 20:28 UTC (permalink / raw)


Hans Hagen wrote:

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

Thanks a lot, it's working nicely. Who said that man cannot learn from 
each other ?

Following your suggestion, i've send your clean code to 
contextgardenwiki in Sample documents/Sample macros/macro for chapters 
headers.

Thanks again Hans.

---

olivier Turlier

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

* Re: accents in text included in Metapost chain
@ 2004-10-22 20:27 olivier Turlier
  0 siblings, 0 replies; 5+ messages in thread
From: olivier Turlier @ 2004-10-22 20:27 UTC (permalink / raw)


Hans Hagen wrote:

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

Thanks a lot, it's working nicely. Who said that man cannot learn from 
each other ?

Following your suggestion, i've send your clean code to 
contextgardenwiki in Sample documents/Sample macros/macro for chapters 
headers.

Thanks again Hans.

---

olivier Turlier

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

end of thread, other threads:[~2004-10-22 20:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 21:19 accents in text included in Metapost chain olivier Turlier
2004-10-20  9:55 ` Hans Hagen
2004-10-20 10:06 ` Hans Hagen
2004-10-22 20:27 olivier Turlier
2004-10-22 20:28 olivier Turlier

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