ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Meptapost Drawing not showing-up in Context Letter Style
@ 2019-03-10 15:59 Context NTG
  2019-03-11 20:55 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Context NTG @ 2019-03-10 15:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1599 bytes --]

I am trying to get a metapost drawing as logo added to right upper corner
of a DIN B style letterhead, but it does not show up, just the letter
itself. Is there anything to change to the layers for the MP toe reveal
itself?

Thanks, Jeroen

% BEGIN MP LOGO SETUP
\startuseMPgraphic{mpglogo}
  path p;
  p := (0,0)--(100,0)--(100,100)--(0,100)--cycle;

  path q;
  q := p cornered 30pt;
  draw q withcolor black withpen pencircle scaled 7pt;
\stopuseMPgraphic
\definelayer
  [logo]
  [repeat=no]
\setlayer
  [logo]
  [hoffset=160mm,voffset=17mm]
  {\scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}}

\setupbackgrounds[page][background=logo]
% END MP LOGO SETUP, BEGIN LETTER SETUP
\usemodule[letter][style=dinb]
\setupletterlayer
  [reference]
  [list={name,phone,email,date}]

\setupletterlayer
  [address]
  [y=55mm]

\setupletterdescription
  [enclosure]
  [location=top,
  leftmargin=0.5em,
  symbol=#1,]
\usesymbols[mvs]
\definesymbol[1][{\symbol[martinvogel 2][PointingHand]}]
\setupletter
  [toname={John Doe},
  toaddress={201, Main Street\\23124 London\\United Kingdom},
  fromname={Jansen NV},
  fromaddress={Waalhaven 2200\\2842 KL Rotterdam},
  name={Piet jansen},
  phone={+31(010)4234 4232},
  email={peter.jansen@gmail.com},
  date={\currentdate},

signature={\externalfigure[autograph][height=4\lineheight]\\\correspondenceparameter{name}},]
% END LETTER SETUP, START LETTER

\startletter
  [subject={Outstanding Invoices},
  opening={Dear Sir,},
  closing={Kind Regards,},
  enclosure={list:Commercial Invoice,Accounts Statement},]
\dorecurse{3}{\input knuth \par}
\stopletter

[-- Attachment #1.2: Type: text/html, Size: 2033 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Meptapost Drawing not showing-up in Context Letter Style
  2019-03-10 15:59 Meptapost Drawing not showing-up in Context Letter Style Context NTG
@ 2019-03-11 20:55 ` Wolfgang Schuster
  2019-03-12 22:17   ` Fwd: " Jeroen
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2019-03-11 20:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Context NTG

Context NTG schrieb am 10.03.19 um 16:59:
> I am trying to get a metapost drawing as logo added to right upper 
> corner of a DIN B style letterhead, but it does not show up, just the 
> letter itself. Is there anything to change to the layers for the MP toe 
> reveal itself?

The letter module uses local settings for the page background to place 
all the layer for the header, footer etc. and your own background setup 
is overloaded by the module.


What you can do in this case is to use the predefined but unused 
lettermain layer to place your logo in the background.


\usemodule[letter][style=dinb]

\startuseMPgraphic{mpglogo}
   path p;
   p := (0,0)--(100,0)--(100,100)--(0,100)--cycle ;
   path q;
   q := p cornered 30pt;
   draw q withcolor black withpen pencircle scaled 7pt ;
\stopuseMPgraphic

\startsetups[letter:layer:lettermain]
   \scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}
\stopsetups

\setupletterlayer
   [lettermain]
   [alternative=setups,
    x=160mm,
    y=17mm]

\startletter
\dorecurse{3}{\input knuth \par}
\stopletter


Another way to place content in the background is to use the “paper” (or 
“text”) background which isn’t used by the letter module and your 
settings won’t be overloaded.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Fwd: Meptapost Drawing not showing-up in Context Letter Style
  2019-03-11 20:55 ` Wolfgang Schuster
@ 2019-03-12 22:17   ` Jeroen
  0 siblings, 0 replies; 3+ messages in thread
From: Jeroen @ 2019-03-12 22:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4550 bytes --]

Eventually, these two options worked. Firstly changing \setupbackgrounds

% BEGIN MP LOGO SETUP

\startuseMPgraphic{mpglogo}
  path p;
  p := (0,0)--(100,0)--(100,100)--(0,100)--cycle;

  path q;
  q := p cornered 30pt;
  draw q withcolor black withpen pencircle scaled 7pt;
\stopuseMPgraphic

\definelayer
  [logo]
  [repeat=no]

\setlayer
  [logo]
  [hoffset=160mm,voffset=17mm]
  {\scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}}

\setupbackgrounds[paper][background=logo]

% END MP LOGO SETUP, BEGIN LETTER SETUP

\usemodule
  [letter]
  [style=dinb]

\setupletterlayer
  [reference]
  [list={name,phone,email,date}]

\setupletterlayer
  [address]
  [y=55mm]

\setupletterdescription
  [enclosure]
  [location=top,
  leftmargin=0.5em,
  symbol=#1,]

\usesymbols
  [mvs]

\definesymbol
  [1]
  [{\symbol[martinvogel 2][PointingHand]}]

\setupletter
  [toname={John Doe},
   toaddress={201, Main Street\\23124 London\\United Kingdom},
   fromname={Jansen NV},
   fromaddress={Waalhaven 2200\\2842 KL Rotterdam},
   name={Piet jansen},
   phone={+31(010)4234 4232},
   email={peter.jansen@gmail.com},
   date={\currentdate},
   signature={Pete},]

% END LETTER SETUP, START LETTER

\startletter
  [subject={Outstanding Invoices},
   opening={Dear Sir,},
   closing={Kind Regards,},
   enclosure={list:Commercial Invoice,Accounts Statement},]

\dorecurse{3}{\input knuth \par}

\stopletter


Alternatively, adjusting \setupletterlayer


\usemodule
  [letter]
  [style=dinb]

% BEGIN MP LOGO SETUP

\startuseMPgraphic{mpglogo}
  path p;
  p := (0,0)--(100,0)--(100,100)--(0,100)--cycle;

  path q;
  q := p cornered 30pt;
  draw q withcolor black withpen pencircle scaled 7pt;
\stopuseMPgraphic

\startsetups[letter:layer:lettermain]
  \scale
    [width=25mm,height=25mm]
    {\useMPgraphic{mpglogo}}
\stopsetups

\setupletterlayer
  [lettermain]
  [alternative=setups,
   x=160mm,
   y=17mm]

% END MP LOGO SETUP, BEGIN LETTER SETUP

\setupletterlayer
  [reference]
  [list={name,phone,email,date}]

\setupletterlayer
  [address]
  [y=55mm]

\setupletterdescription
  [enclosure]
  [location=top,
   leftmargin=0.5em,
   symbol=#1,]

\usesymbols
  [mvs]
\definesymbol

  [1]
  [{\symbol[martinvogel 2][PointingHand]}]

\setupletter
  [toname={John Doe},
   toaddress={201, Main Street\\23124 London\\United Kingdom},
   fromname={Jansen NV},
   fromaddress={Waalhaven 2200\\2842 KL Rotterdam},
   name={Piet jansen},
   phone={+31(010)4234 4232},
   email={peter.jansen@gmail.com},
   date={\currentdate},
   signature={Pete},]

% END LETTER SETUP, START LETTER

\startletter
  [subject={Outstanding Invoices},
   opening={Dear Sir,},
   closing={Kind Regards,},
   enclosure={list:Commercial Invoice,Accounts Statement},]

\dorecurse
  {3}
  {\input knuth \par}

\stopletter

---------- Forwarded message ---------
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Date: ma 11 mrt. 2019 om 20:55
Subject: Re: [NTG-context] Meptapost Drawing not showing-up in Context
Letter Style
To: mailing list for ConTeXt users <ntg-context@ntg.nl>, Context NTG <
contextntg@gmail.com>


Context NTG schrieb am 10.03.19 um 16:59:
> I am trying to get a metapost drawing as logo added to right upper
> corner of a DIN B style letterhead, but it does not show up, just the
> letter itself. Is there anything to change to the layers for the MP toe
> reveal itself?

The letter module uses local settings for the page background to place
all the layer for the header, footer etc. and your own background setup
is overloaded by the module.


What you can do in this case is to use the predefined but unused
lettermain layer to place your logo in the background.


\usemodule[letter][style=dinb]

\startuseMPgraphic{mpglogo}
   path p;
   p := (0,0)--(100,0)--(100,100)--(0,100)--cycle ;
   path q;
   q := p cornered 30pt;
   draw q withcolor black withpen pencircle scaled 7pt ;
\stopuseMPgraphic

\startsetups[letter:layer:lettermain]
   \scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}
\stopsetups

\setupletterlayer
   [lettermain]
   [alternative=setups,
    x=160mm,
    y=17mm]

\startletter
\dorecurse{3}{\input knuth \par}
\stopletter


Another way to place content in the background is to use the “paper” (or
“text”) background which isn’t used by the letter module and your
settings won’t be overloaded.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 6290 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-03-12 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-10 15:59 Meptapost Drawing not showing-up in Context Letter Style Context NTG
2019-03-11 20:55 ` Wolfgang Schuster
2019-03-12 22:17   ` Fwd: " Jeroen

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