shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$text_bitmap$asset$bitmapFontXMLParser = function(global, require, module, exports) {
  exports.bitmapFontXMLParser = {test(data) {
    return "string" !== typeof data && "getElementsByTagName" in data && data.getElementsByTagName("page").length && null !== data.getElementsByTagName("info")[0].getAttribute("face");
  }, parse(xml) {
    const data = {chars:{}, pages:[], lineHeight:0, fontSize:0, fontFamily:"", distanceField:null, baseLineOffset:0};
    var info = xml.getElementsByTagName("info")[0], common = xml.getElementsByTagName("common")[0], distanceField = xml.getElementsByTagName("distanceField")[0];
    distanceField && (data.distanceField = {type:distanceField.getAttribute("fieldType"), range:parseInt(distanceField.getAttribute("distanceRange"), 10)});
    var page = xml.getElementsByTagName("page");
    distanceField = xml.getElementsByTagName("char");
    xml = xml.getElementsByTagName("kerning");
    data.fontSize = parseInt(info.getAttribute("size"), 10);
    data.fontFamily = info.getAttribute("face");
    data.lineHeight = parseInt(common.getAttribute("lineHeight"), 10);
    for (info = 0; info < page.length; info++) {
      data.pages.push({id:parseInt(page[info].getAttribute("id"), 10) || 0, file:page[info].getAttribute("file")});
    }
    info = {};
    data.baseLineOffset = data.lineHeight - parseInt(common.getAttribute("base"), 10);
    for (common = 0; common < distanceField.length; common++) {
      page = distanceField[common];
      var id = parseInt(page.getAttribute("id"), 10);
      let letter = page.getAttribute("letter") ?? page.getAttribute("char") ?? String.fromCharCode(id);
      "space" === letter && (letter = " ");
      info[id] = letter;
      data.chars[letter] = {id, page:parseInt(page.getAttribute("page"), 10) || 0, x:parseInt(page.getAttribute("x"), 10), y:parseInt(page.getAttribute("y"), 10), width:parseInt(page.getAttribute("width"), 10), height:parseInt(page.getAttribute("height"), 10), xOffset:parseInt(page.getAttribute("xoffset"), 10), yOffset:parseInt(page.getAttribute("yoffset"), 10), xAdvance:parseInt(page.getAttribute("xadvance"), 10), kerning:{}};
    }
    for (distanceField = 0; distanceField < xml.length; distanceField++) {
      common = parseInt(xml[distanceField].getAttribute("first"), 10), page = parseInt(xml[distanceField].getAttribute("second"), 10), id = parseInt(xml[distanceField].getAttribute("amount"), 10), data.chars[info[page]] && (data.chars[info[page]].kerning[info[common]] = id);
    }
    return data;
  }};
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$text_bitmap$asset$bitmapFontXMLParser.js.map
