define(["Ti/_/declare","Ti/_/dom","Ti/_/lang","Ti/_/ready","Ti/_/style","Ti/_/UI/Widget"],function(t,e,o,i,n,s){var l;return i(function(){l=e.create("p",{style:{position:"absolute",top:"-1000em",left:0,height:"auto",width:"auto"}},document.body)}),t("Ti._.UI.FontWidget",s,{constructor:function(){this._styleableDomNodes=[]},_setFont:function(t,e){if(t){var o=parseInt(t.fontSize);t.fontSize=isNaN(o)?void 0:o+"px",n.set(e,t)}else n.set(e,{fontFamily:"",fontSize:"",fontStyle:"",fontWeight:""})},_addStyleableDomNode:function(t){this._styleableDomNodes.push(t)},_removeStyleableDomNode:function(t){var e=this._styleableDomNodes.indexOf(t);-1!=e&&this._styleableDomNodes.splice(e,1)},_measureText:function(t,i,s){var a=window.getComputedStyle(i)||{},f=this.font||{},r=!t||""===t;return l.innerHTML=r?"Äy":t,this._setFont({fontFamily:f.fontFamily||a.fontFamily||"",fontSize:f.fontSize||a.fontSize||"",fontStyle:f.fontStyle||a.fontStyle||"",fontWeight:f.fontWeight||a.fontWeight||""},l),n.set(l,{whiteSpace:i.style.whiteSpace,width:e.unitize(o.val(s,"auto"))}),{width:r?0:l.clientWidth+.5,height:l.clientHeight}},properties:{color:{set:function(t){for(var e in this._styleableDomNodes)n.set(this._styleableDomNodes[e],"color",t);return t}},font:{set:function(t){for(var e in this._styleableDomNodes)this._setFont(t,this._styleableDomNodes[e]);return t}}}})});