New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/text-bitmap

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/text-bitmap - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

6

dist/browser/text-bitmap.min.js
/*!
* @pixi/text-bitmap - v6.0.0
* Compiled Tue, 02 Mar 2021 21:45:03 UTC
* @pixi/text-bitmap - v6.0.1
* Compiled Wed, 24 Mar 2021 20:02:24 UTC
*

@@ -8,3 +8,3 @@ * @pixi/text-bitmap is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_text_bitmap=function(t,e,r,i,n,a,s,o,h){"use strict";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var u=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),f=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var o in a){var h=a[o].split("="),l=h[0],f=h[1].replace(/"/gm,""),c=parseFloat(f),p=isNaN(c)?f:c;s[l]=p}r[n].push(s)}var g=new u;return r.info.forEach(function(t){return g.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return g.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return g.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return g.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return g.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),g},t}(),c=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new u,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),o=0;o<r.length;o++)e.info.push({face:r[o].getAttribute("face"),size:parseInt(r[o].getAttribute("size"),10)});for(o=0;o<i.length;o++)e.common.push({lineHeight:parseInt(i[o].getAttribute("lineHeight"),10)});for(o=0;o<n.length;o++)e.page.push({id:parseInt(n[o].getAttribute("id"),10)||0,file:n[o].getAttribute("file")});for(o=0;o<a.length;o++){var h=a[o];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(o=0;o<s.length;o++)e.kerning.push({first:parseInt(s[o].getAttribute("first"),10),second:parseInt(s[o].getAttribute("second"),10),amount:parseInt(s[o].getAttribute("amount"),10)});return e},t}(),p=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return c.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return c.parse(e)},t}(),g=[f,c,p];function d(t){for(var e=0;e<g.length;e++)if(g[e].test(t))return g[e];return null}function v(t,e,r,i,n,a){var o,h=r.fill;if(!Array.isArray(h))return h;if(1===h.length)return h[0];var l=r.dropShadow?r.dropShadowDistance:0,u=r.padding||0,f=Math.ceil(t.width/i)-l-2*u,c=Math.ceil(t.height/i)-l-2*u,p=h.slice(),g=r.fillGradientStops.slice();if(!g.length)for(var d=p.length+1,v=1;v<d;++v)g.push(v/d);if(p.unshift(h[0]),g.unshift(0),p.push(h[h.length-1]),g.push(1),r.fillGradientType===s.TEXT_GRADIENT.LINEAR_VERTICAL){o=e.createLinearGradient(f/2,u,f/2,c+u);var x=0,m=(a.fontProperties.fontSize+r.strokeThickness)/c;for(v=0;v<n.length;v++)for(var y=a.lineHeight*v,b=0;b<p.length;b++){var _=y/c+("number"==typeof g[b]?g[b]:b/p.length)*m,w=Math.max(x,_);w=Math.min(w,1),o.addColorStop(w,p[b]),x=w}}else{o=e.createLinearGradient(u,c/2,f+u,c/2);var I=p.length+1,A=1;for(v=0;v<p.length;v++){var T=void 0;T="number"==typeof g[v]?g[v]:A/I,o.addColorStop(T,p[v]),A++}}return o}function x(t,e,r,i,a,s,o){var h=r.text,l=r.fontProperties;e.translate(i,a),e.scale(s,s);var u=o.strokeThickness/2,f=-o.strokeThickness/2;e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=v(t,e,o,s,[h],r),e.strokeStyle=o.stroke,e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=v(t,e,o,s,[h],r),e.strokeStyle=o.stroke;var c=o.dropShadowColor,p=n.hex2rgb("number"==typeof c?c:n.string2hex(c));o.dropShadow?(e.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[2]+","+o.dropShadowAlpha+")",e.shadowBlur=o.dropShadowBlur,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*o.dropShadowDistance,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*o.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),o.stroke&&o.strokeThickness&&e.strokeText(h,u,f+r.lineHeight-l.descent),o.fill&&e.fillText(h,u,f+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var m=function(){function t(t,r){var i=t.info[0],s=t.common[0],o=t.page[0],h=n.getResolutionOfUrl(o.file),l={};this.font=i.face,this.size=i.size,this.lineHeight=s.lineHeight/h,this.chars={},this.pageTextures=l;for(var u=0;u<t.page.length;u++){var f=t.page[u],c=f.id,p=f.file;l[c]=r instanceof Array?r[u]:r[p]}for(u=0;u<t.char.length;u++){var g=t.char[u],d=(c=g.id,g.page),v=t.char[u],x=v.x,m=v.y,y=v.width,b=v.height,_=v.xoffset,w=v.yoffset,I=v.xadvance;x/=h,m/=h,y/=h,b/=h,_/=h,w/=h,I/=h;var A=new e.Rectangle(x+l[d].frame.x/h,m+l[d].frame.y/h,y,b);this.chars[c]={xOffset:_,yOffset:w,xAdvance:I,kerning:{},texture:new a.Texture(l[d].baseTexture,A),page:d}}for(u=0;u<t.kerning.length;u++){var T=t.kerning[u],S=T.first,P=T.second,O=T.amount;S/=h,P/=h,O/=h,this.chars[P]&&(this.chars[P].kerning[S]=O)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r){var i;if(e instanceof u)i=e;else{var n=d(e);if(!n)throw new Error("Unrecognized data format for font.");i=n.parse(e)}r instanceof a.Texture&&(r=[r]);var s=new t(i,r);return t.available[s.font]=s,s},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),o=n.chars,h=n.padding,l=n.resolution,f=n.textureWidth,c=n.textureHeight,p=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,h=s;o<=h;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),g=r instanceof s.TextStyle?r:new s.TextStyle(r),d=f,v=new u;v.info[0]={face:g.fontFamily,size:g.fontSize},v.common[0]={lineHeight:g.fontSize};for(var m,y,b,_=0,w=0,I=0,A=[],T=[],S=0;S<p.length;S++){m||((m=document.createElement("canvas")).width=f,m.height=c,y=m.getContext("2d"),b=new a.BaseTexture(m,{resolution:l}),A.push(b),T.push(new a.Texture(b)),v.page.push({id:T.length-1,file:""}));var P=s.TextMetrics.measureText(p[S],g,!1,m),O=P.width,E=Math.ceil(P.height),M=Math.ceil(("italic"===g.fontStyle?2:1)*O);if(w>=c-E*l){if(0===w)throw new Error("[BitmapFont] textureHeight "+c+"px is too small for "+g.fontSize+"px fonts");--S,m=null,y=null,b=null,w=0,_=0,I=0}else if(I=Math.max(E+P.fontProperties.descent,I),M*l+_>=d)--S,w+=I*l,w=Math.ceil(w),_=0,I=0;else{x(m,y,P,_,w,l,g);var k=P.text.charCodeAt(0);v.char.push({id:k,page:T.length-1,x:_/l,y:w/l,width:M,height:E,xoffset:0,yoffset:0,xadvance:Math.ceil(O-(g.dropShadow?g.dropShadowDistance:0)-(g.stroke?g.strokeThickness:0))}),_+=(M+2*h)*l,_=Math.ceil(_)}}S=0;for(var C=p.length;S<C;S++)for(var B=p[S],H=0;H<C;H++){var z=p[H],L=y.measureText(B).width,N=y.measureText(z).width,F=y.measureText(B+z).width-(L+N);F&&v.kerning.push({first:B.charCodeAt(0),second:z.charCodeAt(0),amount:F})}var j=new t(v,T);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=j,j},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),y=[],b=[],_=function(t){function s(i,n){void 0===n&&(n={});var a=t.call(this)||this;a._tint=16777215;var o=Object.assign({},s.styleDefaults,n),h=o.align,l=o.tint,u=o.maxWidth,f=o.letterSpacing,c=o.fontName,p=o.fontSize;if(!m.available[c])throw new Error('Missing BitmapFont "'+c+'"');return a._activePagesMeshData=[],a._textWidth=0,a._textHeight=0,a._align=h,a._tint=l,a._fontName=c,a._fontSize=p||m.available[c].size,a._text=i,a._maxWidth=u,a._maxLineHeight=0,a._letterSpacing=f,a._anchor=new e.ObservablePoint(function(){a.dirty=!0},a,0,0),a._roundPixels=r.settings.ROUND_PIXELS,a.dirty=!0,a._textureCache={},a}return function(t,e){function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(s,t),s.prototype.updateText=function(){for(var t,r=m.available[this._fontName],s=this._fontSize/r.size,o=new e.Point,h=[],l=[],u=[],f=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",c=f.length,p=this._maxWidth*r.size/this._fontSize,g=null,d=0,v=0,x=0,_=-1,w=0,I=0,A=0,T=0,S=0;S<c;S++){var P=f.charCodeAt(S),O=f.charAt(S);if(/(?:\s)/.test(O)&&(_=S,w=d,T++),"\r"!==O&&"\n"!==O){var E=r.chars[P];if(E){g&&E.kerning[g]&&(o.x+=E.kerning[g]);var M=b.pop()||{texture:a.Texture.EMPTY,line:0,charCode:0,prevSpaces:0,position:new e.Point};M.texture=E.texture,M.line=x,M.charCode=P,M.position.x=o.x+E.xOffset+this._letterSpacing/2,M.position.y=o.y+E.yOffset,M.prevSpaces=T,h.push(M),o.x+=E.xAdvance+this._letterSpacing,d=o.x,A=Math.max(A,E.yOffset+E.texture.height),g=P,-1!==_&&p>0&&o.x>p&&(++I,n.removeItems(h,1+_-I,1+S-_),S=_,_=-1,l.push(w),u.push(h.length>0?h[h.length-1].prevSpaces:0),v=Math.max(v,w),x++,o.x=0,o.y+=r.lineHeight,g=null,T=0)}}else l.push(d),u.push(-1),v=Math.max(v,d),++x,++I,o.x=0,o.y+=r.lineHeight,g=null,T=0}var k=f.charAt(f.length-1);"\r"!==k&&"\n"!==k&&(/(?:\s)/.test(k)&&(d=w),l.push(d),v=Math.max(v,d),u.push(-1));var C=[];for(S=0;S<=x;S++){var B=0;"right"===this._align?B=v-l[S]:"center"===this._align?B=(v-l[S])/2:"justify"===this._align&&(B=u[S]<0?0:(v-l[S])/u[S]),C.push(B)}var H=h.length,z={},L=[],N=this._activePagesMeshData;for(S=0;S<N.length;S++)y.push(N[S]);for(S=0;S<H;S++){var F=(J=h[S].texture).baseTexture.uid;if(!z[F]){if(!(tt=y.pop())){var j=new i.MeshGeometry,D=new i.MeshMaterial(a.Texture.EMPTY);tt={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new i.Mesh(j,D),vertices:null,uvs:null,indices:null}}tt.index=0,tt.indexCount=0,tt.vertexCount=0,tt.uvsCount=0,tt.total=0;var X=this._textureCache;X[F]=X[F]||new a.Texture(J.baseTexture),tt.mesh.texture=X[F],tt.mesh.tint=this._tint,L.push(tt),z[F]=tt}z[F].total++}for(S=0;S<N.length;S++)-1===L.indexOf(N[S])&&this.removeChild(N[S].mesh);for(S=0;S<L.length;S++)L[S].mesh.parent!==this&&this.addChild(L[S].mesh);for(var S in this._activePagesMeshData=L,z){var W=(tt=z[S]).total;if(!((null===(t=tt.indices)||void 0===t?void 0:t.length)>6*W)||tt.vertices.length<2*i.Mesh.BATCHABLE_SIZE)tt.vertices=new Float32Array(8*W),tt.uvs=new Float32Array(8*W),tt.indices=new Uint16Array(6*W);else for(var U=tt.total,R=tt.vertices,G=4*U*2;G<R.length;G++)R[G]=0;tt.mesh.size=6*W}for(S=0;S<H;S++){var Y=(O=h[S]).position.x+C[O.line]*("justify"===this._align?O.prevSpaces:1);this._roundPixels&&(Y=Math.round(Y));var J,Z=Y*s,$=O.position.y*s,V=z[(J=O.texture).baseTexture.uid],q=J.frame,K=J._uvs,Q=V.index++;V.indices[6*Q+0]=0+4*Q,V.indices[6*Q+1]=1+4*Q,V.indices[6*Q+2]=2+4*Q,V.indices[6*Q+3]=0+4*Q,V.indices[6*Q+4]=2+4*Q,V.indices[6*Q+5]=3+4*Q,V.vertices[8*Q+0]=Z,V.vertices[8*Q+1]=$,V.vertices[8*Q+2]=Z+q.width*s,V.vertices[8*Q+3]=$,V.vertices[8*Q+4]=Z+q.width*s,V.vertices[8*Q+5]=$+q.height*s,V.vertices[8*Q+6]=Z,V.vertices[8*Q+7]=$+q.height*s,V.uvs[8*Q+0]=K.x0,V.uvs[8*Q+1]=K.y0,V.uvs[8*Q+2]=K.x1,V.uvs[8*Q+3]=K.y1,V.uvs[8*Q+4]=K.x2,V.uvs[8*Q+5]=K.y2,V.uvs[8*Q+6]=K.x3,V.uvs[8*Q+7]=K.y3}for(var S in this._textWidth=v*s,this._textHeight=(o.y+r.lineHeight)*s,z){var tt=z[S];if(0!==this.anchor.x||0!==this.anchor.y)for(var et=0,rt=this._textWidth*this.anchor.x,it=this._textHeight*this.anchor.y,nt=0;nt<tt.total;nt++)tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it;this._maxLineHeight=A*s;var at=tt.mesh.geometry.getBuffer("aVertexPosition"),st=tt.mesh.geometry.getBuffer("aTextureCoord"),ot=tt.mesh.geometry.getIndex();at.data=tt.vertices,st.data=tt.uvs,ot.data=tt.indices,at.update(),st.update(),ot.update()}for(S=0;S<h.length;S++)b.push(h[S])},s.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},s.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},s.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(s.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!m.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),s.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},s.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},s}(o.Container),w=function(){function t(){}return t.add=function(){h.LoaderResource.setExtensionXhrType("fnt",h.LoaderResource.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=d(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),s={},o=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===a.page.length&&(e.bitmapFont=m.install(a,s),r())},l=0;l<a.page.length;++l){var u=a.page[l].file,f=n+u,c=!1;for(var p in this.resources){var g=this.resources[p];if(g.url===f){g.metadata.pageFile=u,g.texture?o(g):g.onAfterMiddleware.add(o),c=!0;break}}if(!c){var v={crossOrigin:e.crossOrigin,loadType:h.LoaderResource.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(f,v,o)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();return t.BitmapFont=m,t.BitmapFontData=u,t.BitmapFontLoader=w,t.BitmapText=_,t}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_text_bitmap);
this.PIXI=this.PIXI||{};var _pixi_text_bitmap=function(t,e,r,i,n,a,s,o,h){"use strict";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var u=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),f=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var o in a){var h=a[o].split("="),l=h[0],f=h[1].replace(/"/gm,""),c=parseFloat(f),p=isNaN(c)?f:c;s[l]=p}r[n].push(s)}var g=new u;return r.info.forEach(function(t){return g.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return g.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return g.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return g.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return g.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),g},t}(),c=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new u,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),o=0;o<r.length;o++)e.info.push({face:r[o].getAttribute("face"),size:parseInt(r[o].getAttribute("size"),10)});for(o=0;o<i.length;o++)e.common.push({lineHeight:parseInt(i[o].getAttribute("lineHeight"),10)});for(o=0;o<n.length;o++)e.page.push({id:parseInt(n[o].getAttribute("id"),10)||0,file:n[o].getAttribute("file")});for(o=0;o<a.length;o++){var h=a[o];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(o=0;o<s.length;o++)e.kerning.push({first:parseInt(s[o].getAttribute("first"),10),second:parseInt(s[o].getAttribute("second"),10),amount:parseInt(s[o].getAttribute("amount"),10)});return e},t}(),p=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return c.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return c.parse(e)},t}(),g=[f,c,p];function d(t){for(var e=0;e<g.length;e++)if(g[e].test(t))return g[e];return null}function v(t,e,r,i,n,a){var o,h=r.fill;if(!Array.isArray(h))return h;if(1===h.length)return h[0];var l=r.dropShadow?r.dropShadowDistance:0,u=r.padding||0,f=Math.ceil(t.width/i)-l-2*u,c=Math.ceil(t.height/i)-l-2*u,p=h.slice(),g=r.fillGradientStops.slice();if(!g.length)for(var d=p.length+1,v=1;v<d;++v)g.push(v/d);if(p.unshift(h[0]),g.unshift(0),p.push(h[h.length-1]),g.push(1),r.fillGradientType===s.TEXT_GRADIENT.LINEAR_VERTICAL){o=e.createLinearGradient(f/2,u,f/2,c+u);var x=0,m=(a.fontProperties.fontSize+r.strokeThickness)/c;for(v=0;v<n.length;v++)for(var y=a.lineHeight*v,_=0;_<p.length;_++){var b=y/c+("number"==typeof g[_]?g[_]:_/p.length)*m,w=Math.max(x,b);w=Math.min(w,1),o.addColorStop(w,p[_]),x=w}}else{o=e.createLinearGradient(u,c/2,f+u,c/2);var I=p.length+1,T=1;for(v=0;v<p.length;v++){var A=void 0;A="number"==typeof g[v]?g[v]:T/I,o.addColorStop(A,p[v]),T++}}return o}function x(t,e,r,i,a,s,o){var h=r.text,l=r.fontProperties;e.translate(i,a),e.scale(s,s);var u=o.strokeThickness/2,f=-o.strokeThickness/2;e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=v(t,e,o,s,[h],r),e.strokeStyle=o.stroke,e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=v(t,e,o,s,[h],r),e.strokeStyle=o.stroke;var c=o.dropShadowColor,p=n.hex2rgb("number"==typeof c?c:n.string2hex(c));o.dropShadow?(e.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[2]+","+o.dropShadowAlpha+")",e.shadowBlur=o.dropShadowBlur,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*o.dropShadowDistance,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*o.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),o.stroke&&o.strokeThickness&&e.strokeText(h,u,f+r.lineHeight-l.descent),o.fill&&e.fillText(h,u,f+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var m=function(){function t(t,r,i){var s=t.info[0],o=t.common[0],h=t.page[0],l=n.getResolutionOfUrl(h.file),u={};this._ownsTextures=i,this.font=s.face,this.size=s.size,this.lineHeight=o.lineHeight/l,this.chars={},this.pageTextures=u;for(var f=0;f<t.page.length;f++){var c=t.page[f],p=c.id,g=c.file;u[p]=r instanceof Array?r[f]:r[g]}for(f=0;f<t.char.length;f++){var d=t.char[f],v=(p=d.id,d.page),x=t.char[f],m=x.x,y=x.y,_=x.width,b=x.height,w=x.xoffset,I=x.yoffset,T=x.xadvance;m/=l,y/=l,_/=l,b/=l,w/=l,I/=l,T/=l;var A=new e.Rectangle(m+u[v].frame.x/l,y+u[v].frame.y/l,_,b);this.chars[p]={xOffset:w,yOffset:I,xAdvance:T,kerning:{},texture:new a.Texture(u[v].baseTexture,A),page:v}}for(f=0;f<t.kerning.length;f++){var S=t.kerning[f],P=S.first,O=S.second,E=S.amount;P/=l,O/=l,E/=l,this.chars[O]&&(this.chars[O].kerning[P]=E)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r,i){var n;if(e instanceof u)n=e;else{var s=d(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}r instanceof a.Texture&&(r=[r]);var o=new t(n,r,i);return t.available[o.font]=o,o},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),o=n.chars,h=n.padding,l=n.resolution,f=n.textureWidth,c=n.textureHeight,p=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,h=s;o<=h;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),g=r instanceof s.TextStyle?r:new s.TextStyle(r),d=f,v=new u;v.info[0]={face:g.fontFamily,size:g.fontSize},v.common[0]={lineHeight:g.fontSize};for(var m,y,_,b=0,w=0,I=0,T=[],A=[],S=0;S<p.length;S++){m||((m=document.createElement("canvas")).width=f,m.height=c,y=m.getContext("2d"),_=new a.BaseTexture(m,{resolution:l}),T.push(_),A.push(new a.Texture(_)),v.page.push({id:A.length-1,file:""}));var P=s.TextMetrics.measureText(p[S],g,!1,m),O=P.width,E=Math.ceil(P.height),M=Math.ceil(("italic"===g.fontStyle?2:1)*O);if(w>=c-E*l){if(0===w)throw new Error("[BitmapFont] textureHeight "+c+"px is too small for "+g.fontSize+"px fonts");--S,m=null,y=null,_=null,w=0,b=0,I=0}else if(I=Math.max(E+P.fontProperties.descent,I),M*l+b>=d)--S,w+=I*l,w=Math.ceil(w),b=0,I=0;else{x(m,y,P,b,w,l,g);var k=P.text.charCodeAt(0);v.char.push({id:k,page:A.length-1,x:b/l,y:w/l,width:M,height:E,xoffset:0,yoffset:0,xadvance:Math.ceil(O-(g.dropShadow?g.dropShadowDistance:0)-(g.stroke?g.strokeThickness:0))}),b+=(M+2*h)*l,b=Math.ceil(b)}}S=0;for(var C=p.length;S<C;S++)for(var B=p[S],H=0;H<C;H++){var z=p[H],L=y.measureText(B).width,N=y.measureText(z).width,F=y.measureText(B+z).width-(L+N);F&&v.kerning.push({first:B.charCodeAt(0),second:z.charCodeAt(0),amount:F})}var j=new t(v,A,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=j,j},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),y=[],_=[],b=function(t){function s(i,n){void 0===n&&(n={});var a=t.call(this)||this;a._tint=16777215;var o=Object.assign({},s.styleDefaults,n),h=o.align,l=o.tint,u=o.maxWidth,f=o.letterSpacing,c=o.fontName,p=o.fontSize;if(!m.available[c])throw new Error('Missing BitmapFont "'+c+'"');return a._activePagesMeshData=[],a._textWidth=0,a._textHeight=0,a._align=h,a._tint=l,a._fontName=c,a._fontSize=p||m.available[c].size,a._text=i,a._maxWidth=u,a._maxLineHeight=0,a._letterSpacing=f,a._anchor=new e.ObservablePoint(function(){a.dirty=!0},a,0,0),a._roundPixels=r.settings.ROUND_PIXELS,a.dirty=!0,a._textureCache={},a}return function(t,e){function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(s,t),s.prototype.updateText=function(){for(var t,r=m.available[this._fontName],s=this._fontSize/r.size,o=new e.Point,h=[],l=[],u=[],f=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",c=f.length,p=this._maxWidth*r.size/this._fontSize,g=null,d=0,v=0,x=0,b=-1,w=0,I=0,T=0,A=0,S=0;S<c;S++){var P=f.charCodeAt(S),O=f.charAt(S);if(/(?:\s)/.test(O)&&(b=S,w=d,A++),"\r"!==O&&"\n"!==O){var E=r.chars[P];if(E){g&&E.kerning[g]&&(o.x+=E.kerning[g]);var M=_.pop()||{texture:a.Texture.EMPTY,line:0,charCode:0,prevSpaces:0,position:new e.Point};M.texture=E.texture,M.line=x,M.charCode=P,M.position.x=o.x+E.xOffset+this._letterSpacing/2,M.position.y=o.y+E.yOffset,M.prevSpaces=A,h.push(M),o.x+=E.xAdvance+this._letterSpacing,d=o.x,T=Math.max(T,E.yOffset+E.texture.height),g=P,-1!==b&&p>0&&o.x>p&&(++I,n.removeItems(h,1+b-I,1+S-b),S=b,b=-1,l.push(w),u.push(h.length>0?h[h.length-1].prevSpaces:0),v=Math.max(v,w),x++,o.x=0,o.y+=r.lineHeight,g=null,A=0)}}else l.push(d),u.push(-1),v=Math.max(v,d),++x,++I,o.x=0,o.y+=r.lineHeight,g=null,A=0}var k=f.charAt(f.length-1);"\r"!==k&&"\n"!==k&&(/(?:\s)/.test(k)&&(d=w),l.push(d),v=Math.max(v,d),u.push(-1));var C=[];for(S=0;S<=x;S++){var B=0;"right"===this._align?B=v-l[S]:"center"===this._align?B=(v-l[S])/2:"justify"===this._align&&(B=u[S]<0?0:(v-l[S])/u[S]),C.push(B)}var H=h.length,z={},L=[],N=this._activePagesMeshData;for(S=0;S<N.length;S++)y.push(N[S]);for(S=0;S<H;S++){var F=(J=h[S].texture).baseTexture.uid;if(!z[F]){if(!(tt=y.pop())){var j=new i.MeshGeometry,D=new i.MeshMaterial(a.Texture.EMPTY);tt={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new i.Mesh(j,D),vertices:null,uvs:null,indices:null}}tt.index=0,tt.indexCount=0,tt.vertexCount=0,tt.uvsCount=0,tt.total=0;var X=this._textureCache;X[F]=X[F]||new a.Texture(J.baseTexture),tt.mesh.texture=X[F],tt.mesh.tint=this._tint,L.push(tt),z[F]=tt}z[F].total++}for(S=0;S<N.length;S++)-1===L.indexOf(N[S])&&this.removeChild(N[S].mesh);for(S=0;S<L.length;S++)L[S].mesh.parent!==this&&this.addChild(L[S].mesh);for(var S in this._activePagesMeshData=L,z){var W=(tt=z[S]).total;if(!((null===(t=tt.indices)||void 0===t?void 0:t.length)>6*W)||tt.vertices.length<2*i.Mesh.BATCHABLE_SIZE)tt.vertices=new Float32Array(8*W),tt.uvs=new Float32Array(8*W),tt.indices=new Uint16Array(6*W);else for(var U=tt.total,R=tt.vertices,G=4*U*2;G<R.length;G++)R[G]=0;tt.mesh.size=6*W}for(S=0;S<H;S++){var Y=(O=h[S]).position.x+C[O.line]*("justify"===this._align?O.prevSpaces:1);this._roundPixels&&(Y=Math.round(Y));var J,Z=Y*s,$=O.position.y*s,V=z[(J=O.texture).baseTexture.uid],q=J.frame,K=J._uvs,Q=V.index++;V.indices[6*Q+0]=0+4*Q,V.indices[6*Q+1]=1+4*Q,V.indices[6*Q+2]=2+4*Q,V.indices[6*Q+3]=0+4*Q,V.indices[6*Q+4]=2+4*Q,V.indices[6*Q+5]=3+4*Q,V.vertices[8*Q+0]=Z,V.vertices[8*Q+1]=$,V.vertices[8*Q+2]=Z+q.width*s,V.vertices[8*Q+3]=$,V.vertices[8*Q+4]=Z+q.width*s,V.vertices[8*Q+5]=$+q.height*s,V.vertices[8*Q+6]=Z,V.vertices[8*Q+7]=$+q.height*s,V.uvs[8*Q+0]=K.x0,V.uvs[8*Q+1]=K.y0,V.uvs[8*Q+2]=K.x1,V.uvs[8*Q+3]=K.y1,V.uvs[8*Q+4]=K.x2,V.uvs[8*Q+5]=K.y2,V.uvs[8*Q+6]=K.x3,V.uvs[8*Q+7]=K.y3}for(var S in this._textWidth=v*s,this._textHeight=(o.y+r.lineHeight)*s,z){var tt=z[S];if(0!==this.anchor.x||0!==this.anchor.y)for(var et=0,rt=this._textWidth*this.anchor.x,it=this._textHeight*this.anchor.y,nt=0;nt<tt.total;nt++)tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it,tt.vertices[et++]-=rt,tt.vertices[et++]-=it;this._maxLineHeight=T*s;var at=tt.mesh.geometry.getBuffer("aVertexPosition"),st=tt.mesh.geometry.getBuffer("aTextureCoord"),ot=tt.mesh.geometry.getIndex();at.data=tt.vertices,st.data=tt.uvs,ot.data=tt.indices,at.update(),st.update(),ot.update()}for(S=0;S<h.length;S++)_.push(h[S])},s.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},s.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},s.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(s.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!m.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),s.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},s.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},s}(o.Container),w=function(){function t(){}return t.add=function(){h.LoaderResource.setExtensionXhrType("fnt",h.LoaderResource.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=d(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),s={},o=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===a.page.length&&(e.bitmapFont=m.install(a,s,!0),r())},l=0;l<a.page.length;++l){var u=a.page[l].file,f=n+u,c=!1;for(var p in this.resources){var g=this.resources[p];if(g.url===f){g.metadata.pageFile=u,g.texture?o(g):g.onAfterMiddleware.add(o),c=!0;break}}if(!c){var v={crossOrigin:e.crossOrigin,loadType:h.LoaderResource.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(f,v,o)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();return t.BitmapFont=m,t.BitmapFontData=u,t.BitmapFontLoader=w,t.BitmapText=b,t}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_text_bitmap);
//# sourceMappingURL=text-bitmap.min.js.map
/*!
* @pixi/text-bitmap - v6.0.0
* Compiled Tue, 02 Mar 2021 21:45:03 UTC
* @pixi/text-bitmap - v6.0.1
* Compiled Wed, 24 Mar 2021 20:02:24 UTC
*

@@ -8,3 +8,3 @@ * @pixi/text-bitmap is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var math=require("@pixi/math"),settings=require("@pixi/settings"),mesh=require("@pixi/mesh"),utils=require("@pixi/utils"),core=require("@pixi/core"),text=require("@pixi/text"),display=require("@pixi/display"),loaders=require("@pixi/loaders"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function __extends(t,e){function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var BitmapFontData=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),TextFormat=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var s in a){var h=a[s].split("="),l=h[0],u=h[1].replace(/"/gm,""),f=parseFloat(u),c=isNaN(f)?u:f;o[l]=c}r[n].push(o)}var p=new BitmapFontData;return r.info.forEach(function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),p},t}(),XMLFormat=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new BitmapFontData,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),s=0;s<r.length;s++)e.info.push({face:r[s].getAttribute("face"),size:parseInt(r[s].getAttribute("size"),10)});for(s=0;s<i.length;s++)e.common.push({lineHeight:parseInt(i[s].getAttribute("lineHeight"),10)});for(s=0;s<n.length;s++)e.page.push({id:parseInt(n[s].getAttribute("id"),10)||0,file:n[s].getAttribute("file")});for(s=0;s<a.length;s++){var h=a[s];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(s=0;s<o.length;s++)e.kerning.push({first:parseInt(o[s].getAttribute("first"),10),second:parseInt(o[s].getAttribute("second"),10),amount:parseInt(o[s].getAttribute("amount"),10)});return e},t}(),XMLStringFormat=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return XMLFormat.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return XMLFormat.parse(e)},t}(),formats=[TextFormat,XMLFormat,XMLStringFormat];function autoDetectFormat(t){for(var e=0;e<formats.length;e++)if(formats[e].test(t))return formats[e];return null}function generateFillStyle(t,e,r,i,n,a){var o,s=r.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];var h=r.dropShadow?r.dropShadowDistance:0,l=r.padding||0,u=Math.ceil(t.width/i)-h-2*l,f=Math.ceil(t.height/i)-h-2*l,c=s.slice(),p=r.fillGradientStops.slice();if(!p.length)for(var g=c.length+1,d=1;d<g;++d)p.push(d/g);if(c.unshift(s[0]),p.unshift(0),c.push(s[s.length-1]),p.push(1),r.fillGradientType===text.TEXT_GRADIENT.LINEAR_VERTICAL){o=e.createLinearGradient(u/2,l,u/2,f+l);var m=0,x=(a.fontProperties.fontSize+r.strokeThickness)/f;for(d=0;d<n.length;d++)for(var v=a.lineHeight*d,y=0;y<c.length;y++){var _=v/f+("number"==typeof p[y]?p[y]:y/c.length)*x,b=Math.max(m,_);b=Math.min(b,1),o.addColorStop(b,c[y]),m=b}}else{o=e.createLinearGradient(l,f/2,u+l,f/2);var w=c.length+1,S=1;for(d=0;d<c.length;d++){var T=void 0;T="number"==typeof p[d]?p[d]:S/w,o.addColorStop(T,c[d]),S++}}return o}function drawGlyph(t,e,r,i,n,a,o){var s=r.text,h=r.fontProperties;e.translate(i,n),e.scale(a,a);var l=o.strokeThickness/2,u=-o.strokeThickness/2;e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=generateFillStyle(t,e,o,a,[s],r),e.strokeStyle=o.stroke,e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=generateFillStyle(t,e,o,a,[s],r),e.strokeStyle=o.stroke;var f=o.dropShadowColor,c=utils.hex2rgb("number"==typeof f?f:utils.string2hex(f));o.dropShadow?(e.shadowColor="rgba("+255*c[0]+","+255*c[1]+","+255*c[2]+","+o.dropShadowAlpha+")",e.shadowBlur=o.dropShadowBlur,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*o.dropShadowDistance,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*o.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),o.stroke&&o.strokeThickness&&e.strokeText(s,l,u+r.lineHeight-h.descent),o.fill&&e.fillText(s,l,u+r.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function resolveCharacters(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),o=n[1].charCodeAt(0);if(o<a)throw new Error("[BitmapFont]: Invalid character range.");for(var s=a,h=o;s<=h;s++)e.push(String.fromCharCode(s))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var BitmapFont=function(){function t(t,e){var r=t.info[0],i=t.common[0],n=t.page[0],a=utils.getResolutionOfUrl(n.file),o={};this.font=r.face,this.size=r.size,this.lineHeight=i.lineHeight/a,this.chars={},this.pageTextures=o;for(var s=0;s<t.page.length;s++){var h=t.page[s],l=h.id,u=h.file;o[l]=e instanceof Array?e[s]:e[u]}for(s=0;s<t.char.length;s++){var f=t.char[s],c=(l=f.id,f.page),p=t.char[s],g=p.x,d=p.y,m=p.width,x=p.height,v=p.xoffset,y=p.yoffset,_=p.xadvance;g/=a,d/=a,m/=a,x/=a,v/=a,y/=a,_/=a;var b=new math.Rectangle(g+o[c].frame.x/a,d+o[c].frame.y/a,m,x);this.chars[l]={xOffset:v,yOffset:y,xAdvance:_,kerning:{},texture:new core.Texture(o[c].baseTexture,b),page:c}}for(s=0;s<t.kerning.length;s++){var w=t.kerning[s],S=w.first,T=w.second,A=w.amount;S/=a,T/=a,A/=a,this.chars[T]&&(this.chars[T].kerning[S]=A)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r){var i;if(e instanceof BitmapFontData)i=e;else{var n=autoDetectFormat(e);if(!n)throw new Error("Unrecognized data format for font.");i=n.parse(e)}r instanceof core.Texture&&(r=[r]);var a=new t(i,r);return t.available[a.font]=a,a},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),a=n.chars,o=n.padding,s=n.resolution,h=n.textureWidth,l=n.textureHeight,u=resolveCharacters(a),f=r instanceof text.TextStyle?r:new text.TextStyle(r),c=h,p=new BitmapFontData;p.info[0]={face:f.fontFamily,size:f.fontSize},p.common[0]={lineHeight:f.fontSize};for(var g,d,m,x=0,v=0,y=0,_=[],b=0;b<u.length;b++){g||((g=document.createElement("canvas")).width=h,g.height=l,d=g.getContext("2d"),m=new core.BaseTexture(g,{resolution:s}),_.push(new core.Texture(m)),p.page.push({id:_.length-1,file:""}));var w=text.TextMetrics.measureText(u[b],f,!1,g),S=w.width,T=Math.ceil(w.height),A=Math.ceil(("italic"===f.fontStyle?2:1)*S);if(v>=l-T*s){if(0===v)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+f.fontSize+"px fonts");--b,g=null,d=null,m=null,v=0,x=0,y=0}else if(y=Math.max(T+w.fontProperties.descent,y),A*s+x>=c)--b,v+=y*s,v=Math.ceil(v),x=0,y=0;else{drawGlyph(g,d,w,x,v,s,f);var F=w.text.charCodeAt(0);p.char.push({id:F,page:_.length-1,x:x/s,y:v/s,width:A,height:T,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),x+=(A+2*o)*s,x=Math.ceil(x)}}b=0;for(var B=u.length;b<B;b++)for(var M=u[b],P=0;P<B;P++){var I=u[P],O=d.measureText(M).width,E=d.measureText(I).width,k=d.measureText(M+I).width-(O+E);k&&p.kerning.push({first:M.charCodeAt(0),second:I.charCodeAt(0),amount:k})}var C=new t(p,_);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=C,C},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),pageMeshDataPool=[],charRenderDataPool=[],BitmapText=function(t){function e(r,i){void 0===i&&(i={});var n=t.call(this)||this;n._tint=16777215;var a=Object.assign({},e.styleDefaults,i),o=a.align,s=a.tint,h=a.maxWidth,l=a.letterSpacing,u=a.fontName,f=a.fontSize;if(!BitmapFont.available[u])throw new Error('Missing BitmapFont "'+u+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=o,n._tint=s,n._fontName=u,n._fontSize=f||BitmapFont.available[u].size,n._text=r,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=l,n._anchor=new math.ObservablePoint(function(){n.dirty=!0},n,0,0),n._roundPixels=settings.settings.ROUND_PIXELS,n.dirty=!0,n._textureCache={},n}return __extends(e,t),e.prototype.updateText=function(){for(var t,e=BitmapFont.available[this._fontName],r=this._fontSize/e.size,i=new math.Point,n=[],a=[],o=[],s=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",h=s.length,l=this._maxWidth*e.size/this._fontSize,u=null,f=0,c=0,p=0,g=-1,d=0,m=0,x=0,v=0,y=0;y<h;y++){var _=s.charCodeAt(y),b=s.charAt(y);if(/(?:\s)/.test(b)&&(g=y,d=f,v++),"\r"!==b&&"\n"!==b){var w=e.chars[_];if(w){u&&w.kerning[u]&&(i.x+=w.kerning[u]);var S=charRenderDataPool.pop()||{texture:core.Texture.EMPTY,line:0,charCode:0,prevSpaces:0,position:new math.Point};S.texture=w.texture,S.line=p,S.charCode=_,S.position.x=i.x+w.xOffset+this._letterSpacing/2,S.position.y=i.y+w.yOffset,S.prevSpaces=v,n.push(S),i.x+=w.xAdvance+this._letterSpacing,f=i.x,x=Math.max(x,w.yOffset+w.texture.height),u=_,-1!==g&&l>0&&i.x>l&&(++m,utils.removeItems(n,1+g-m,1+y-g),y=g,g=-1,a.push(d),o.push(n.length>0?n[n.length-1].prevSpaces:0),c=Math.max(c,d),p++,i.x=0,i.y+=e.lineHeight,u=null,v=0)}}else a.push(f),o.push(-1),c=Math.max(c,f),++p,++m,i.x=0,i.y+=e.lineHeight,u=null,v=0}var T=s.charAt(s.length-1);"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(f=d),a.push(f),c=Math.max(c,f),o.push(-1));var A=[];for(y=0;y<=p;y++){var F=0;"right"===this._align?F=c-a[y]:"center"===this._align?F=(c-a[y])/2:"justify"===this._align&&(F=o[y]<0?0:(c-a[y])/o[y]),A.push(F)}var B=n.length,M={},P=[],I=this._activePagesMeshData;for(y=0;y<I.length;y++)pageMeshDataPool.push(I[y]);for(y=0;y<B;y++){var O=(j=n[y].texture).baseTexture.uid;if(!M[O]){if(!(Y=pageMeshDataPool.pop())){var E=new mesh.MeshGeometry,k=new mesh.MeshMaterial(core.Texture.EMPTY);Y={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new mesh.Mesh(E,k),vertices:null,uvs:null,indices:null}}Y.index=0,Y.indexCount=0,Y.vertexCount=0,Y.uvsCount=0,Y.total=0;var C=this._textureCache;C[O]=C[O]||new core.Texture(j.baseTexture),Y.mesh.texture=C[O],Y.mesh.tint=this._tint,P.push(Y),M[O]=Y}M[O].total++}for(y=0;y<I.length;y++)-1===P.indexOf(I[y])&&this.removeChild(I[y].mesh);for(y=0;y<P.length;y++)P[y].mesh.parent!==this&&this.addChild(P[y].mesh);for(var y in this._activePagesMeshData=P,M){var D=(Y=M[y]).total;if(!((null===(t=Y.indices)||void 0===t?void 0:t.length)>6*D)||Y.vertices.length<2*mesh.Mesh.BATCHABLE_SIZE)Y.vertices=new Float32Array(8*D),Y.uvs=new Float32Array(8*D),Y.indices=new Uint16Array(6*D);else for(var L=Y.total,H=Y.vertices,z=4*L*2;z<H.length;z++)H[z]=0;Y.mesh.size=6*D}for(y=0;y<B;y++){var N=(b=n[y]).position.x+A[b.line]*("justify"===this._align?b.prevSpaces:1);this._roundPixels&&(N=Math.round(N));var j,R=N*r,W=b.position.y*r,U=M[(j=b.texture).baseTexture.uid],X=j.frame,q=j._uvs,G=U.index++;U.indices[6*G+0]=0+4*G,U.indices[6*G+1]=1+4*G,U.indices[6*G+2]=2+4*G,U.indices[6*G+3]=0+4*G,U.indices[6*G+4]=2+4*G,U.indices[6*G+5]=3+4*G,U.vertices[8*G+0]=R,U.vertices[8*G+1]=W,U.vertices[8*G+2]=R+X.width*r,U.vertices[8*G+3]=W,U.vertices[8*G+4]=R+X.width*r,U.vertices[8*G+5]=W+X.height*r,U.vertices[8*G+6]=R,U.vertices[8*G+7]=W+X.height*r,U.uvs[8*G+0]=q.x0,U.uvs[8*G+1]=q.y0,U.uvs[8*G+2]=q.x1,U.uvs[8*G+3]=q.y1,U.uvs[8*G+4]=q.x2,U.uvs[8*G+5]=q.y2,U.uvs[8*G+6]=q.x3,U.uvs[8*G+7]=q.y3}for(var y in this._textWidth=c*r,this._textHeight=(i.y+e.lineHeight)*r,M){var Y=M[y];if(0!==this.anchor.x||0!==this.anchor.y)for(var J=0,Z=this._textWidth*this.anchor.x,$=this._textHeight*this.anchor.y,V=0;V<Y.total;V++)Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$;this._maxLineHeight=x*r;var K=Y.mesh.geometry.getBuffer("aVertexPosition"),Q=Y.mesh.geometry.getBuffer("aTextureCoord"),tt=Y.mesh.geometry.getIndex();K.data=Y.vertices,Q.data=Y.uvs,tt.data=Y.indices,K.update(),Q.update(),tt.update()}for(y=0;y<n.length;y++)charRenderDataPool.push(n[y])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!BitmapFont.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(display.Container),BitmapFontLoader=function(){function t(){}return t.add=function(){loaders.LoaderResource.setExtensionXhrType("fnt",loaders.LoaderResource.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=autoDetectFormat(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),o={},s=function(t){o[t.metadata.pageFile]=t.texture,Object.keys(o).length===a.page.length&&(e.bitmapFont=BitmapFont.install(a,o),r())},h=0;h<a.page.length;++h){var l=a.page[h].file,u=n+l,f=!1;for(var c in this.resources){var p=this.resources[c];if(p.url===u){p.metadata.pageFile=l,p.texture?s(p):p.onAfterMiddleware.add(s),f=!0;break}}if(!f){var g={crossOrigin:e.crossOrigin,loadType:loaders.LoaderResource.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:l},e.metadata.imageMetadata),parentResource:e};this.add(u,g,s)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();exports.BitmapFont=BitmapFont,exports.BitmapFontData=BitmapFontData,exports.BitmapFontLoader=BitmapFontLoader,exports.BitmapText=BitmapText;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var math=require("@pixi/math"),settings=require("@pixi/settings"),mesh=require("@pixi/mesh"),utils=require("@pixi/utils"),core=require("@pixi/core"),text=require("@pixi/text"),display=require("@pixi/display"),loaders=require("@pixi/loaders"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function __extends(t,e){function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var BitmapFontData=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),TextFormat=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var s in a){var h=a[s].split("="),l=h[0],u=h[1].replace(/"/gm,""),f=parseFloat(u),c=isNaN(f)?u:f;o[l]=c}r[n].push(o)}var p=new BitmapFontData;return r.info.forEach(function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),p},t}(),XMLFormat=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new BitmapFontData,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),s=0;s<r.length;s++)e.info.push({face:r[s].getAttribute("face"),size:parseInt(r[s].getAttribute("size"),10)});for(s=0;s<i.length;s++)e.common.push({lineHeight:parseInt(i[s].getAttribute("lineHeight"),10)});for(s=0;s<n.length;s++)e.page.push({id:parseInt(n[s].getAttribute("id"),10)||0,file:n[s].getAttribute("file")});for(s=0;s<a.length;s++){var h=a[s];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(s=0;s<o.length;s++)e.kerning.push({first:parseInt(o[s].getAttribute("first"),10),second:parseInt(o[s].getAttribute("second"),10),amount:parseInt(o[s].getAttribute("amount"),10)});return e},t}(),XMLStringFormat=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return XMLFormat.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return XMLFormat.parse(e)},t}(),formats=[TextFormat,XMLFormat,XMLStringFormat];function autoDetectFormat(t){for(var e=0;e<formats.length;e++)if(formats[e].test(t))return formats[e];return null}function generateFillStyle(t,e,r,i,n,a){var o,s=r.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];var h=r.dropShadow?r.dropShadowDistance:0,l=r.padding||0,u=Math.ceil(t.width/i)-h-2*l,f=Math.ceil(t.height/i)-h-2*l,c=s.slice(),p=r.fillGradientStops.slice();if(!p.length)for(var g=c.length+1,d=1;d<g;++d)p.push(d/g);if(c.unshift(s[0]),p.unshift(0),c.push(s[s.length-1]),p.push(1),r.fillGradientType===text.TEXT_GRADIENT.LINEAR_VERTICAL){o=e.createLinearGradient(u/2,l,u/2,f+l);var m=0,x=(a.fontProperties.fontSize+r.strokeThickness)/f;for(d=0;d<n.length;d++)for(var v=a.lineHeight*d,y=0;y<c.length;y++){var _=v/f+("number"==typeof p[y]?p[y]:y/c.length)*x,b=Math.max(m,_);b=Math.min(b,1),o.addColorStop(b,c[y]),m=b}}else{o=e.createLinearGradient(l,f/2,u+l,f/2);var w=c.length+1,S=1;for(d=0;d<c.length;d++){var T=void 0;T="number"==typeof p[d]?p[d]:S/w,o.addColorStop(T,c[d]),S++}}return o}function drawGlyph(t,e,r,i,n,a,o){var s=r.text,h=r.fontProperties;e.translate(i,n),e.scale(a,a);var l=o.strokeThickness/2,u=-o.strokeThickness/2;e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=generateFillStyle(t,e,o,a,[s],r),e.strokeStyle=o.stroke,e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=generateFillStyle(t,e,o,a,[s],r),e.strokeStyle=o.stroke;var f=o.dropShadowColor,c=utils.hex2rgb("number"==typeof f?f:utils.string2hex(f));o.dropShadow?(e.shadowColor="rgba("+255*c[0]+","+255*c[1]+","+255*c[2]+","+o.dropShadowAlpha+")",e.shadowBlur=o.dropShadowBlur,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*o.dropShadowDistance,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*o.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),o.stroke&&o.strokeThickness&&e.strokeText(s,l,u+r.lineHeight-h.descent),o.fill&&e.fillText(s,l,u+r.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function resolveCharacters(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),o=n[1].charCodeAt(0);if(o<a)throw new Error("[BitmapFont]: Invalid character range.");for(var s=a,h=o;s<=h;s++)e.push(String.fromCharCode(s))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var BitmapFont=function(){function t(t,e,r){var i=t.info[0],n=t.common[0],a=t.page[0],o=utils.getResolutionOfUrl(a.file),s={};this._ownsTextures=r,this.font=i.face,this.size=i.size,this.lineHeight=n.lineHeight/o,this.chars={},this.pageTextures=s;for(var h=0;h<t.page.length;h++){var l=t.page[h],u=l.id,f=l.file;s[u]=e instanceof Array?e[h]:e[f]}for(h=0;h<t.char.length;h++){var c=t.char[h],p=(u=c.id,c.page),g=t.char[h],d=g.x,m=g.y,x=g.width,v=g.height,y=g.xoffset,_=g.yoffset,b=g.xadvance;d/=o,m/=o,x/=o,v/=o,y/=o,_/=o,b/=o;var w=new math.Rectangle(d+s[p].frame.x/o,m+s[p].frame.y/o,x,v);this.chars[u]={xOffset:y,yOffset:_,xAdvance:b,kerning:{},texture:new core.Texture(s[p].baseTexture,w),page:p}}for(h=0;h<t.kerning.length;h++){var S=t.kerning[h],T=S.first,A=S.second,F=S.amount;T/=o,A/=o,F/=o,this.chars[A]&&(this.chars[A].kerning[T]=F)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r,i){var n;if(e instanceof BitmapFontData)n=e;else{var a=autoDetectFormat(e);if(!a)throw new Error("Unrecognized data format for font.");n=a.parse(e)}r instanceof core.Texture&&(r=[r]);var o=new t(n,r,i);return t.available[o.font]=o,o},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),a=n.chars,o=n.padding,s=n.resolution,h=n.textureWidth,l=n.textureHeight,u=resolveCharacters(a),f=r instanceof text.TextStyle?r:new text.TextStyle(r),c=h,p=new BitmapFontData;p.info[0]={face:f.fontFamily,size:f.fontSize},p.common[0]={lineHeight:f.fontSize};for(var g,d,m,x=0,v=0,y=0,_=[],b=0;b<u.length;b++){g||((g=document.createElement("canvas")).width=h,g.height=l,d=g.getContext("2d"),m=new core.BaseTexture(g,{resolution:s}),_.push(new core.Texture(m)),p.page.push({id:_.length-1,file:""}));var w=text.TextMetrics.measureText(u[b],f,!1,g),S=w.width,T=Math.ceil(w.height),A=Math.ceil(("italic"===f.fontStyle?2:1)*S);if(v>=l-T*s){if(0===v)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+f.fontSize+"px fonts");--b,g=null,d=null,m=null,v=0,x=0,y=0}else if(y=Math.max(T+w.fontProperties.descent,y),A*s+x>=c)--b,v+=y*s,v=Math.ceil(v),x=0,y=0;else{drawGlyph(g,d,w,x,v,s,f);var F=w.text.charCodeAt(0);p.char.push({id:F,page:_.length-1,x:x/s,y:v/s,width:A,height:T,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),x+=(A+2*o)*s,x=Math.ceil(x)}}b=0;for(var B=u.length;b<B;b++)for(var M=u[b],P=0;P<B;P++){var I=u[P],O=d.measureText(M).width,E=d.measureText(I).width,k=d.measureText(M+I).width-(O+E);k&&p.kerning.push({first:M.charCodeAt(0),second:I.charCodeAt(0),amount:k})}var C=new t(p,_,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=C,C},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),pageMeshDataPool=[],charRenderDataPool=[],BitmapText=function(t){function e(r,i){void 0===i&&(i={});var n=t.call(this)||this;n._tint=16777215;var a=Object.assign({},e.styleDefaults,i),o=a.align,s=a.tint,h=a.maxWidth,l=a.letterSpacing,u=a.fontName,f=a.fontSize;if(!BitmapFont.available[u])throw new Error('Missing BitmapFont "'+u+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=o,n._tint=s,n._fontName=u,n._fontSize=f||BitmapFont.available[u].size,n._text=r,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=l,n._anchor=new math.ObservablePoint(function(){n.dirty=!0},n,0,0),n._roundPixels=settings.settings.ROUND_PIXELS,n.dirty=!0,n._textureCache={},n}return __extends(e,t),e.prototype.updateText=function(){for(var t,e=BitmapFont.available[this._fontName],r=this._fontSize/e.size,i=new math.Point,n=[],a=[],o=[],s=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",h=s.length,l=this._maxWidth*e.size/this._fontSize,u=null,f=0,c=0,p=0,g=-1,d=0,m=0,x=0,v=0,y=0;y<h;y++){var _=s.charCodeAt(y),b=s.charAt(y);if(/(?:\s)/.test(b)&&(g=y,d=f,v++),"\r"!==b&&"\n"!==b){var w=e.chars[_];if(w){u&&w.kerning[u]&&(i.x+=w.kerning[u]);var S=charRenderDataPool.pop()||{texture:core.Texture.EMPTY,line:0,charCode:0,prevSpaces:0,position:new math.Point};S.texture=w.texture,S.line=p,S.charCode=_,S.position.x=i.x+w.xOffset+this._letterSpacing/2,S.position.y=i.y+w.yOffset,S.prevSpaces=v,n.push(S),i.x+=w.xAdvance+this._letterSpacing,f=i.x,x=Math.max(x,w.yOffset+w.texture.height),u=_,-1!==g&&l>0&&i.x>l&&(++m,utils.removeItems(n,1+g-m,1+y-g),y=g,g=-1,a.push(d),o.push(n.length>0?n[n.length-1].prevSpaces:0),c=Math.max(c,d),p++,i.x=0,i.y+=e.lineHeight,u=null,v=0)}}else a.push(f),o.push(-1),c=Math.max(c,f),++p,++m,i.x=0,i.y+=e.lineHeight,u=null,v=0}var T=s.charAt(s.length-1);"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(f=d),a.push(f),c=Math.max(c,f),o.push(-1));var A=[];for(y=0;y<=p;y++){var F=0;"right"===this._align?F=c-a[y]:"center"===this._align?F=(c-a[y])/2:"justify"===this._align&&(F=o[y]<0?0:(c-a[y])/o[y]),A.push(F)}var B=n.length,M={},P=[],I=this._activePagesMeshData;for(y=0;y<I.length;y++)pageMeshDataPool.push(I[y]);for(y=0;y<B;y++){var O=(j=n[y].texture).baseTexture.uid;if(!M[O]){if(!(Y=pageMeshDataPool.pop())){var E=new mesh.MeshGeometry,k=new mesh.MeshMaterial(core.Texture.EMPTY);Y={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new mesh.Mesh(E,k),vertices:null,uvs:null,indices:null}}Y.index=0,Y.indexCount=0,Y.vertexCount=0,Y.uvsCount=0,Y.total=0;var C=this._textureCache;C[O]=C[O]||new core.Texture(j.baseTexture),Y.mesh.texture=C[O],Y.mesh.tint=this._tint,P.push(Y),M[O]=Y}M[O].total++}for(y=0;y<I.length;y++)-1===P.indexOf(I[y])&&this.removeChild(I[y].mesh);for(y=0;y<P.length;y++)P[y].mesh.parent!==this&&this.addChild(P[y].mesh);for(var y in this._activePagesMeshData=P,M){var D=(Y=M[y]).total;if(!((null===(t=Y.indices)||void 0===t?void 0:t.length)>6*D)||Y.vertices.length<2*mesh.Mesh.BATCHABLE_SIZE)Y.vertices=new Float32Array(8*D),Y.uvs=new Float32Array(8*D),Y.indices=new Uint16Array(6*D);else for(var L=Y.total,H=Y.vertices,z=4*L*2;z<H.length;z++)H[z]=0;Y.mesh.size=6*D}for(y=0;y<B;y++){var N=(b=n[y]).position.x+A[b.line]*("justify"===this._align?b.prevSpaces:1);this._roundPixels&&(N=Math.round(N));var j,R=N*r,W=b.position.y*r,U=M[(j=b.texture).baseTexture.uid],X=j.frame,q=j._uvs,G=U.index++;U.indices[6*G+0]=0+4*G,U.indices[6*G+1]=1+4*G,U.indices[6*G+2]=2+4*G,U.indices[6*G+3]=0+4*G,U.indices[6*G+4]=2+4*G,U.indices[6*G+5]=3+4*G,U.vertices[8*G+0]=R,U.vertices[8*G+1]=W,U.vertices[8*G+2]=R+X.width*r,U.vertices[8*G+3]=W,U.vertices[8*G+4]=R+X.width*r,U.vertices[8*G+5]=W+X.height*r,U.vertices[8*G+6]=R,U.vertices[8*G+7]=W+X.height*r,U.uvs[8*G+0]=q.x0,U.uvs[8*G+1]=q.y0,U.uvs[8*G+2]=q.x1,U.uvs[8*G+3]=q.y1,U.uvs[8*G+4]=q.x2,U.uvs[8*G+5]=q.y2,U.uvs[8*G+6]=q.x3,U.uvs[8*G+7]=q.y3}for(var y in this._textWidth=c*r,this._textHeight=(i.y+e.lineHeight)*r,M){var Y=M[y];if(0!==this.anchor.x||0!==this.anchor.y)for(var J=0,Z=this._textWidth*this.anchor.x,$=this._textHeight*this.anchor.y,V=0;V<Y.total;V++)Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$,Y.vertices[J++]-=Z,Y.vertices[J++]-=$;this._maxLineHeight=x*r;var K=Y.mesh.geometry.getBuffer("aVertexPosition"),Q=Y.mesh.geometry.getBuffer("aTextureCoord"),tt=Y.mesh.geometry.getIndex();K.data=Y.vertices,Q.data=Y.uvs,tt.data=Y.indices,K.update(),Q.update(),tt.update()}for(y=0;y<n.length;y++)charRenderDataPool.push(n[y])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!BitmapFont.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(display.Container),BitmapFontLoader=function(){function t(){}return t.add=function(){loaders.LoaderResource.setExtensionXhrType("fnt",loaders.LoaderResource.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=autoDetectFormat(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),o={},s=function(t){o[t.metadata.pageFile]=t.texture,Object.keys(o).length===a.page.length&&(e.bitmapFont=BitmapFont.install(a,o,!0),r())},h=0;h<a.page.length;++h){var l=a.page[h].file,u=n+l,f=!1;for(var c in this.resources){var p=this.resources[c];if(p.url===u){p.metadata.pageFile=l,p.texture?s(p):p.onAfterMiddleware.add(s),f=!0;break}}if(!f){var g={crossOrigin:e.crossOrigin,loadType:loaders.LoaderResource.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:l},e.metadata.imageMetadata),parentResource:e};this.add(u,g,s)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();exports.BitmapFont=BitmapFont,exports.BitmapFontData=BitmapFontData,exports.BitmapFontLoader=BitmapFontLoader,exports.BitmapText=BitmapText;
//# sourceMappingURL=text-bitmap.min.js.map
/*!
* @pixi/text-bitmap - v6.0.0
* Compiled Tue, 02 Mar 2021 21:45:03 UTC
* @pixi/text-bitmap - v6.0.1
* Compiled Wed, 24 Mar 2021 20:02:24 UTC
*

@@ -8,3 +8,3 @@ * @pixi/text-bitmap is licensed under the MIT License.

*/
import{Rectangle as t,Point as e,ObservablePoint as r}from"@pixi/math";import{settings as i}from"@pixi/settings";import{MeshGeometry as n,MeshMaterial as a,Mesh as o}from"@pixi/mesh";import{hex2rgb as s,string2hex as h,getResolutionOfUrl as f,removeItems as l}from"@pixi/utils";import{BaseTexture as u,Texture as c}from"@pixi/core";import{TEXT_GRADIENT as p,TextStyle as g,TextMetrics as d}from"@pixi/text";import{Container as m}from"@pixi/display";import{LoaderResource as v}from"@pixi/loaders";var x=function(t,e){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var y=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),b=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var s in a){var h=a[s].split("="),f=h[0],l=h[1].replace(/"/gm,""),u=parseFloat(l),c=isNaN(u)?l:u;o[f]=c}r[n].push(o)}var p=new y;return r.info.forEach(function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),p},t}(),_=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new y,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),s=0;s<r.length;s++)e.info.push({face:r[s].getAttribute("face"),size:parseInt(r[s].getAttribute("size"),10)});for(s=0;s<i.length;s++)e.common.push({lineHeight:parseInt(i[s].getAttribute("lineHeight"),10)});for(s=0;s<n.length;s++)e.page.push({id:parseInt(n[s].getAttribute("id"),10)||0,file:n[s].getAttribute("file")});for(s=0;s<a.length;s++){var h=a[s];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(s=0;s<o.length;s++)e.kerning.push({first:parseInt(o[s].getAttribute("first"),10),second:parseInt(o[s].getAttribute("second"),10),amount:parseInt(o[s].getAttribute("amount"),10)});return e},t}(),w=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return _.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return _.parse(e)},t}(),A=[b,_,w];function S(t){for(var e=0;e<A.length;e++)if(A[e].test(t))return A[e];return null}function T(t,e,r,i,n,a){var o,s=r.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];var h=r.dropShadow?r.dropShadowDistance:0,f=r.padding||0,l=Math.ceil(t.width/i)-h-2*f,u=Math.ceil(t.height/i)-h-2*f,c=s.slice(),g=r.fillGradientStops.slice();if(!g.length)for(var d=c.length+1,m=1;m<d;++m)g.push(m/d);if(c.unshift(s[0]),g.unshift(0),c.push(s[s.length-1]),g.push(1),r.fillGradientType===p.LINEAR_VERTICAL){o=e.createLinearGradient(l/2,f,l/2,u+f);var v=0,x=(a.fontProperties.fontSize+r.strokeThickness)/u;for(m=0;m<n.length;m++)for(var y=a.lineHeight*m,b=0;b<c.length;b++){var _=y/u+("number"==typeof g[b]?g[b]:b/c.length)*x,w=Math.max(v,_);w=Math.min(w,1),o.addColorStop(w,c[b]),v=w}}else{o=e.createLinearGradient(f,u/2,l+f,u/2);var A=c.length+1,S=1;for(m=0;m<c.length;m++){var T=void 0;T="number"==typeof g[m]?g[m]:S/A,o.addColorStop(T,c[m]),S++}}return o}function I(t,e,r,i,n,a,o){var f=r.text,l=r.fontProperties;e.translate(i,n),e.scale(a,a);var u=o.strokeThickness/2,c=-o.strokeThickness/2;e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=T(t,e,o,a,[f],r),e.strokeStyle=o.stroke,e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=T(t,e,o,a,[f],r),e.strokeStyle=o.stroke;var p=o.dropShadowColor,g=s("number"==typeof p?p:h(p));o.dropShadow?(e.shadowColor="rgba("+255*g[0]+","+255*g[1]+","+255*g[2]+","+o.dropShadowAlpha+")",e.shadowBlur=o.dropShadowBlur,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*o.dropShadowDistance,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*o.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),o.stroke&&o.strokeThickness&&e.strokeText(f,u,c+r.lineHeight-l.descent),o.fill&&e.fillText(f,u,c+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var O=function(){function e(e,r){var i=e.info[0],n=e.common[0],a=e.page[0],o=f(a.file),s={};this.font=i.face,this.size=i.size,this.lineHeight=n.lineHeight/o,this.chars={},this.pageTextures=s;for(var h=0;h<e.page.length;h++){var l=e.page[h],u=l.id,p=l.file;s[u]=r instanceof Array?r[h]:r[p]}for(h=0;h<e.char.length;h++){var g=e.char[h],d=(u=g.id,g.page),m=e.char[h],v=m.x,x=m.y,y=m.width,b=m.height,_=m.xoffset,w=m.yoffset,A=m.xadvance;x/=o,y/=o,b/=o,_/=o,w/=o,A/=o;var S=new t((v/=o)+s[d].frame.x/o,x+s[d].frame.y/o,y,b);this.chars[u]={xOffset:_,yOffset:w,xAdvance:A,kerning:{},texture:new c(s[d].baseTexture,S),page:d}}for(h=0;h<e.kerning.length;h++){var T=e.kerning[h],I=T.first,O=T.second,P=T.amount;I/=o,O/=o,P/=o,this.chars[O]&&(this.chars[O].kerning[I]=P)}}return e.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},e.install=function(t,r){var i;if(t instanceof y)i=t;else{var n=S(t);if(!n)throw new Error("Unrecognized data format for font.");i=n.parse(t)}r instanceof c&&(r=[r]);var a=new e(i,r);return e.available[a.font]=a,a},e.uninstall=function(t){var r=e.available[t];if(!r)throw new Error("No font found named '"+t+"'");r.destroy(),delete e.available[t]},e.from=function(t,r,i){if(!t)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},e.defaultOptions,i),a=n.chars,o=n.padding,s=n.resolution,h=n.textureWidth,f=n.textureHeight,l=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),o=n[1].charCodeAt(0);if(o<a)throw new Error("[BitmapFont]: Invalid character range.");for(var s=a,h=o;s<=h;s++)e.push(String.fromCharCode(s))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(a),p=r instanceof g?r:new g(r),m=h,v=new y;v.info[0]={face:p.fontFamily,size:p.fontSize},v.common[0]={lineHeight:p.fontSize};for(var x,b,_,w=0,A=0,S=0,T=[],O=0;O<l.length;O++){x||((x=document.createElement("canvas")).width=h,x.height=f,b=x.getContext("2d"),_=new u(x,{resolution:s}),T.push(new c(_)),v.page.push({id:T.length-1,file:""}));var P=d.measureText(l[O],p,!1,x),E=P.width,k=Math.ceil(P.height),C=Math.ceil(("italic"===p.fontStyle?2:1)*E);if(A>=f-k*s){if(0===A)throw new Error("[BitmapFont] textureHeight "+f+"px is too small for "+p.fontSize+"px fonts");--O,x=null,b=null,_=null,A=0,w=0,S=0}else if(S=Math.max(k+P.fontProperties.descent,S),C*s+w>=m)--O,A+=S*s,A=Math.ceil(A),w=0,S=0;else{I(x,b,P,w,A,s,p);var M=P.text.charCodeAt(0);v.char.push({id:M,page:T.length-1,x:w/s,y:A/s,width:C,height:k,xoffset:0,yoffset:0,xadvance:Math.ceil(E-(p.dropShadow?p.dropShadowDistance:0)-(p.stroke?p.strokeThickness:0))}),w+=(C+2*o)*s,w=Math.ceil(w)}}O=0;for(var H=l.length;O<H;O++)for(var z=l[O],B=0;B<H;B++){var N=l[B],L=b.measureText(z).width,j=b.measureText(N).width,F=b.measureText(z+N).width-(L+j);F&&v.kerning.push({first:z.charCodeAt(0),second:N.charCodeAt(0),amount:F})}var D=new e(v,T);return void 0!==e.available[t]&&e.uninstall(t),e.available[t]=D,D},e.ALPHA=[["a","z"],["A","Z"]," "],e.NUMERIC=[["0","9"]],e.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],e.ASCII=[[" ","~"]],e.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:e.ALPHANUMERIC},e.available={},e}(),P=[],E=[],k=function(t){function s(e,n){void 0===n&&(n={});var a=t.call(this)||this;a._tint=16777215;var o=Object.assign({},s.styleDefaults,n),h=o.align,f=o.tint,l=o.maxWidth,u=o.letterSpacing,c=o.fontName,p=o.fontSize;if(!O.available[c])throw new Error('Missing BitmapFont "'+c+'"');return a._activePagesMeshData=[],a._textWidth=0,a._textHeight=0,a._align=h,a._tint=f,a._fontName=c,a._fontSize=p||O.available[c].size,a._text=e,a._maxWidth=l,a._maxLineHeight=0,a._letterSpacing=u,a._anchor=new r(function(){a.dirty=!0},a,0,0),a._roundPixels=i.ROUND_PIXELS,a.dirty=!0,a._textureCache={},a}return function(t,e){function r(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(s,t),s.prototype.updateText=function(){for(var t,r=O.available[this._fontName],i=this._fontSize/r.size,s=new e,h=[],f=[],u=[],p=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",g=p.length,d=this._maxWidth*r.size/this._fontSize,m=null,v=0,x=0,y=0,b=-1,_=0,w=0,A=0,S=0,T=0;T<g;T++){var I=p.charCodeAt(T),k=p.charAt(T);if(/(?:\s)/.test(k)&&(b=T,_=v,S++),"\r"!==k&&"\n"!==k){var C=r.chars[I];if(C){m&&C.kerning[m]&&(s.x+=C.kerning[m]);var M=E.pop()||{texture:c.EMPTY,line:0,charCode:0,prevSpaces:0,position:new e};M.texture=C.texture,M.line=y,M.charCode=I,M.position.x=s.x+C.xOffset+this._letterSpacing/2,M.position.y=s.y+C.yOffset,M.prevSpaces=S,h.push(M),s.x+=C.xAdvance+this._letterSpacing,v=s.x,A=Math.max(A,C.yOffset+C.texture.height),m=I,-1!==b&&d>0&&s.x>d&&(l(h,1+b-++w,1+T-b),T=b,b=-1,f.push(_),u.push(h.length>0?h[h.length-1].prevSpaces:0),x=Math.max(x,_),y++,s.x=0,s.y+=r.lineHeight,m=null,S=0)}}else f.push(v),u.push(-1),x=Math.max(x,v),++y,++w,s.x=0,s.y+=r.lineHeight,m=null,S=0}var H=p.charAt(p.length-1);"\r"!==H&&"\n"!==H&&(/(?:\s)/.test(H)&&(v=_),f.push(v),x=Math.max(x,v),u.push(-1));var z=[];for(T=0;T<=y;T++){var B=0;"right"===this._align?B=x-f[T]:"center"===this._align?B=(x-f[T])/2:"justify"===this._align&&(B=u[T]<0?0:(x-f[T])/u[T]),z.push(B)}var N=h.length,L={},j=[],F=this._activePagesMeshData;for(T=0;T<F.length;T++)P.push(F[T]);for(T=0;T<N;T++){var D=($=h[T].texture).baseTexture.uid;if(!L[D]){if(!(rt=P.pop())){var W=new n,U=new a(c.EMPTY);rt={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new o(W,U),vertices:null,uvs:null,indices:null}}rt.index=0,rt.indexCount=0,rt.vertexCount=0,rt.uvsCount=0,rt.total=0;var R=this._textureCache;R[D]=R[D]||new c($.baseTexture),rt.mesh.texture=R[D],rt.mesh.tint=this._tint,j.push(rt),L[D]=rt}L[D].total++}for(T=0;T<F.length;T++)-1===j.indexOf(F[T])&&this.removeChild(F[T].mesh);for(T=0;T<j.length;T++)j[T].mesh.parent!==this&&this.addChild(j[T].mesh);for(var T in this._activePagesMeshData=j,L){var X=(rt=L[T]).total;if(!((null===(t=rt.indices)||void 0===t?void 0:t.length)>6*X)||rt.vertices.length<2*o.BATCHABLE_SIZE)rt.vertices=new Float32Array(8*X),rt.uvs=new Float32Array(8*X),rt.indices=new Uint16Array(6*X);else for(var Y=rt.total,G=rt.vertices,J=4*Y*2;J<G.length;J++)G[J]=0;rt.mesh.size=6*X}for(T=0;T<N;T++){var Z=(k=h[T]).position.x+z[k.line]*("justify"===this._align?k.prevSpaces:1);this._roundPixels&&(Z=Math.round(Z));var $,V=Z*i,q=k.position.y*i,K=L[($=k.texture).baseTexture.uid],Q=$.frame,tt=$._uvs,et=K.index++;K.indices[6*et+0]=0+4*et,K.indices[6*et+1]=1+4*et,K.indices[6*et+2]=2+4*et,K.indices[6*et+3]=0+4*et,K.indices[6*et+4]=2+4*et,K.indices[6*et+5]=3+4*et,K.vertices[8*et+0]=V,K.vertices[8*et+1]=q,K.vertices[8*et+2]=V+Q.width*i,K.vertices[8*et+3]=q,K.vertices[8*et+4]=V+Q.width*i,K.vertices[8*et+5]=q+Q.height*i,K.vertices[8*et+6]=V,K.vertices[8*et+7]=q+Q.height*i,K.uvs[8*et+0]=tt.x0,K.uvs[8*et+1]=tt.y0,K.uvs[8*et+2]=tt.x1,K.uvs[8*et+3]=tt.y1,K.uvs[8*et+4]=tt.x2,K.uvs[8*et+5]=tt.y2,K.uvs[8*et+6]=tt.x3,K.uvs[8*et+7]=tt.y3}for(var T in this._textWidth=x*i,this._textHeight=(s.y+r.lineHeight)*i,L){var rt=L[T];if(0!==this.anchor.x||0!==this.anchor.y)for(var it=0,nt=this._textWidth*this.anchor.x,at=this._textHeight*this.anchor.y,ot=0;ot<rt.total;ot++)rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at;this._maxLineHeight=A*i;var st=rt.mesh.geometry.getBuffer("aVertexPosition"),ht=rt.mesh.geometry.getBuffer("aTextureCoord"),ft=rt.mesh.geometry.getIndex();st.data=rt.vertices,ht.data=rt.uvs,ft.data=rt.indices,st.update(),ht.update(),ft.update()}for(T=0;T<h.length;T++)E.push(h[T])},s.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},s.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},s.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(s.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!O.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),s.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},s.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},s}(m),C=function(){function t(){}return t.add=function(){v.setExtensionXhrType("fnt",v.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=S(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),o={},s=function(t){o[t.metadata.pageFile]=t.texture,Object.keys(o).length===a.page.length&&(e.bitmapFont=O.install(a,o),r())},h=0;h<a.page.length;++h){var f=a.page[h].file,l=n+f,u=!1;for(var c in this.resources){var p=this.resources[c];if(p.url===l){p.metadata.pageFile=f,p.texture?s(p):p.onAfterMiddleware.add(s),u=!0;break}}if(!u){var g={crossOrigin:e.crossOrigin,loadType:v.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:f},e.metadata.imageMetadata),parentResource:e};this.add(l,g,s)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();export{O as BitmapFont,y as BitmapFontData,C as BitmapFontLoader,k as BitmapText};
import{Rectangle as t,Point as e,ObservablePoint as r}from"@pixi/math";import{settings as i}from"@pixi/settings";import{MeshGeometry as n,MeshMaterial as a,Mesh as s}from"@pixi/mesh";import{hex2rgb as o,string2hex as h,getResolutionOfUrl as f,removeItems as l}from"@pixi/utils";import{BaseTexture as u,Texture as c}from"@pixi/core";import{TEXT_GRADIENT as p,TextStyle as g,TextMetrics as d}from"@pixi/text";import{Container as m}from"@pixi/display";import{LoaderResource as v}from"@pixi/loaders";var x=function(t,e){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var y=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),b=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var o in a){var h=a[o].split("="),f=h[0],l=h[1].replace(/"/gm,""),u=parseFloat(l),c=isNaN(u)?l:u;s[f]=c}r[n].push(s)}var p=new y;return r.info.forEach(function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),p},t}(),_=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new y,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),o=0;o<r.length;o++)e.info.push({face:r[o].getAttribute("face"),size:parseInt(r[o].getAttribute("size"),10)});for(o=0;o<i.length;o++)e.common.push({lineHeight:parseInt(i[o].getAttribute("lineHeight"),10)});for(o=0;o<n.length;o++)e.page.push({id:parseInt(n[o].getAttribute("id"),10)||0,file:n[o].getAttribute("file")});for(o=0;o<a.length;o++){var h=a[o];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(o=0;o<s.length;o++)e.kerning.push({first:parseInt(s[o].getAttribute("first"),10),second:parseInt(s[o].getAttribute("second"),10),amount:parseInt(s[o].getAttribute("amount"),10)});return e},t}(),w=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return _.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return _.parse(e)},t}(),A=[b,_,w];function S(t){for(var e=0;e<A.length;e++)if(A[e].test(t))return A[e];return null}function T(t,e,r,i,n,a){var s,o=r.fill;if(!Array.isArray(o))return o;if(1===o.length)return o[0];var h=r.dropShadow?r.dropShadowDistance:0,f=r.padding||0,l=Math.ceil(t.width/i)-h-2*f,u=Math.ceil(t.height/i)-h-2*f,c=o.slice(),g=r.fillGradientStops.slice();if(!g.length)for(var d=c.length+1,m=1;m<d;++m)g.push(m/d);if(c.unshift(o[0]),g.unshift(0),c.push(o[o.length-1]),g.push(1),r.fillGradientType===p.LINEAR_VERTICAL){s=e.createLinearGradient(l/2,f,l/2,u+f);var v=0,x=(a.fontProperties.fontSize+r.strokeThickness)/u;for(m=0;m<n.length;m++)for(var y=a.lineHeight*m,b=0;b<c.length;b++){var _=y/u+("number"==typeof g[b]?g[b]:b/c.length)*x,w=Math.max(v,_);w=Math.min(w,1),s.addColorStop(w,c[b]),v=w}}else{s=e.createLinearGradient(f,u/2,l+f,u/2);var A=c.length+1,S=1;for(m=0;m<c.length;m++){var T=void 0;T="number"==typeof g[m]?g[m]:S/A,s.addColorStop(T,c[m]),S++}}return s}function I(t,e,r,i,n,a,s){var f=r.text,l=r.fontProperties;e.translate(i,n),e.scale(a,a);var u=s.strokeThickness/2,c=-s.strokeThickness/2;e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=T(t,e,s,a,[f],r),e.strokeStyle=s.stroke,e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=T(t,e,s,a,[f],r),e.strokeStyle=s.stroke;var p=s.dropShadowColor,g=o("number"==typeof p?p:h(p));s.dropShadow?(e.shadowColor="rgba("+255*g[0]+","+255*g[1]+","+255*g[2]+","+s.dropShadowAlpha+")",e.shadowBlur=s.dropShadowBlur,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*s.dropShadowDistance,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*s.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),s.stroke&&s.strokeThickness&&e.strokeText(f,u,c+r.lineHeight-l.descent),s.fill&&e.fillText(f,u,c+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var O=function(){function e(e,r,i){var n=e.info[0],a=e.common[0],s=e.page[0],o=f(s.file),h={};this._ownsTextures=i,this.font=n.face,this.size=n.size,this.lineHeight=a.lineHeight/o,this.chars={},this.pageTextures=h;for(var l=0;l<e.page.length;l++){var u=e.page[l],p=u.id,g=u.file;h[p]=r instanceof Array?r[l]:r[g]}for(l=0;l<e.char.length;l++){var d=e.char[l],m=(p=d.id,d.page),v=e.char[l],x=v.x,y=v.y,b=v.width,_=v.height,w=v.xoffset,A=v.yoffset,S=v.xadvance;y/=o,b/=o,_/=o,w/=o,A/=o,S/=o;var T=new t((x/=o)+h[m].frame.x/o,y+h[m].frame.y/o,b,_);this.chars[p]={xOffset:w,yOffset:A,xAdvance:S,kerning:{},texture:new c(h[m].baseTexture,T),page:m}}for(l=0;l<e.kerning.length;l++){var I=e.kerning[l],O=I.first,P=I.second,E=I.amount;O/=o,P/=o,E/=o,this.chars[P]&&(this.chars[P].kerning[O]=E)}}return e.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},e.install=function(t,r,i){var n;if(t instanceof y)n=t;else{var a=S(t);if(!a)throw new Error("Unrecognized data format for font.");n=a.parse(t)}r instanceof c&&(r=[r]);var s=new e(n,r,i);return e.available[s.font]=s,s},e.uninstall=function(t){var r=e.available[t];if(!r)throw new Error("No font found named '"+t+"'");r.destroy(),delete e.available[t]},e.from=function(t,r,i){if(!t)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},e.defaultOptions,i),a=n.chars,s=n.padding,o=n.resolution,h=n.textureWidth,f=n.textureHeight,l=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,h=s;o<=h;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(a),p=r instanceof g?r:new g(r),m=h,v=new y;v.info[0]={face:p.fontFamily,size:p.fontSize},v.common[0]={lineHeight:p.fontSize};for(var x,b,_,w=0,A=0,S=0,T=[],O=0;O<l.length;O++){x||((x=document.createElement("canvas")).width=h,x.height=f,b=x.getContext("2d"),_=new u(x,{resolution:o}),T.push(new c(_)),v.page.push({id:T.length-1,file:""}));var P=d.measureText(l[O],p,!1,x),E=P.width,k=Math.ceil(P.height),C=Math.ceil(("italic"===p.fontStyle?2:1)*E);if(A>=f-k*o){if(0===A)throw new Error("[BitmapFont] textureHeight "+f+"px is too small for "+p.fontSize+"px fonts");--O,x=null,b=null,_=null,A=0,w=0,S=0}else if(S=Math.max(k+P.fontProperties.descent,S),C*o+w>=m)--O,A+=S*o,A=Math.ceil(A),w=0,S=0;else{I(x,b,P,w,A,o,p);var M=P.text.charCodeAt(0);v.char.push({id:M,page:T.length-1,x:w/o,y:A/o,width:C,height:k,xoffset:0,yoffset:0,xadvance:Math.ceil(E-(p.dropShadow?p.dropShadowDistance:0)-(p.stroke?p.strokeThickness:0))}),w+=(C+2*s)*o,w=Math.ceil(w)}}O=0;for(var H=l.length;O<H;O++)for(var z=l[O],B=0;B<H;B++){var N=l[B],L=b.measureText(z).width,j=b.measureText(N).width,F=b.measureText(z+N).width-(L+j);F&&v.kerning.push({first:z.charCodeAt(0),second:N.charCodeAt(0),amount:F})}var D=new e(v,T,!0);return void 0!==e.available[t]&&e.uninstall(t),e.available[t]=D,D},e.ALPHA=[["a","z"],["A","Z"]," "],e.NUMERIC=[["0","9"]],e.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],e.ASCII=[[" ","~"]],e.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:e.ALPHANUMERIC},e.available={},e}(),P=[],E=[],k=function(t){function o(e,n){void 0===n&&(n={});var a=t.call(this)||this;a._tint=16777215;var s=Object.assign({},o.styleDefaults,n),h=s.align,f=s.tint,l=s.maxWidth,u=s.letterSpacing,c=s.fontName,p=s.fontSize;if(!O.available[c])throw new Error('Missing BitmapFont "'+c+'"');return a._activePagesMeshData=[],a._textWidth=0,a._textHeight=0,a._align=h,a._tint=f,a._fontName=c,a._fontSize=p||O.available[c].size,a._text=e,a._maxWidth=l,a._maxLineHeight=0,a._letterSpacing=u,a._anchor=new r(function(){a.dirty=!0},a,0,0),a._roundPixels=i.ROUND_PIXELS,a.dirty=!0,a._textureCache={},a}return function(t,e){function r(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(o,t),o.prototype.updateText=function(){for(var t,r=O.available[this._fontName],i=this._fontSize/r.size,o=new e,h=[],f=[],u=[],p=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",g=p.length,d=this._maxWidth*r.size/this._fontSize,m=null,v=0,x=0,y=0,b=-1,_=0,w=0,A=0,S=0,T=0;T<g;T++){var I=p.charCodeAt(T),k=p.charAt(T);if(/(?:\s)/.test(k)&&(b=T,_=v,S++),"\r"!==k&&"\n"!==k){var C=r.chars[I];if(C){m&&C.kerning[m]&&(o.x+=C.kerning[m]);var M=E.pop()||{texture:c.EMPTY,line:0,charCode:0,prevSpaces:0,position:new e};M.texture=C.texture,M.line=y,M.charCode=I,M.position.x=o.x+C.xOffset+this._letterSpacing/2,M.position.y=o.y+C.yOffset,M.prevSpaces=S,h.push(M),o.x+=C.xAdvance+this._letterSpacing,v=o.x,A=Math.max(A,C.yOffset+C.texture.height),m=I,-1!==b&&d>0&&o.x>d&&(l(h,1+b-++w,1+T-b),T=b,b=-1,f.push(_),u.push(h.length>0?h[h.length-1].prevSpaces:0),x=Math.max(x,_),y++,o.x=0,o.y+=r.lineHeight,m=null,S=0)}}else f.push(v),u.push(-1),x=Math.max(x,v),++y,++w,o.x=0,o.y+=r.lineHeight,m=null,S=0}var H=p.charAt(p.length-1);"\r"!==H&&"\n"!==H&&(/(?:\s)/.test(H)&&(v=_),f.push(v),x=Math.max(x,v),u.push(-1));var z=[];for(T=0;T<=y;T++){var B=0;"right"===this._align?B=x-f[T]:"center"===this._align?B=(x-f[T])/2:"justify"===this._align&&(B=u[T]<0?0:(x-f[T])/u[T]),z.push(B)}var N=h.length,L={},j=[],F=this._activePagesMeshData;for(T=0;T<F.length;T++)P.push(F[T]);for(T=0;T<N;T++){var D=($=h[T].texture).baseTexture.uid;if(!L[D]){if(!(rt=P.pop())){var W=new n,U=new a(c.EMPTY);rt={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new s(W,U),vertices:null,uvs:null,indices:null}}rt.index=0,rt.indexCount=0,rt.vertexCount=0,rt.uvsCount=0,rt.total=0;var R=this._textureCache;R[D]=R[D]||new c($.baseTexture),rt.mesh.texture=R[D],rt.mesh.tint=this._tint,j.push(rt),L[D]=rt}L[D].total++}for(T=0;T<F.length;T++)-1===j.indexOf(F[T])&&this.removeChild(F[T].mesh);for(T=0;T<j.length;T++)j[T].mesh.parent!==this&&this.addChild(j[T].mesh);for(var T in this._activePagesMeshData=j,L){var X=(rt=L[T]).total;if(!((null===(t=rt.indices)||void 0===t?void 0:t.length)>6*X)||rt.vertices.length<2*s.BATCHABLE_SIZE)rt.vertices=new Float32Array(8*X),rt.uvs=new Float32Array(8*X),rt.indices=new Uint16Array(6*X);else for(var Y=rt.total,G=rt.vertices,J=4*Y*2;J<G.length;J++)G[J]=0;rt.mesh.size=6*X}for(T=0;T<N;T++){var Z=(k=h[T]).position.x+z[k.line]*("justify"===this._align?k.prevSpaces:1);this._roundPixels&&(Z=Math.round(Z));var $,V=Z*i,q=k.position.y*i,K=L[($=k.texture).baseTexture.uid],Q=$.frame,tt=$._uvs,et=K.index++;K.indices[6*et+0]=0+4*et,K.indices[6*et+1]=1+4*et,K.indices[6*et+2]=2+4*et,K.indices[6*et+3]=0+4*et,K.indices[6*et+4]=2+4*et,K.indices[6*et+5]=3+4*et,K.vertices[8*et+0]=V,K.vertices[8*et+1]=q,K.vertices[8*et+2]=V+Q.width*i,K.vertices[8*et+3]=q,K.vertices[8*et+4]=V+Q.width*i,K.vertices[8*et+5]=q+Q.height*i,K.vertices[8*et+6]=V,K.vertices[8*et+7]=q+Q.height*i,K.uvs[8*et+0]=tt.x0,K.uvs[8*et+1]=tt.y0,K.uvs[8*et+2]=tt.x1,K.uvs[8*et+3]=tt.y1,K.uvs[8*et+4]=tt.x2,K.uvs[8*et+5]=tt.y2,K.uvs[8*et+6]=tt.x3,K.uvs[8*et+7]=tt.y3}for(var T in this._textWidth=x*i,this._textHeight=(o.y+r.lineHeight)*i,L){var rt=L[T];if(0!==this.anchor.x||0!==this.anchor.y)for(var it=0,nt=this._textWidth*this.anchor.x,at=this._textHeight*this.anchor.y,st=0;st<rt.total;st++)rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at,rt.vertices[it++]-=nt,rt.vertices[it++]-=at;this._maxLineHeight=A*i;var ot=rt.mesh.geometry.getBuffer("aVertexPosition"),ht=rt.mesh.geometry.getBuffer("aTextureCoord"),ft=rt.mesh.geometry.getIndex();ot.data=rt.vertices,ht.data=rt.uvs,ft.data=rt.indices,ot.update(),ht.update(),ft.update()}for(T=0;T<h.length;T++)E.push(h[T])},o.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},o.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},o.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(o.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!O.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),o.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},o.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},o}(m),C=function(){function t(){}return t.add=function(){v.setExtensionXhrType("fnt",v.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=S(e.data);if(i)for(var n=t.getBaseUrl(this,e),a=i.parse(e.data),s={},o=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===a.page.length&&(e.bitmapFont=O.install(a,s,!0),r())},h=0;h<a.page.length;++h){var f=a.page[h].file,l=n+f,u=!1;for(var c in this.resources){var p=this.resources[c];if(p.url===l){p.metadata.pageFile=f,p.texture?o(p):p.onAfterMiddleware.add(o),u=!0;break}}if(!u){var g={crossOrigin:e.crossOrigin,loadType:v.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:f},e.metadata.imageMetadata),parentResource:e};this.add(l,g,o)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}();export{O as BitmapFont,y as BitmapFontData,C as BitmapFontLoader,k as BitmapText};
//# sourceMappingURL=text-bitmap.min.js.map

@@ -83,7 +83,10 @@ /// <reference path="./global.d.ts" />

readonly pageTextures: Dict<Texture>;
private _ownsTextures;
/**
* @param {PIXI.BitmapFontData} data
* @param {PIXI.Texture[]|Object.<string, PIXI.Texture>} textures
* @param {boolean} ownsTextures - Setting to `true` will destroy page textures
* when the font is uninstalled.
*/
constructor(data: BitmapFontData, textures: Texture[] | Dict<Texture>);
constructor(data: BitmapFontData, textures: Texture[] | Dict<Texture>, ownsTextures?: boolean);
/**

@@ -101,6 +104,9 @@ * Remove references to created glyph textures.

* textures - List of textures for each page.
* @param managedTexture - Set to `true` to destroy page textures
* when the font is uninstalled. By default fonts created with
* `BitmapFont.from` or from the `BitmapFontLoader` are `true`.
* @return {PIXI.BitmapFont} Result font object with font, size, lineHeight
* and char fields.
*/
static install(data: string | XMLDocument | BitmapFontData, textures: Texture | Texture[] | Dict<Texture>): BitmapFont;
static install(data: string | XMLDocument | BitmapFontData, textures: Texture | Texture[] | Dict<Texture>, ownsTextures?: boolean): BitmapFont;
/**

@@ -110,3 +116,3 @@ * Remove bitmap font by name.

* @static
* @param {string} name
* @param name - Name of the font to uninstall.
*/

@@ -113,0 +119,0 @@ static uninstall(name: string): void;

{
"name": "@pixi/text-bitmap",
"version": "6.0.0",
"version": "6.0.1",
"main": "dist/cjs/text-bitmap.js",

@@ -28,15 +28,15 @@ "module": "dist/esm/text-bitmap.js",

"dependencies": {
"@pixi/core": "6.0.0",
"@pixi/display": "6.0.0",
"@pixi/loaders": "6.0.0",
"@pixi/math": "6.0.0",
"@pixi/mesh": "6.0.0",
"@pixi/settings": "6.0.0",
"@pixi/text": "6.0.0",
"@pixi/utils": "6.0.0"
"@pixi/core": "6.0.1",
"@pixi/display": "6.0.1",
"@pixi/loaders": "6.0.1",
"@pixi/math": "6.0.1",
"@pixi/mesh": "6.0.1",
"@pixi/settings": "6.0.1",
"@pixi/text": "6.0.1",
"@pixi/utils": "6.0.1"
},
"devDependencies": {
"@pixi/spritesheet": "6.0.0"
"@pixi/spritesheet": "6.0.1"
},
"gitHead": "40b8c8d7d1a3e99df059b5d5c582975eb536b30a"
"gitHead": "dee35532f3e5c5abc6cad909f47aa3c32634a325"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc