/*! * @pixi/text-bitmap - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/text-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ this.PIXI=this.PIXI||{};var _pixi_text_bitmap=function(e,t,r,i,n,a,o,s,h,l){"use strict";var u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},u(e,t)};var f=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},c=function(){function e(){}return e.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in t){var n=t[i].match(/^[a-z]+/gm)[0],a=t[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,""),c=parseFloat(u),d=isNaN(c)?u:c;o[l]=d}r[n].push(o)}var p=new f;return r.info.forEach((function(e){return p.info.push({face:e.face,size:parseInt(e.size,10)})})),r.common.forEach((function(e){return p.common.push({lineHeight:parseInt(e.lineHeight,10)})})),r.page.forEach((function(e){return p.page.push({id:parseInt(e.id,10),file:e.file})})),r.char.forEach((function(e){return p.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),r.kerning.forEach((function(e){return p.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),r.distanceField.forEach((function(e){return p.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),p},e}(),d=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new f,r=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),n=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),h=0;h")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return d.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return d.parse(t)},e}(),g=[c,d,p];function m(e){for(var t=0;t=d-D*u){if(0===M)throw new Error("[BitmapFont] textureHeight "+d+"px is too small (fontFamily: '"+g.fontFamily+"', fontSize: "+g.fontSize+"px, char: '"+F+"')");--E,b=null,T=null,w=null,M=0,P=0,I=0}else if(I=Math.max(D+C.fontProperties.descent,I),N*u+P>=m){if(0===P)throw new Error("[BitmapFont] textureWidth "+c+"px is too small (fontFamily: '"+g.fontFamily+"', fontSize: "+g.fontSize+"px, char: '"+F+"')");--E,M+=I*u,M=Math.ceil(M),P=0,I=0}else{x(b,T,C,P,M,u,g);var B=y(C.text);_.char.push({id:B,page:S.length-1,x:P/u,y:M/u,width:N,height:D,xoffset:0,yoffset:0,xadvance:Math.ceil(O-(g.dropShadow?g.dropShadowDistance:0)-(g.stroke?g.strokeThickness:0))}),P+=(N+2*l)*u,P=Math.ceil(P)}}if(!(null==n?void 0:n.skipKerning)){E=0;for(var k=p.length;E0&&l.x>p&&(++S,n.removeItems(u,1+I-S,1+C-I),C=I,I=-1,f.push(A),c.push(u.length>0?u[u.length-1].prevSpaces:0),P=Math.max(P,A),M++,l.x=0,l.y+=r.lineHeight,m=null,F=0)}}else f.push(x),c.push(-1),P=Math.max(P,x),++M,++S,l.x=0,l.y+=r.lineHeight,m=null,F=0}var B=d[d.length-1];"\r"!==B&&"\n"!==B&&(/(?:\s)/.test(B)&&(x=A),f.push(x),P=Math.max(P,x),c.push(-1));var k=[];for(C=0;C<=M;C++){var L=0;"right"===this._align?L=P-f[C]:"center"===this._align?L=(P-f[C])/2:"justify"===this._align&&(L=c[C]<0?0:(P-f[C])/c[C]),k.push(L)}var z=u.length,H={},R=[],j=this._activePagesMeshData;g.push.apply(g,j);for(C=0;C 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),Y=s.BLEND_MODES.NORMAL_NPM);var G=new i.Mesh(W,U);G.blendMode=Y,se={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:G,vertices:null,uvs:null,indices:null}}se.index=0,se.indexCount=0,se.vertexCount=0,se.uvsCount=0,se.total=0;var V=this._textureCache;V[X]=V[X]||new a.Texture(ee.baseTexture),se.mesh.texture=V[X],se.mesh.tint=this._tint,R.push(se),H[X]=se}H[X].total++}for(C=0;C6*Z)||se.vertices.length<2*i.Mesh.BATCHABLE_SIZE)se.vertices=new Float32Array(8*Z),se.uvs=new Float32Array(8*Z),se.indices=new Uint16Array(6*Z);else for(var q=se.total,$=se.vertices,J=4*q*2;J<$.length;J++)$[J]=0;se.mesh.size=6*Z}for(C=0;C