Skip to content

Instantly share code, notes, and snippets.

@santhoshtr
Created February 13, 2026 10:04
Show Gist options
  • Select an option

  • Save santhoshtr/f45f7cf5e0b304f075d3c6a20206cf93 to your computer and use it in GitHub Desktop.

Select an option

Save santhoshtr/f45f7cf5e0b304f075d3c6a20206cf93 to your computer and use it in GitHub Desktop.
മല - Calligraphy style #metapost-sandbox
beginfig(0);
nib_width:=100;
nib_thick:=5;
rotation:=45;
pen calligraphypen;
path p;
z0 = (-nib_width/2,0);
z1 = (x0, nib_thick);
z2 = (x1+nib_width, y1);
z3 = (x0+nib_width, y0);
p = z0--z1--z2--z3--cycle;
fill p withcolor green;
calligraphypen = makepen p rotated rotation;
w:=100;
clearxy;
z0 = (x3+w/2, y3+2.5w);
z1 = (x0, y0+2w);
z2 = z1 + w*dir rotation;
z3 = (0, 0);
z4 = (x3+2.5w, y3);
z5 = (x4, y0);
z6 = z5 + 0.1w*dir rotation;
pickup calligraphypen;
p:=z0{dir 80}..z1--z2{dir 335}..{dir (180+rotation)}z3--z4{dir 100}..{dir 80}z5--z6;
draw p withcolor white;
%draw p shifted(10,10) withcolor 0.1white;
%draw p shifted(30,30) withcolor white;
clearxy;
z0 = point infinity of p + (2w, w);
z1 = z0+ 1.5w*dir (rotation+270);
z2 = z1+ w*dir rotation;
z3 = z2 - 3w*dir (rotation+270);
z4 = z3 - w*dir (rotation);
z5 = (x4-0.5w,0);
z6= (x5+4.5w, y5);
z7 = (x6, y3);
z8 = z7 + 0.1w*dir rotation;
p:=z0{dir 270}..z1--z2{dir 90}..z3--z4{dir 280}..{dir 230}z5{dir 10}..{dir -10}z6{dir 100}..{dir 80}z7--z8;
draw p withcolor white;
endfig;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment