[NTG-context] MetaPost label direction prefix

Marco Patzer lists at homerow.info
Sat Aug 24 14:31:42 CEST 2013


On 2013–08–24 Hans Hagen wrote:

>     startplaincompatibity ;
> 
>         label("first", origin);
> 
>         pair laboff.foo ; laboff.foo := (.5,-1) ;
>         labxf.foo := labyf.foo := 1 ;
> 
>         label.foo("second", origin);
> 
>     stopplaincompatibity ;

Brilliant! Thanks a lot. A few things:

1) Can you replace

  def useplainlabels =
    let label    = plain_label ;
    let thelabel = plain_thelabel ;
  enddef ;

with

  def useplainlabels =
    def label    = plain_label    enddef ;
    def thelabel = plain_thelabel enddef ;
  enddef ;

The minimal example works with your version, but the old MetaPost
code does not. The def variant works fine with both.

2) Replace

  startplaincompatibity  →  startplaincompatibility
   stopplaincompatibity  →  stopplaincompatibility

3) This one is truly optional and just a suggestion for a better
interface. Although it's nice to have the grouping in
start-stopplaincompatibility, it's not required here, since the
entire MetaPost instance runs in plain compatibility mode. It would
be nice to either have a non-grouped command:

  def plaincompatibility =
    scantokens plain_compatibity_data ;
  enddef ;

Or maybe even a higher-level switch:

  \defineMPinstance
    [fun-with-old-MP]
    [metafun]
    [compatibility=plain] %% default* | plain

> As I wouldn't be surprised if there were more differences we need
> to handle.

We will find out if things break.

Marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20130824/4d0fe927/attachment.pgp>


More information about the ntg-context mailing list