Skip to content

Instantly share code, notes, and snippets.

@boredzo
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boredzo/6fe77dc16c850f1630d7 to your computer and use it in GitHub Desktop.
Save boredzo/6fe77dc16c850f1630d7 to your computer and use it in GitHub Desktop.
Demonstration of how to draw a speech balloon tail, based on advice in http://stackoverflow.com/a/16782469/30461 .
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 120 260
/pt1 { 20 100 } def
/pt2 { 60 80 } def
/pt5 { 100 60 } def
/pt3 { 20 20 } def
/pt4 { 60 40 } def
/yoffset { 30 add } def
/labelpts {
/Helvetica 5 selectfont
pt1 moveto (1) show
pt2 yoffset moveto (2) show
pt3 moveto (3) show
pt4 yoffset moveto (4) show
pt5 moveto (5) show
} def
gsave
% CoDEFRo's code: http://stackoverflow.com/q/16763695/30461
0 120 translate
labelpts
pt1 moveto
pt1 pt2 yoffset pt5 curveto
pt3 pt4 yoffset pt5 curveto
closepath
stroke
grestore
labelpts
pt1 moveto
pt2 yoffset pt5 pt5 curveto
pt4 yoffset pt3 pt3 curveto
%closepath
stroke
showpage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment