remove bcurve_pt and bline_pt classes
[PyX/mjg.git] / manual / arrows.py
blob739bd8fcafb8e79d3409ea184a7ef1f901fcbd86
1 #!/usr/bin/env python
2 import sys
3 sys.path[:0] = [".."]
4 from pyx import *
6 c = canvas.canvas()
7 t = tex.latex()
8 t.define(r"\renewcommand{\familydefault}{\ttdefault}")
10 # positioning is quite ugly ... but it works at the moment
11 x = 0
12 y = 0
13 dx = 6
14 dy = -0.65
15 length = 0.8
17 def drawdeco(name, showpath=0, default=0):
18 global x,y
19 p = path.path(path.moveto(x + 0.1, y+0.1 ),
20 path.rlineto(length/2.0, 0.3),
21 path.rlineto(length/2.0, -0.3))
22 c.stroke(p, [style.linewidth.THIck, eval("deco."+name)])
23 if showpath:
24 c.stroke(p, [style.linewidth.Thin, color.gray.white])
25 if default:
26 name = name + r"\rm\quad (default)"
27 t.text(x + 1.5, y + 0.15, name, tex.fontsize.footnotesize)
28 y += dy
29 if y < -16:
30 y = 0
31 x += dx
33 drawdeco("earrow.SMall")
34 drawdeco("earrow.Small")
35 drawdeco("earrow.small")
36 drawdeco("earrow.normal")
37 drawdeco("earrow.large")
38 drawdeco("earrow.Large")
39 drawdeco("earrow.LArge")
41 y += dy
43 drawdeco("barrow.normal")
45 y += dy
47 drawdeco("earrow.Large([deco.filled([color.rgb.red]), style.linewidth.normal])")
48 drawdeco("earrow.normal(constriction=0)")
49 drawdeco("earrow.Large([style.linejoin.round])")
50 drawdeco("earrow.Large([deco.stroked.clear])")
52 c.insert(t)
53 c.writetofile("arrows")