Hi all, first, best wishes for the New Year to all of you - may 2009 bring peace and fortune and world domination for ConTeXt! And my little question - trivial for the resident experts, I guess, but I can't find a solution: I want to write a little macro that will allow me to place a thin curved line under letters (metrical symbol for synizesis). Now that metafun is so fast in mkiv, I thought I'd use a MPpositiongraphic for that purpose, but my problem is that I can't make the graphic really local - when it is used more than once in a document, Metafin uses the last values for all occurrences. I tried grouping and the "save" command, but to no avail. Here's an example that shows the problem: \startMPpositiongraphic{placesynizesis} StartPage ; begingroup ; save a ; initialize_box(\MPpos{\MPvar{self}}) ; numeric a ; a = ExHeight/6 ; z1 = llxy ; z2 = lrxy ; z3 = 1/2[z1,z2] ; z4 = ((x1 + 2a),(y1 - 2a)) ; z5 = (x3, (y3 - 4a)) ; z6 = ((x2 - 2a),(y2 - 2a)) ; path syn ; syn := z4 .. z5 .. z6 ; pickup pencircle scaled a ; draw syn ; anchor_box(\MPanchor{\MPvar{self}}) ; endgroup ; StopPage ; \stopMPpositiongraphic% \setMPpositiongraphic{POS}{placesynizesis} \define[1]\synizesis {\hpos{POS}{#1}} \starttext \switchtobodyfont[25pt] test: \synizesis{au} and \synizesis{aeiou} \stoptext Any solution to this conundrum? All best Thomas
Am 03.01.2009 um 15:02 schrieb Thomas A. Schmitz:
Hi all,
first, best wishes for the New Year to all of you - may 2009 bring peace and fortune and world domination for ConTeXt!
And my little question - trivial for the resident experts, I guess, but I can't find a solution: I want to write a little macro that will allow me to place a thin curved line under letters (metrical symbol for synizesis). Now that metafun is so fast in mkiv, I thought I'd use a MPpositiongraphic for that purpose, but my problem is that I can't make the graphic really local - when it is used more than once in a document, Metafin uses the last values for all occurrences. I tried grouping and the "save" command, but to no avail. Here's an example that shows the problem:
\startMPpositiongraphic{placesynizesis} StartPage ; begingroup ; save a ; initialize_box(\MPpos{\MPvar{self}}) ; numeric a ; a = ExHeight/6 ; z1 = llxy ; z2 = lrxy ; z3 = 1/2[z1,z2] ; z4 = ((x1 + 2a),(y1 - 2a)) ; z5 = (x3, (y3 - 4a)) ; z6 = ((x2 - 2a),(y2 - 2a)) ; path syn ; syn := z4 .. z5 .. z6 ; pickup pencircle scaled a ; draw syn ; anchor_box(\MPanchor{\MPvar{self}}) ; endgroup ; StopPage ; \stopMPpositiongraphic% \setMPpositiongraphic{POS}{placesynizesis}
\define[1]\synizesis {\hpos{POS}{#1}}
\starttext
\switchtobodyfont[25pt]
test: \synizesis{au} and \synizesis{aeiou}
\stoptext
Any solution to this conundrum?
\newcount\synizesisnumber \define[1]\synizesis {\advance\synizesisnumber\plusone \setMPpositiongraphic{POS-\number\synizesisnumber}{placesynizesis} \hpos{POS-\number\synizesisnumber}{#1}} Wolfgang
On Jan 3, 2009, at 3:26 PM, Wolfgang Schuster wrote:
\newcount\synizesisnumber
\define[1]\synizesis {\advance\synizesisnumber\plusone \setMPpositiongraphic{POS-\number\synizesisnumber}{placesynizesis} \hpos{POS-\number\synizesisnumber}{#1}}
Wolfgang
Wow - so simple, and so efficient! Wolfgang, you were my hero in 2008, and you'll be my hero in 2009! Thanks a lot! Thomas
participants (2)
-
Thomas A. Schmitz
-
Wolfgang Schuster