ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* New to metapost, could use some help with  first steps
@ 2020-02-02 10:51 Gerben Wierda
  0 siblings, 0 replies; only message in thread
From: Gerben Wierda @ 2020-02-02 10:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1741 bytes --]

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


[-- Attachment #1.2.1: Type: text/html, Size: 4390 bytes --]

[-- Attachment #1.2.2: PastedGraphic-1.png --]
[-- Type: image/png, Size: 19290 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-02 10:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02 10:51 New to metapost, could use some help with first steps Gerben Wierda

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).