On 3/1/2021 6:27 PM, Otared Kavian wrote:
Hi Hans,

Thank you for the new upload.

The teaser examples work fine, many thanks !
I have a question though: how can one center within a page a text, for example 
typeset in a circular shape? I tried with \startalignment, and also with 
\startplacefigure but none of these gives a centered circular shape.

Also I noticed that if one removes the comment at the end of 
\startshapedparagraph, or add a blank line after that, then the circular shape 
is destroyed: is this on purpose ?
\starttext

\startuseMPgraphic{circleBis}
    lmt_parshape [
        path       = fullcircle scaled 90mm,
        offset     = 2mm,
        bottomskip = - 1.5LineHeight,
    ] ;
\stopuseMPgraphic

\startplacefigure[align=middle,number=no]
    \framed[width=90mm,offset=2mm,align=normal]\bgroup
        \startshapedparagraph
            [list=circle,mp=circleBis,repeat=yes,method=repeat]%
            \setupalign[verytolerant,stretch,last]\dontcomplain
            {\darkred \samplefile{thuan}}
        \stopshapedparagraph
    \egroup
\stopplacefigure

\stoptext

We're talking parshapes here, think of

\parshape 2
  2mm 10cm
  4mm 12cm

or

\parshape 2
  options 1 % force a repeat
  2mm 10cm
  4mm 12cm

but then nicely wrapped in a macro. The circle is (cf metafun manual) converted into such a parshape. A parshape is forgotten when a new paragraph is started, but ... we have extra magic that revives them which is why the multi-page-par examples work too. The cycle and repeat methods do that (using abit diufferent tricks than the 20 year old one but not that different); these methods are independent of the parshape's repeat option itself, which is an engine feature.

Messing with left/right 'align' will also bring left/rightskip into the game so normally you will not do that. I admit it take a bit of imagination to get the picture. The 'last' keyword is some old context feature that centers the last line (which looks nicer in a circle) which
is using some parfillskip magic.

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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 via email to