diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-08 18:41:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-08 18:41:28 +0000 |
commit | a3358f7394e3adabeff44a4858bab8f13cbe1180 (patch) | |
tree | 014354d566c06a47c483b7231af921247180f770 /Master/texmf-dist/asymptote/plain_Label.asy | |
parent | 11bcd1a52098dab6ac5baa790409a2261a31755f (diff) |
asymptote 2.21
git-svn-id: svn://tug.org/texlive/trunk@29753 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/plain_Label.asy')
-rw-r--r-- | Master/texmf-dist/asymptote/plain_Label.asy | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Master/texmf-dist/asymptote/plain_Label.asy b/Master/texmf-dist/asymptote/plain_Label.asy index a559ae88298..1e424ab1c0a 100644 --- a/Master/texmf-dist/asymptote/plain_Label.asy +++ b/Master/texmf-dist/asymptote/plain_Label.asy @@ -212,6 +212,9 @@ embed Rotate(pair z) { warn=false));}; } +path[] texpath(string s, pen p, bool tex=settings.tex != "none", + bool bbox=false); + struct Label { string s,size; position position; @@ -289,8 +292,11 @@ struct Label { void label(frame f, transform t=identity(), pair position, pair align) { pen p0=p == nullpen ? currentpen : p; align=length(align)*unit(rotation(t)*align); - label(f,s,size,embed(t)*shiftless(T), - t*position+align*labelmargin(p0)+shift(T)*0,align,p0); + pair S=t*position+align*labelmargin(p0)+shift(T)*0; + if(settings.tex != "none") + label(f,s,size,embed(t)*shiftless(T),S,align,p0); + else + fill(f,align(texpath(s,p0),S,align,p0),p0); } void out(frame f, transform t=identity(), pair position=position.position, @@ -352,8 +358,10 @@ struct Label { if(p != nullpen) write(file,", pen=",p); if(!defaulttransform) write(file,", transform=",T); - if(!defaulttransform3) + if(!defaulttransform3) { + write(file,", transform3=",endl); write(file,T3); + } write(file,"",suffix); } @@ -579,7 +587,7 @@ path[] texpath(Label L, bool tex=settings.tex != "none", bool bbox=false) void operator init(Label L) { - s=L.s; + s=replace(L.s,'\n',' '); fontsize=fontsize(L.p); font=font(L.p); } @@ -667,3 +675,8 @@ path[] texpath(Label L, bool tex=settings.tex != "none", bool bbox=false) return transform(pathcache[search(stringcache,stringfont(L),lexorder)],L); } + +texpath=new path[](string s, pen p, bool tex=settings.tex != "none", bool bbox=false) +{ + return texpath(Label(s,p)); +}; |