| 1523 | e3 === this._font && t3 === this._fontSize && i2 === this._weight && s2 === this._weightBold || (this._font = e3, this._fontSize = t3, this._weight = i2, this._weightBold = s2, this._container.style.fontFamily = this._font, this._container.style.fontSize = `${this._fontSize}px`, this._measureElements[0].style.fontWeight = `${i2}`, this._measureElements[1].style.fontWeight = `${s2}`, this._measureElements[2].style.fontWeight = `${i2}`, this._measureElements[3].style.fontWeight = `${s2}`, this.clear()); |
| 1524 | } |
| 1525 | get(e3, t3, i2) { |
| 1526 | let s2 = 0; |
| 1527 | if (!t3 && !i2 && 1 === e3.length && (s2 = e3.charCodeAt(0)) < 256) { |
| 1528 | if (-9999 !== this._flat[s2]) return this._flat[s2]; |
| 1529 | const t4 = this._measure(e3, 0); |
| 1530 | return t4 > 0 && (this._flat[s2] = t4), t4; |
| 1531 | } |
| 1532 | let r = e3; |
| 1533 | t3 && (r += "B"), i2 && (r += "I"); |
| 1534 | let n = this._holey.get(r); |
| 1535 | if (void 0 === n) { |
| 1536 | let s3 = 0; |
| 1537 | t3 && (s3 |= 1), i2 && (s3 |= 2), n = this._measure(e3, s3), n > 0 && this._holey.set(r, n); |
| 1538 | } |
| 1539 | return n; |
| 1540 | } |
| 1541 | _measure(e3, t3) { |
| 1542 | const i2 = this._measureElements[t3]; |
| 1543 | return i2.textContent = e3.repeat(32), i2.offsetWidth / 32; |