Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

aui-drawing-fonts-min.js 1.9KB

1
  1. AUI.add("aui-drawing-fonts",function(d){var j=d.Lang,c=j.isString,g=d.Drawing,n=g.prototype,k=function(o){return e[o]||"M";},e={l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"},i={bold:700,bolder:800,lighter:300,normal:400},m=Math,f=m.max,b=m.min,a=/[mlcxtrv]/g,h=g.REGEX_SEPARATOR,l=g.STR_EMPTY;g.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 o in t){if(t.hasOwnProperty(o)){v[o]=t[o];}}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(a,k);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;};n.getFont=function(w,x,p,r){var z=this;r=r||"normal";p=p||"normal";x=+x||i[x]||400;if(!g.fonts){return;}var A=g.fonts;var t=A[w];if(!t){var q=new RegExp("(^|\\s)"+w.replace(/[^\w\d\s+!~.:_-]/g,l)+"(\\s|$)","i");for(var o in A){if(A.hasOwnProperty(o)){if(q.test(o)){t=A[o];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;};n.print=function(s,r,o,v,w,I,t){var G=this;I=I||"middle";t=f(b(t||0,1),-1);var D=G.createSet();var H=String(o).split(l);var E=0;var B=l;var J;c(v)&&(v=G.getFont(v));if(v){J=(w||16)/v.face["units-per-em"];var q=v.face.bbox.split(h);var u=+q[0];var z=+q[1]+(I=="baseline"?q[3]-q[1]+(+v.face.descent):(q[3]-q[1])/2);for(var C=0,p=H.length;C<p;C++){var A=C&&v.glyphs[H[C-1]]||{};var F=v.glyphs[H[C]];E+=C?(A.w||v.w)+(A.k&&A.k[H[C]]||0)+(v.w*t):0;F&&F.d&&D.push(G.path(F.d).attr({fill:"#000",stroke:"none",translation:[E,0]}));}D.scale(J,J,u,z).translate(s-u,r-z);}return D;};},"@VERSION@",{requires:["aui-drawing-base"]});