ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Creating a background texture with text/graphic
@ 2012-10-29 10:50 Mari Voipio
  2012-10-29 11:07 ` Marco Patzer
  0 siblings, 1 reply; 3+ messages in thread
From: Mari Voipio @ 2012-10-29 10:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello all!

While staring at the pile of ConTeXt instruction book(let)s on my
desk, I realized that I should be able to use a logo or a text to
create a background texture to use in scrapbooking and cardcraft. The
problem is that my skills don't quite stretch that far and I can't
remember where I once saw the code for this...

The logo I'm thinking of is originally an Inkscape svg file that I've
this far used in ConTeXt in pdf format. Other available and compatible
vector formats are at least plain svg, ps eps and pdf.


Possible solution 1:
to insert the logo in MetaPost and use loops, rotate, shft and
randomize to create a texture. Loop+shift would make a nice
alternating background, randomized with loop and 90degree rotation
steps would make a denser texture.

The problem: I don't know how to input the logo graphic into Metapost
code. This did not work, even though the pdf is in the same directory:

externalfigure "vaaka-logo.pdf" scaled 1cm;

Don't know if I'm missing something here, this snippet comes from the
MetaFun manual p. 199. Unfortunately I don't have pstoedit on my Mac,
so the conversion trick on page 198 doesn't work for me.

For text there're more ideas and I think I can handle that based on
MetaFun manual p. 92 + randomize, but with the external figure I'm at
loss on how to do it.



Possible solution 2:

ConTeXt. Insert here some code I don't have a clue about. Might be
ConTeXt only or ConTeXt and Metapost/Metafun together.  Inserting the
graphic is no big deal in this case, \externalfigure will do that.


(I got almost what I wanted by tweaking an older label/imposition
file, but I have some weird margin issues there and the positioning
system is not very exact and there are a bit too many things that
affect the layout. I'd rather put stuff on a grid than just tweak it
with the location and margin settings. That's the Word way, in the
long run not the smartest way of doing things. I'm planning to use
this feature a lot, so I'd rather code something that stands for
longer.)



Feel free to point me towards the correct wiki pages, my problem may
just be that I cannot come up with the correct search term,
"background" is not a very good one. And of some reason the garden is
not very good at scrapbooking terms (yet). ;-)

Note. On the moment I have no need to put text on top of those
textures, and I'm not worried about that bit anyway, layers usually
work nicely there. Now I'm interested into creating a "personilized"
background texture onto which I can e.g. glue a chipboard shape or
paper flower or a bit of glitter. It feels stupid to pay for so called
digital stamps/textures/backgrounds when I have the tools to create
some myself. Running text is easy, but using and reusing one logo
would be more fun. :-)


Thanks,

Mari
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Creating a background texture with text/graphic
  2012-10-29 10:50 Creating a background texture with text/graphic Mari Voipio
@ 2012-10-29 11:07 ` Marco Patzer
  2012-10-29 12:37   ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Patzer @ 2012-10-29 11:07 UTC (permalink / raw)
  To: ntg-context

2012-10-29 Mari Voipio:

> The problem: I don't know how to input the logo graphic into Metapost
> code. This did not work, even though the pdf is in the same directory:
> 
> externalfigure "vaaka-logo.pdf" scaled 1cm;

This works here:

\startbuffer [image]
  \useMPlibrary [dum]
  \startTEXpage
    \externalfigure [dummy]
  \stopTEXpage
\stopbuffer

\ctxcommand{runbuffer("\jobname.tmp", "image", true)}

\starttext

\startMPcode
  picture pic;
  pic = externalfigure "\jobname-\jobname.tmp.pdf" scaled 1cm;
  draw pic rotated 20;
\stopMPcode

\stoptext


Marco

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Creating a background texture with text/graphic
  2012-10-29 11:07 ` Marco Patzer
@ 2012-10-29 12:37   ` Wolfgang Schuster
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2012-10-29 12:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 29.10.2012 um 12:07 schrieb Marco Patzer <homerow@lavabit.com>:

> 2012-10-29 Mari Voipio:
> 
>> The problem: I don't know how to input the logo graphic into Metapost
>> code. This did not work, even though the pdf is in the same directory:
>> 
>> externalfigure "vaaka-logo.pdf" scaled 1cm;
> 
> This works here:
> 
> \startbuffer [image]
>  \useMPlibrary [dum]
>  \startTEXpage
>    \externalfigure [dummy]
>  \stopTEXpage
> \stopbuffer
> 
> \ctxcommand{runbuffer("\jobname.tmp", "image", true)}
> 
> \starttext
> 
> \startMPcode
>  picture pic;
>  pic = externalfigure "\jobname-\jobname.tmp.pdf" scaled 1cm;
>  draw pic rotated 20;
> \stopMPcode
> 
> \stoptext

The important thing is to put “draw” in front of the externalfigure command,
a change in the syntax which isn’t mentioned in the manual.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2012-10-29 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 10:50 Creating a background texture with text/graphic Mari Voipio
2012-10-29 11:07 ` Marco Patzer
2012-10-29 12:37   ` Wolfgang Schuster

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