ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otso Helenius <context@pi-xi.net>
To: ntg-context@ntg.nl
Subject: Using text as a clip path for Metafun & free shape paragraphs
Date: Sun, 22 May 2011 18:09:33 +0300	[thread overview]
Message-ID: <20110522150933.GA12389@innsmouth.lan> (raw)

Thanks to Wolfgang for the instructions on changing fonts, \switchtobodyfont works as expected. I still
have to dig up the exact definitions of both \switchtobodyfont and \switchtotypeface, as the latter command
seems to work in Hans' examples (for example showfont.pdf) but not with my installation.

Now, I've been trying to use metapost for achieving magazine type layout with ConTeXt, and have a question
about the following features:

1) Is it possible to use TeX typeset text as a clipping path for MP graphics? What I would like to achieve is
a similar cut mask as seen in this picture: https://modernpost.files.wordpress.com/2009/10/rockstar11091.jpg
i.e. the text outline cuts a hole in the brown filled rectangle revealing the bitmap below.

I can cut pictures easily with paths in MP like so:

\startMPcode
fill unitsquare xysized (100mm,100mm) withcolor green;
picture cur; cur := currentpicture; currentpicture := nullpicture;
fill unitsquare xysized (100mm,100mm) withcolor blue;
path mask; mask := unitsquare xysized (100mm,100mm) -- reverse unitsquare xysized (100mm,10mm) shifted (0mm,45mm) -- cycle;
clip cur to mask;
draw cur;
\stopMPcode

But I can't cut pictures with pictures (only with masks), nor have I found a way in any of the manuals
(mmakempy.pdf, metafun-p.pdf, metapostmanual.pdf) to output text outline as paths which could be used for
cutting a hole in the mask picture. Is this possible?

2) MP gives an easy way to format free flowing paragraph shapes similar to this image: http://www.davidlcade.com/images/gropius/g2.png .
I have followed the instructions on pages 435-444. The problem with this approach is that the text which will be
placed in a freely shaped paragraph will be a separate block which won't flow freely with other text in the document
body if the contents on earlier pages change.

I guess this drops in the category of big feature requests, but it would be nice to be able to define the
shapes and positions of ConTeXt columns/paragraphs with MP graphics. In InDesign columns of any shape anywhere
on the page can be connected without having to separate one block of text from the rest.

With this feature one could define for example a 2-page spread for a magazine (with free shape graphics and columns)
in between two ordinarily defined pages and would not have to manually disrupt the body text flow through the
document.



Best regards,
Otso Helenius
___________________________________________________________________________________
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
___________________________________________________________________________________


             reply	other threads:[~2011-05-22 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 15:09 Otso Helenius [this message]
2011-05-22 17:11 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110522150933.GA12389@innsmouth.lan \
    --to=context@pi-xi.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).