AUI.add("aui-drawing-fonts",function(E){var K=E.Lang,D=K.isString,H=E.Drawing,O=H.prototype,L=function(A){return F[A]||"M";},F={l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"},J={bold:700,bolder:800,lighter:300,normal:400},N=Math,G=N.max,C=N.min,B=/[mlcxtrv]/g,I=H.REGEX_SEPARATOR,M=H.STR_EMPTY;H.registerFont=function(P){if(!P.face){return P;}this.fonts=this.fonts||{};var Y=this.fonts;var W={w:P.w,face:{},glyphs:{}};var R=P.face["font-family"];var T=P.face;var V=W.face;for(var A in T){if(T.hasOwnProperty(A)){V[A]=T[A];}}if(Y[R]){Y[R].push(W);}else{Y[R]=[W];}if(!P.svg){V["units-per-em"]=parseInt(T["units-per-em"],10);for(var U in P.glyphs){if(P.glyphs.hasOwnProperty(U)){var X=P.glyphs[U];var S=X.d;if(S){S=S.replace(B,L);S="M"+S+"z";}W.glyphs[U]={w:X.w,k:{},d:S};if(X.k){for(var Q in X.k){if(X.hasOwnProperty(Q)){W.glyphs[U].k[Q]=X.k[Q];}}}}}}return P;};O.getFont=function(W,X,P,R){var Z=this;R=R||"normal";P=P||"normal";X=+X||J[X]||400;if(!H.fonts){return;}var a=H.fonts;var T=a[W];if(!T){var Q=new RegExp("(^|\\s)"+W.replace(/[^\w\d\s+!~.:_-]/g,M)+"(\\s|$)","i");for(var A in a){if(a.hasOwnProperty(A)){if(Q.test(A)){T=a[A];break;}}}}var U;if(T){var Y;for(var V=0,S=T.length;V<S;V++){U=T[V];Y=U.face;if(Y["font-weight"]==X&&(Y["font-style"]==P||!Y["font-style"])&&Y["font-stretch"]==R){break;}}}return U;};O.print=function(S,R,A,V,W,g,T){var e=this;g=g||"middle";T=G(C(T||0,1),-1);var b=e.createSet();var f=String(A).split(M);var c=0;var Z=M;var h;D(V)&&(V=e.getFont(V));if(V){h=(W||16)/V.face["units-per-em"];var Q=V.face.bbox.split(I);var U=+Q[0];var X=+Q[1]+(g=="baseline"?Q[3]-Q[1]+(+V.face.descent):(Q[3]-Q[1])/2);for(var a=0,P=f.length;a<P;a++){var Y=a&&V.glyphs[f[a-1]]||{};var d=V.glyphs[f[a]];c+=a?(Y.w||V.w)+(Y.k&&Y.k[f[a]]||0)+(V.w*T):0;d&&d.d&&b.push(e.path(d.d).attr({fill:"#000",stroke:"none",translation:[c,0]}));}b.scale(h,h,U,X).translate(S-U,R-X);}return b;};},"1.0.1",{requires:["aui-drawing-base"]});