[NTG-context] New to metapost, could use some help with first steps

Gerben Wierda gerben.wierda at rna.nl
Sun Feb 2 11:51:02 CET 2020

Hans was so kind to help me with a setup for some generated output. I am trying to understand every line of his example so I can expand on his exmaple to make it fully functional. In his example there is:

context('draw textext("\\framed[frame=off,offset=5bp,align={middle,lohi,verytolerant,broad},width=%sbp]{%s}") shifted center AllNodes[%i] ;',w,name,i)

as command to draw a node and the node type is defined like this:
context("save ApplicationComponent ; path ApplicationComponent ; ApplicationComponent := unitsquare ; ") 

For a quick example this works, but ‘unitsquare’ is a simple thing. How do I create a more complex shape that is reusable? What if I would like the path to be like this:

With this as the complex behaviour of the shape
The font size scaled so the label fits inside the image (choice yes/no)
The small boxes sized according to the font size or sized according to the box size (choice text/box)
The bounding box following the actual complex outline
The upper of the two small boxes in line with the upper text line (in case the size is coupled to the text size)
The colour of the background a default colour or given as parameter

This is one of the more complex shapes, if I can do this one it might give me enough information to define all the other ones. Sorry to bother all of you but the learning curve is steep and I always have not enough time.

Gerben Wierda
Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
Architecture for Real Enterprises <https://www.infoworld.com/blog/architecture-for-real-enterprises/> at InfoWorld
On Slippery Ice <https://eapj.org/on-slippery-ice/> at EAPJ

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200202/7dba76b8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 19290 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200202/7dba76b8/attachment-0001.png>

More information about the ntg-context mailing list