From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92549 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Center text in an image (Metafun) Date: Sun, 13 Sep 2015 09:18:16 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1948939089==" X-Trace: ger.gmane.org 1442128752 15499 80.91.229.3 (13 Sep 2015 07:19:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Sep 2015 07:19:12 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 13 09:19:01 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zb1Yx-0004F2-PG for gctc-ntg-context-518@m.gmane.org; Sun, 13 Sep 2015 09:18:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B5D1E10441 for ; Sun, 13 Sep 2015 09:18:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jCzro2qh4gVC for ; Sun, 13 Sep 2015 09:18:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5E61910235 for ; Sun, 13 Sep 2015 09:18:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 33491101FD for ; Sun, 13 Sep 2015 09:18:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tNJhCCvLYRNs for ; Sun, 13 Sep 2015 09:18:23 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id D6BE5101FB for ; Sun, 13 Sep 2015 09:18:18 +0200 (CEST) Original-Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) by filter3-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t8D7IG2K001050 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2015 09:18:17 +0200 Original-Received: by igbni9 with SMTP id ni9so63921755igb.0 for ; Sun, 13 Sep 2015 00:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=aCJm6blbixXcHnriF+zBJXpgkzljq+XwK4Plwh5HSWE=; b=Px6NqHjLf/oR28P0DYwhmFLnzpSkZ4IiffJIT0ZgbeeF8SbpFj0EkfufJ4O7PpDT6P QhVQ/duzJhHP4AJxZ/QL2iTJ74+6yq7LTo/GLTL8nrUcw2s7K7veCjJ8W41kRb2MMSZD Hard0jO2O0XcNzhE1Kby+unsvNGPkqzfy3Ej0O0nSfYi98xSq9Z3HJyWJAFYEw00Wreb 438A/m/15Sij34sC0UqUuBrbknmACs1hLZzPKE5e+Up9XQYSo4iCfu12fSQwE/WW26zy FvTR/TQQ8zdcov4q5ntjyri40c8rLI5XP19kOXMjwStT4RCaPlYi7ebNOcltfKFnRO1a p17Q== X-Received: by 10.50.79.196 with SMTP id l4mr8714636igx.48.1442128696271; Sun, 13 Sep 2015 00:18:16 -0700 (PDT) Original-Received: by 10.64.227.14 with HTTP; Sun, 13 Sep 2015 00:18:16 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c05::22a; country=US; region=Iowa; city=Council Bluffs; latitude=41.2619; longitude=-95.8608; http://maps.google.com/maps?q=41.2619,-95.8608&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03PgvihoP - 28903940432a - 20150913 (trained as not-spam) Received-SPF: pass (filter3-ams.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c05::22a as permitted sender) receiver=filter3-ams.mf.surf.net; client-ip=2607:f8b0:4001:c05::22a; envelope-from=; helo=mail-ig0-x22a.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:92549 Archived-At: --===============1948939089== Content-Type: multipart/alternative; boundary=089e01183f48a98a65051f9bc0ee --089e01183f48a98a65051f9bc0ee Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, My image contains the text "Method 1" which is not centered, how can he be? Thank you. Fabrice \setupcolors[state=3Dstart] \definecolor[MyColorA][c=3D0.00, m=3D0.10, y=3D0.20, k=3D0.00] \definecolor[MyColorB][c=3D0.00, m=3D0.62, y=3D1.00, k=3D0.00] \definecolor[MyColorC][c=3D0.3, m=3D0.00, y=3D0.00, k=3D0.05] \definecolor[MyColorD][c=3D0.6, m=3D0.00, y=3D0.00, k=3D0.10] \definemixedcolumns [myColumn] [n=3D2, separator=3Drule, rulecolor=3DMyColorC, rulethickness=3D1pt, maxwidth=3D\availablehsize, balance=3Dyes] \setupalign[verytolerant,stretch,hanging] \defineoverlay [Funny] [\useMPgraphic{Funny}] \definelabel [M=C3=89THODE] [headstyle=3D\bf\smallcaps] \startuseMPgraphic{Funny} interim linejoin :=3D mitered ; interim linecap :=3D squared ; path b ; picture p ; picture pic ; pic :=3D textext.rt("\darkgreen Calculer les coordonn=C3=A9es d'un mili= eu") ; pic :=3D pic shifted (OverlayWidth/4,OverlayHeight-ypart center pic+.25ExHeight) ; p :=3D textext.rt("\white\M=C3=89THODE") ; p :=3D p shifted (0,OverlayHeight) ; b :=3D boundingbox p shifted(1.5mm,0); drawoptions (withpen pencircle scaled 3mm withcolor \MPcolor{MyColorC}) ; draw leftboundary OverlayBox shifted(1.5mm,0) ; fill b withcolor \MPcolor{MyColorD} ; draw p ; draw pic ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineframedtext [Methode] [before=3D{\blank[line,halfline]}, after=3D{\blank}, frame=3Doff, background=3DFunny, width=3D\textwidth, height=3Dfit, ] \starttext \startMethode \startmyColumn \input ward \column \input knuth \stopmyColumn \stopMethode --089e01183f48a98a65051f9bc0ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
My image
contains the text "Method 1" which = is not centered, how can he be?
Thank you.
Fabrice
\setupcolors[state=3Dstart]


\definecolor[MyColorA][c=3D0.00= , m=3D0.10, y=3D0.20, k=3D0.00]

\definecolor[MyColorB][c=3D0.00, m= =3D0.62, y=3D1.00, k=3D0.00]

\definecolor[MyColorC][c=3D0.3, m=3D0.0= 0, y=3D0.00, k=3D0.05]

\definecolor[MyColorD][c=3D0.6, m=3D0.00, y= =3D0.00, k=3D0.10]

\definemixedcolumns
=C2=A0 [myColumn]
=C2= =A0 [n=3D2,
=C2=A0=C2=A0 separator=3Drule,
=C2=A0=C2=A0 rulecolor=3DM= yColorC,
=C2=A0=C2=A0 rulethickness=3D1pt,
=C2=A0=C2=A0 maxwidth=3D\a= vailablehsize,
=C2=A0=C2=A0 balance=3Dyes]

\setupalign[verytolera= nt,stretch,hanging]


\defineoverlay
=C2=A0 [Funny]
=C2=A0 [= \useMPgraphic{Funny}]

\definelabel
=C2=A0 [M=C3=89THODE]
=C2= =A0 [headstyle=3D\bf\smallcaps]


\startuseMPgraphic{Funny}
=C2= =A0=C2=A0=C2=A0 interim linejoin :=3D mitered ;
=C2=A0=C2=A0=C2=A0 inter= im linecap :=3D squared ;
=C2=A0=C2=A0=C2=A0 path b ;
=C2=A0=C2=A0=C2= =A0 picture p ;
=C2=A0=C2=A0=C2=A0 picture pic ;
=C2=A0=C2=A0=C2=A0 p= ic :=3D textext.rt("\darkgreen Calculer les coordonn=C3=A9es d'un = milieu") ;
=C2=A0=C2=A0=C2=A0 pic :=3D pic shifted (OverlayWidth/4,= OverlayHeight-ypart center pic+.25ExHeight) ;
=C2=A0=C2=A0=C2=A0 p :=3D = textext.rt("\white\M=C3=89THODE") ;
=C2=A0=C2=A0=C2=A0 p :=3D = p shifted (0,OverlayHeight) ;
=C2=A0=C2=A0=C2=A0 b :=3D boundingbox p sh= ifted(1.5mm,0);
=C2=A0=C2=A0=C2=A0 drawoptions (withpen pencircle scaled= 3mm withcolor \MPcolor{MyColorC}) ;
=C2=A0=C2=A0=C2=A0 draw leftboundar= y OverlayBox shifted(1.5mm,0) ;
=C2=A0=C2=A0=C2=A0 fill b withcolor \MPc= olor{MyColorD} ;
=C2=A0=C2=A0=C2=A0 draw p ;
=C2=A0=C2=A0=C2=A0 draw = pic ;
=C2=A0=C2=A0=C2=A0 setbounds currentpicture to OverlayBox ;
\st= opuseMPgraphic

\defineframedtext
=C2=A0 [Methode]
=C2=A0 [befo= re=3D{\blank[line,halfline]},
=C2=A0=C2=A0 after=3D{\blank},
=C2=A0= =C2=A0 frame=3Doff,
=C2=A0=C2=A0 background=3DFunny,
=C2=A0=C2=A0 wid= th=3D\textwidth,
=C2=A0=C2=A0 height=3Dfit,
=C2=A0=C2=A0 ]

\st= arttext


\startMethode

\startmyColumn

\input ward
\column

\input knuth

\stopmyColumn


\stopMeth= ode

--089e01183f48a98a65051f9bc0ee-- --===============1948939089== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1948939089==--