Mercurial > laserkard
diff js-lib/buy3.js @ 102:8ed3394e6b73 laserkard
wrote comment-killer
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 27 Jul 2010 22:23:13 -0400 |
parents | 595866daadbe |
children | 52297178e0eb |
line wrap: on
line diff
1.1 --- a/js-lib/buy3.js Tue Jul 27 08:39:43 2010 -0400 1.2 +++ b/js-lib/buy3.js Tue Jul 27 22:23:13 2010 -0400 1.3 @@ -15,16 +15,23 @@ 1.4 var h = paper.height; 1.5 var w = paper.width; 1.6 1.7 + var standard = (function (text, x, y, pt, font){ 1.8 + if (!font) {font = helvetica;} 1.9 + var scale_x = 0.00030*h*pt/20; 1.10 + var scale_y = 0.00025*w*pt/20; 1.11 + return paper.print(h*x, w*y,text, font).scale( 1.12 + scale_x,scale_y,h*x,w*y);}); 1.13 + 1.14 + var bold = { 1.15 + "name" :(function (text){ 1.16 + return standard(text, 0.2,0.1,20).attr({"fill" : "red"});}), 1.17 + "email" : (function (text){ 1.18 + return standard(text, 0.2,0.4,20,helveticaI).attr( 1.19 + {"fill" : "red"});})}; 1.20 + 1.21 + 1.22 return { 1.23 - "bold" : { 1.24 - "name" :(function (text){ 1.25 - var x = w*0.1; var y = h*0.2; 1.26 - return paper.print(x,y,text,helvetica).attr( 1.27 - {"fill" : "red"}).scale(0.0002*h,0.00025*w,x,y);}), 1.28 - "email" : (function (text){ 1.29 - var x = w*0.1; var y = h*0.4; 1.30 - return paper.print(x,y,text,helveticaI).attr( 1.31 - {"fill" : "red"}).scale(0.0002*h,0.00025*w,x,y);})} 1.32 + "bold" : bold 1.33 }; 1.34 1.35 });