/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{getTextHelperCanvas as t}from"./TextHelperCanvas.js";function e(e){const{size:c}=e.definition,a=e.fontString(c);let i=n.get(a);if(!i){const u=t(o,0,0).getContext("2d");e.setFontProperties(u,c);const x=u.measureText(r);i=new s(x.actualBoundingBoxAscent,x.actualBoundingBoxDescent),n.set(a,i)}return i}const n=new Map;class s{get maxHeight(){return this.maxAscent+this.maxDescent}constructor(t,e){this.maxAscent=t,this.maxDescent=e}}const o={canvas:null},r=(()=>{let t="";for(let e=32;e<127;e++)t+=String.fromCharCode(e);return t})();export{e as getFontMetrics};
