ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Garulfo via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Garulfo <garulfo@azules.eu>
Subject: Re: Pull quote between two column - trial
Date: Sat, 28 May 2022 20:25:10 +0200	[thread overview]
Message-ID: <1135a9fb-84b5-dadf-3ebb-86ef528f662e@azules.eu> (raw)
In-Reply-To: <3917871d-d393-4032-27c0-fba853c47c23@azules.eu>

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

some progress... if it can help.

No more issue with nonsymetrical behavior, and \framed are properly 
aligned with the grid.

Garulfo

[-- Attachment #2: getshapetext_for_pullquote.pdf --]
[-- Type: application/pdf, Size: 19939 bytes --]

[-- Attachment #3: getshapetext_for_pullquote.tex --]
[-- Type: text/x-tex, Size: 2454 bytes --]

\setuplayout [grid=yes]

\showgrid

\definecolor [transparentred]  [r=1,t=.5,a=1]

\def\numA{18}
\def\numB{4}
\def\numC{8}
\def\numD{14}
\def\mygap{0.001pt}

%=======================================================

\startMPinclusions
    path pleft ; path pright ;

    numeric LA ; LA := (\numA-1)*LineHeight + StrutHeight + StrutDepth + \mygap ;
    numeric LB ; LB :=  \numB   *LineHeight - StrutHeight - StrutDepth + \mygap ;
    numeric LC ; LC :=  \numC   *LineHeight - StrutHeight - StrutDepth - \mygap ;
    numeric LD ; LD :=  \numD   *LineHeight ;
    numeric LE ; LE := 2cm ;

    pleft := (0cm     , 0cm    ) --
             (LD      , 0cm    ) --
             (LD      , LA - LC) --
             (LD - LE , LA - LC) --
             (LD - LE , LA - LB) --
             (LD      , LA - LB) --
             (LD      , LA     ) --
             (0cm     , LA     ) --
             cycle  ;

    pright := pleft reflectedabout ((LD/2,0cm) , (LD/2,1cm));

\stopMPinclusions

\startuseMPgraphic{mytest1}  % column on the left of the pull quote
    lmt_parshape [path = pleft ] ;
    fill pleft withcolor \MPcolor{transparentred} ;
\stopuseMPgraphic

\startuseMPgraphic{mytest2}  % column on the right of the pull quote
    lmt_parshape [path = pright] ;
    fill pright withcolor \MPcolor{transparentred} ;
\stopuseMPgraphic

\defineoverlay[myOL1][\useMPgraphic{mytest1}]
\defineoverlay[myOL2][\useMPgraphic{mytest2}]

%=======================================================

\defineframed
  [MyBigFrame]
  [offset=-0.26pt,
   frameoffset=0pt,
   frame=off,
   strut=yes,
   before=,
   location=top,
   height=\dimexpr(\numA\lineheight),
   width=\textwidth,
   align=normal,]

\defineframed
  [MyFrame]
  [MyBigFrame]
  [location=high,
   width=\dimexpr(\numD\lineheight),
   after=\dontleavehmode,]

%=======================================================

\starttext

{\bf Before}   %----------------------------------------

\startshapetext[mytest1,mytest2]
\strut\samplefile{douglas}
\stopshapetext

\MyBigFrame{%
\MyFrame[background=myOL1]{\getshapetext}%
\hfill%
\MyFrame[background=myOL2]{\getshapetext}}

{\bf Between}  %----------------------------------------

\startshapetext[mytest1,mytest2]
\strut\samplefile{knuth}\par\samplefile{knuth}
\stopshapetext

\MyBigFrame{%
\MyFrame[background=myOL1]{\getshapetext}%
\hfill%
\MyFrame[background=myOL2]{\getshapetext}}

{\bf After}    %----------------------------------------

\stoptext

[-- Attachment #4: 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
___________________________________________________________________________________

  reply	other threads:[~2022-05-28 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 21:20 Garulfo via ntg-context
2022-05-28 18:25 ` Garulfo via ntg-context [this message]
2022-05-28 22:55   ` jbf via ntg-context
2022-05-29 17:39   ` Garulfo via ntg-context

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=1135a9fb-84b5-dadf-3ebb-86ef528f662e@azules.eu \
    --to=ntg-context@ntg.nl \
    --cc=garulfo@azules.eu \
    /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).