[metapost] Designing Brahmi DDHA

Hans Hagen pragma at wxs.nl
Tue Jul 31 11:50:25 CEST 2012


On 31-7-2012 11:34, Shriramana Sharma wrote:
> Hello list. I have previously posted about my work on palaeographic
> Indic scripts. I'm right now tackling the grandmother of them all --
> Brahmi. Since Brahmi is largely like stick figures (with all due
> respect to King Ashoka) I didn't have the patience to do it the Meta*
> way yet. I clipped glyphs from Senart's Les Inscriptions de Piyadasi
> and drew straight lines on top of them. The few simple curves were not
> an issue, but when I came to DDHA I was stumped because it was the
> only highly-curved glyph and my Inkscape-designed glyph did not look
> good at all. (I still have my suspicions about its age but Indoskript
> says it's from BCE 252 so, well...)
>
> So I had the idea of getting the nodes from Inkscape and making MPost
> draw a "smooth" curve instead and I have to say I am most pleased with
> the results. :-) Thank you all whose work has gone into MPost (and the
> other tools I used)! :-)
>
> Those interested might like to investigate the attached files.
>
> BTW because Inkscape has y values increasing downwards but Mpost has
> them increasing upwards, the final glyph is upside down. (I had to be
> careful with using the directions up/down inside the .mp file because
> of this.) Looking at the MPost manual there doesn't seem to be any
> built-in transform to do "flip vertical" on a path as is found in
> popular vector-drawing applications.
>
> I am thinking of something like:
>
> def flipvertical ( path p )
> 	begingroup ;
> 		numeric pleft, pright, phalfheight ;
> 		phalfheight = ( ypart llcorner p + ypart urcorner p ) / 2 ;
> 		pleft = xpart llcorner p ;
> 		pright = xpart urcorner p ;
> 		p := p reflectedabout ( ( pleft, phalfheight ), ( pright, phalfheight ) ) ;
> 	endgroup ;
> enddef ;
>
> But I am not sure whether the above will work correctly. I think I
> cannot create a transform out of this because a transform must be
> defined even for single points but flip horizontal/vertical are valid
> only for paths with more than one points. Can anyone please help me
> how to implement a flipvertical?

just flip the whole result:

currentpicture := currentpicture reflectedabout (llcorner 
currentpicture,lrcorner currentpicture) ;



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the metapost mailing list