textmode.js 0.1.6-beta.2 → 0.1.6-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  var se = Object.defineProperty;
2
- var ne = (h, e, t) => e in h ? se(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
3
- var o = (h, e, t) => ne(h, typeof e != "symbol" ? e + "" : e, t);
2
+ var ae = (h, e, t) => e in h ? se(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
3
+ var o = (h, e, t) => ae(h, typeof e != "symbol" ? e + "" : e, t);
4
4
  class F extends Error {
5
5
  constructor(t, r, i = {}) {
6
6
  const s = F.createFormattedMessage(t, i);
@@ -18,10 +18,10 @@ class F extends Error {
18
18
  i += `
19
19
 
20
20
  📋 Context:`;
21
- for (const [s, n] of Object.entries(r)) {
22
- const a = F.formatValue(n);
21
+ for (const [s, a] of Object.entries(r)) {
22
+ const n = F.formatValue(a);
23
23
  i += `
24
- - ${s}: ${a}`;
24
+ - ${s}: ${n}`;
25
25
  }
26
26
  }
27
27
  return i += `
@@ -41,12 +41,12 @@ class F extends Error {
41
41
  return t.length === 0 ? "[]" : t.length <= 5 ? `[${t.map((r) => F.formatValue(r)).join(", ")}]` : `[${t.slice(0, 3).map((r) => F.formatValue(r)).join(", ")}, ... +${t.length - 3} more]`;
42
42
  if (typeof t == "object") {
43
43
  const r = Object.keys(t);
44
- return r.length === 0 ? "{}" : r.length <= 3 ? `{ ${r.map((n) => `${n}: ${F.formatValue(t[n])}`).join(", ")} }` : `{ ${r.slice(0, 2).map((s) => `${s}: ${F.formatValue(t[s])}`).join(", ")}, ... +${r.length - 2} more }`;
44
+ return r.length === 0 ? "{}" : r.length <= 3 ? `{ ${r.map((a) => `${a}: ${F.formatValue(t[a])}`).join(", ")} }` : `{ ${r.slice(0, 2).map((s) => `${s}: ${F.formatValue(t[s])}`).join(", ")}, ... +${r.length - 2} more }`;
45
45
  }
46
46
  return String(t);
47
47
  }
48
48
  }
49
- var ae = /* @__PURE__ */ ((h) => (h[h.SILENT = 0] = "SILENT", h[h.WARNING = 1] = "WARNING", h[h.ERROR = 2] = "ERROR", h[h.THROW = 3] = "THROW", h))(ae || {});
49
+ var ne = /* @__PURE__ */ ((h) => (h[h.SILENT = 0] = "SILENT", h[h.WARNING = 1] = "WARNING", h[h.ERROR = 2] = "ERROR", h[h.THROW = 3] = "THROW", h))(ne || {});
50
50
  const E = class E {
51
51
  constructor() {
52
52
  o(this, "_options", {
@@ -189,16 +189,16 @@ class oe {
189
189
  get(e, t, r, i) {
190
190
  const { gl: s } = this;
191
191
  if (e === void 0 && t === void 0) {
192
- const n = new Uint8Array(this._width * this._height * 4), a = s.getParameter(s.FRAMEBUFFER_BINDING);
193
- return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(0, 0, this._width, this._height, s.RGBA, s.UNSIGNED_BYTE, n), s.bindFramebuffer(s.FRAMEBUFFER, a), n;
192
+ const a = new Uint8Array(this._width * this._height * 4), n = s.getParameter(s.FRAMEBUFFER_BINDING);
193
+ return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(0, 0, this._width, this._height, s.RGBA, s.UNSIGNED_BYTE, a), s.bindFramebuffer(s.FRAMEBUFFER, n), a;
194
194
  } else if (r === void 0 && i === void 0) {
195
195
  (e < 0 || t < 0 || e >= this._width || t >= this._height) && (console.warn("The x and y values passed to Framebuffer.get are outside of its range and will be clamped."), e = Math.max(0, Math.min(e, this._width - 1)), t = Math.max(0, Math.min(t, this._height - 1)));
196
- const n = new Uint8Array(4), a = s.getParameter(s.FRAMEBUFFER_BINDING);
197
- return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(e, t, 1, 1, s.RGBA, s.UNSIGNED_BYTE, n), s.bindFramebuffer(s.FRAMEBUFFER, a), [n[0], n[1], n[2], n[3]];
196
+ const a = new Uint8Array(4), n = s.getParameter(s.FRAMEBUFFER_BINDING);
197
+ return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(e, t, 1, 1, s.RGBA, s.UNSIGNED_BYTE, a), s.bindFramebuffer(s.FRAMEBUFFER, n), [a[0], a[1], a[2], a[3]];
198
198
  } else {
199
199
  e = Math.max(0, Math.min(e, this._width - 1)), t = Math.max(0, Math.min(t, this._height - 1)), r = Math.max(1, Math.min(r, this._width - e)), i = Math.max(1, Math.min(i, this._height - t));
200
- const n = new Uint8Array(r * i * 4), a = s.getParameter(s.FRAMEBUFFER_BINDING);
201
- return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(e, t, r, i, s.RGBA, s.UNSIGNED_BYTE, n), s.bindFramebuffer(s.FRAMEBUFFER, a), n;
200
+ const a = new Uint8Array(r * i * 4), n = s.getParameter(s.FRAMEBUFFER_BINDING);
201
+ return s.bindFramebuffer(s.FRAMEBUFFER, this._framebuffer), s.readPixels(e, t, r, i, s.RGBA, s.UNSIGNED_BYTE, a), s.bindFramebuffer(s.FRAMEBUFFER, n), a;
202
202
  }
203
203
  }
204
204
  /**
@@ -244,7 +244,7 @@ class M {
244
244
  /** Bytes per vertex: depends on position format (vec2 vs vec3) */
245
245
  o(this, "bytesPerVertex");
246
246
  this.gl = e, this.bytesPerVertex = 16;
247
- const n = e.getParameter(e.VIEWPORT), a = n[2], l = n[3], c = e.getParameter(e.FRAMEBUFFER_BINDING) !== null, u = t / a * 2 - 1, d = (t + i) / a * 2 - 1;
247
+ const a = e.getParameter(e.VIEWPORT), n = a[2], l = a[3], c = e.getParameter(e.FRAMEBUFFER_BINDING) !== null, u = t / n * 2 - 1, d = (t + i) / n * 2 - 1;
248
248
  let f, g;
249
249
  c ? (f = r / l * 2 - 1, g = (r + s) / l * 2 - 1) : (f = 1 - r / l * 2, g = 1 - (r + s) / l * 2);
250
250
  let _, p, b, C;
@@ -301,11 +301,11 @@ class M {
301
301
  }
302
302
  }
303
303
  class he extends Q {
304
- constructor(t, r, i, s, n) {
304
+ constructor(t, r, i, s, a) {
305
305
  super(t, r, i);
306
306
  o(this, "width");
307
307
  o(this, "height");
308
- this.width = s, this.height = n;
308
+ this.width = s, this.height = a;
309
309
  }
310
310
  /**
311
311
  * Render the filled rectangle using the existing Rectangle geometry.
@@ -320,12 +320,12 @@ class he extends Q {
320
320
  */
321
321
  renderStroke(t) {
322
322
  if (t <= 0) return;
323
- const r = new M(this.gl, this.x, this.y, this.width, t), i = new M(this.gl, this.x + this.width - t, this.y, t, this.height), s = new M(this.gl, this.x, this.y + this.height - t, this.width, t), n = new M(this.gl, this.x, this.y, t, this.height);
324
- r.render(), i.render(), s.render(), n.render();
323
+ const r = new M(this.gl, this.x, this.y, this.width, t), i = new M(this.gl, this.x + this.width - t, this.y, t, this.height), s = new M(this.gl, this.x, this.y + this.height - t, this.width, t), a = new M(this.gl, this.x, this.y, t, this.height);
324
+ r.render(), i.render(), s.render(), a.render();
325
325
  }
326
326
  }
327
327
  class le {
328
- constructor(e, t, r, i, s, n) {
328
+ constructor(e, t, r, i, s, a) {
329
329
  /** The WebGL rendering context */
330
330
  o(this, "gl");
331
331
  /** The vertex buffer containing position and texture coordinates */
@@ -335,13 +335,13 @@ class le {
335
335
  /** Bytes per vertex: vec2+vec2 = 16 bytes */
336
336
  o(this, "bytesPerVertex");
337
337
  this.gl = e, this.bytesPerVertex = 16;
338
- const a = e.getParameter(e.VIEWPORT), l = a[2], c = a[3], u = e.getParameter(e.FRAMEBUFFER_BINDING) !== null, d = i - t, f = s - r, g = Math.sqrt(d * d + f * f);
338
+ const n = e.getParameter(e.VIEWPORT), l = n[2], c = n[3], u = e.getParameter(e.FRAMEBUFFER_BINDING) !== null, d = i - t, f = s - r, g = Math.sqrt(d * d + f * f);
339
339
  if (g === 0) {
340
340
  const ie = this.generateVertices(0, 0, 0, 0);
341
341
  this.vertexBuffer = e.createBuffer(), e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffer), e.bufferData(e.ARRAY_BUFFER, ie, e.STATIC_DRAW);
342
342
  return;
343
343
  }
344
- const _ = d / g, b = -(f / g), C = _, x = n / 2, w = t + b * x, A = r + C * x, R = t - b * x, S = r - C * x, P = i + b * x, D = s + C * x, Z = i - b * x, W = s - C * x, J = w / l * 2 - 1, K = R / l * 2 - 1, ee = P / l * 2 - 1, te = Z / l * 2 - 1;
344
+ const _ = d / g, b = -(f / g), C = _, x = a / 2, w = t + b * x, A = r + C * x, R = t - b * x, S = r - C * x, P = i + b * x, D = s + C * x, Z = i - b * x, W = s - C * x, J = w / l * 2 - 1, K = R / l * 2 - 1, ee = P / l * 2 - 1, te = Z / l * 2 - 1;
345
345
  let B, G, V, k;
346
346
  u ? (B = A / c * 2 - 1, G = S / c * 2 - 1, V = D / c * 2 - 1, k = W / c * 2 - 1) : (B = 1 - A / c * 2, G = 1 - S / c * 2, V = 1 - D / c * 2, k = 1 - W / c * 2);
347
347
  const re = this.generateLineVertices(
@@ -399,7 +399,7 @@ class le {
399
399
  * Uses the four corners calculated based on line direction and thickness
400
400
  * @private
401
401
  */
402
- generateLineVertices(e, t, r, i, s, n, a, l) {
402
+ generateLineVertices(e, t, r, i, s, a, n, l) {
403
403
  return new Float32Array([
404
404
  e,
405
405
  t,
@@ -412,7 +412,7 @@ class le {
412
412
  1,
413
413
  // corner2 (start - perpendicular)
414
414
  s,
415
- n,
415
+ a,
416
416
  1,
417
417
  0,
418
418
  // corner3 (end + perpendicular)
@@ -421,13 +421,13 @@ class le {
421
421
  0,
422
422
  1,
423
423
  // corner2 (start - perpendicular)
424
- a,
424
+ n,
425
425
  l,
426
426
  1,
427
427
  1,
428
428
  // corner4 (end - perpendicular)
429
429
  s,
430
- n,
430
+ a,
431
431
  1,
432
432
  0
433
433
  // corner3 (end + perpendicular)
@@ -444,11 +444,11 @@ class le {
444
444
  }
445
445
  }
446
446
  class ce extends Q {
447
- constructor(t, r, i, s, n) {
447
+ constructor(t, r, i, s, a) {
448
448
  super(t, r, i);
449
449
  o(this, "x2");
450
450
  o(this, "y2");
451
- this.x2 = s, this.y2 = n;
451
+ this.x2 = s, this.y2 = a;
452
452
  }
453
453
  /**
454
454
  * Lines don't support fill rendering - this method does nothing.
@@ -477,8 +477,8 @@ class y {
477
477
  createProgram(e, t) {
478
478
  const r = this.createShader(this.gl.VERTEX_SHADER, e), i = this.createShader(this.gl.FRAGMENT_SHADER, t), s = this.gl.createProgram();
479
479
  if (this.gl.attachShader(s, r), this.gl.attachShader(s, i), this.gl.linkProgram(s), !this.gl.getProgramParameter(s, this.gl.LINK_STATUS)) {
480
- const n = this.gl.getProgramInfoLog(s);
481
- throw new Error(`Shader program link error: ${n}`);
480
+ const a = this.gl.getProgramInfoLog(s);
481
+ throw new Error(`Shader program link error: ${a}`);
482
482
  }
483
483
  return this.gl.deleteShader(r), this.gl.deleteShader(i), s;
484
484
  }
@@ -528,7 +528,7 @@ class y {
528
528
  this.gl.uniform1i(r, t ? 1 : 0);
529
529
  else if (Array.isArray(t))
530
530
  if (i && (i.type === this.gl.INT_VEC2 || i.type === this.gl.INT_VEC3 || i.type === this.gl.INT_VEC4)) {
531
- const s = t.map((n) => Math.floor(n));
531
+ const s = t.map((a) => Math.floor(a));
532
532
  switch (s.length) {
533
533
  case 2:
534
534
  this.gl.uniform2iv(r, s);
@@ -757,8 +757,8 @@ class fe {
757
757
  s.renderFill(), this.currentShader = null;
758
758
  return;
759
759
  }
760
- const n = this.solidColorShader, { centerX: a, centerY: l, radians: c, aspectRatio: u } = this.calculateRotationParams(e, t, r, i);
761
- this.fillMode && (this.shader(n), this.setUniform("u_color", this.currentFillColor), this.setUniform("u_rotation", c), this.setUniform("u_center", [a, l]), this.setUniform("u_aspectRatio", u), s.renderFill()), this.strokeMode && (this.shader(n), this.setUniform("u_color", this.currentStrokeColor), this.setUniform("u_rotation", c), this.setUniform("u_center", [a, l]), this.setUniform("u_aspectRatio", u), s.renderStroke(this.currentStrokeWeight)), this.currentShader = null;
760
+ const a = this.solidColorShader, { centerX: n, centerY: l, radians: c, aspectRatio: u } = this.calculateRotationParams(e, t, r, i);
761
+ this.fillMode && (this.shader(a), this.setUniform("u_color", this.currentFillColor), this.setUniform("u_rotation", c), this.setUniform("u_center", [n, l]), this.setUniform("u_aspectRatio", u), s.renderFill()), this.strokeMode && (this.shader(a), this.setUniform("u_color", this.currentStrokeColor), this.setUniform("u_rotation", c), this.setUniform("u_center", [n, l]), this.setUniform("u_aspectRatio", u), s.renderStroke(this.currentStrokeWeight)), this.currentShader = null;
762
762
  }
763
763
  /**
764
764
  * Draw a line from (x1, y1) to (x2, y2) with the current stroke settings.
@@ -780,16 +780,16 @@ class fe {
780
780
  s.renderStroke(this.currentStrokeWeight), this.currentShader = null;
781
781
  return;
782
782
  }
783
- const n = this.solidColorShader, a = (e + r) / 2, l = (t + i) / 2, c = Math.abs(r - e), u = Math.abs(i - t), { centerX: d, centerY: f, radians: g, aspectRatio: _ } = this.calculateRotationParams(a - c / 2, l - u / 2, c, u);
784
- this.shader(n), this.setUniform("u_color", this.currentStrokeColor), this.setUniform("u_rotation", g), this.setUniform("u_center", [d, f]), this.setUniform("u_aspectRatio", _), s.renderStroke(this.currentStrokeWeight), this.currentShader = null;
783
+ const a = this.solidColorShader, n = (e + r) / 2, l = (t + i) / 2, c = Math.abs(r - e), u = Math.abs(i - t), { centerX: d, centerY: f, radians: g, aspectRatio: _ } = this.calculateRotationParams(n - c / 2, l - u / 2, c, u);
784
+ this.shader(a), this.setUniform("u_color", this.currentStrokeColor), this.setUniform("u_rotation", g), this.setUniform("u_center", [d, f]), this.setUniform("u_aspectRatio", _), s.renderStroke(this.currentStrokeWeight), this.currentShader = null;
785
785
  }
786
786
  /**
787
787
  * Calculate rotation parameters for built-in shaders (NDC coordinates)
788
788
  */
789
789
  calculateRotationParams(e, t, r, i) {
790
- const s = this.gl.getParameter(this.gl.VIEWPORT), n = s[2], a = s[3], l = n / a, c = this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING) !== null, u = e + r / 2, d = t + i / 2, f = u / n * 2 - 1;
790
+ const s = this.gl.getParameter(this.gl.VIEWPORT), a = s[2], n = s[3], l = a / n, c = this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING) !== null, u = e + r / 2, d = t + i / 2, f = u / a * 2 - 1;
791
791
  let g;
792
- c ? g = d / a * 2 - 1 : g = 1 - d / a * 2;
792
+ c ? g = d / n * 2 - 1 : g = 1 - d / n * 2;
793
793
  const _ = this.currentRotation * Math.PI / 180;
794
794
  return { centerX: f, centerY: g, radians: _, aspectRatio: l };
795
795
  }
@@ -812,11 +812,10 @@ class fe {
812
812
  this.gl.clearColor(e, t, r, i), this.gl.clear(this.gl.COLOR_BUFFER_BIT);
813
813
  }
814
814
  /**
815
- * Ensure viewport matches canvas dimensions, optionally using custom dimensions for CSS transforms
815
+ * Ensure viewport matches canvas dimensions
816
816
  */
817
- resetViewport(e, t) {
818
- const r = e || this.gl.canvas.width, i = t || this.gl.canvas.height;
819
- this.gl.viewport(0, 0, r, i);
817
+ resetViewport() {
818
+ this.gl.viewport(0, 0, this.gl.canvas.width, this.gl.canvas.height);
820
819
  }
821
820
  /**
822
821
  * Get the WebGL context
@@ -836,18 +835,18 @@ class fe {
836
835
  */
837
836
  image(e, t, r, i, s) {
838
837
  this.shader(this.imageShader), this.setUniform("u_texture", e.texture);
839
- const { centerX: n, centerY: a, radians: l, aspectRatio: c } = this.calculateRotationParams(
838
+ const { centerX: a, centerY: n, radians: l, aspectRatio: c } = this.calculateRotationParams(
840
839
  t,
841
840
  r,
842
841
  i ?? e.width,
843
842
  s ?? e.height
844
843
  );
845
- this.setUniform("u_rotation", l), this.setUniform("u_center", [n, a]), this.setUniform("u_aspectRatio", c), this.rect(t, r, i ?? e.width, s ?? e.height);
844
+ this.setUniform("u_rotation", l), this.setUniform("u_center", [a, n]), this.setUniform("u_aspectRatio", c), this.rect(t, r, i ?? e.width, s ?? e.height);
846
845
  }
847
846
  }
848
847
  var m = {};
849
848
  m.parse = function(h) {
850
- var e = function(s, n, a, l) {
849
+ var e = function(s, a, n, l) {
851
850
  var c = m.T, u = {
852
851
  cmap: c.cmap,
853
852
  head: c.head,
@@ -856,9 +855,9 @@ m.parse = function(h) {
856
855
  hmtx: c.hmtx,
857
856
  loca: c.loca,
858
857
  glyf: c.glyf
859
- }, d = { _data: s, _index: n, _offset: a };
858
+ }, d = { _data: s, _index: a, _offset: n };
860
859
  for (var f in u) {
861
- var g = m.findTable(s, f, a);
860
+ var g = m.findTable(s, f, n);
862
861
  if (g) {
863
862
  var _ = g[0], p = l[_];
864
863
  p == null && (p = u[f].parseTab(s, _, g[1], d)), d[f] = l[_] = p;
@@ -869,11 +868,11 @@ m.parse = function(h) {
869
868
  return [i];
870
869
  };
871
870
  m.findTable = function(h, e, t) {
872
- for (var r = m.B, i = r.readUshort(h, t + 4), s = t + 12, n = 0; n < i; n++) {
873
- var a = r.readASCII(h, s, 4);
871
+ for (var r = m.B, i = r.readUshort(h, t + 4), s = t + 12, a = 0; a < i; a++) {
872
+ var n = r.readASCII(h, s, 4);
874
873
  r.readUint(h, s + 4);
875
874
  var l = r.readUint(h, s + 8), c = r.readUint(h, s + 12);
876
- if (a == e) return [l, c];
875
+ if (n == e) return [l, c];
877
876
  s += 16;
878
877
  }
879
878
  return null;
@@ -915,11 +914,11 @@ m.T.cmap = {
915
914
  parseTab: function(h, e, t) {
916
915
  var r = { tables: [], ids: {}, off: e };
917
916
  h = new Uint8Array(h.buffer, e, t), e = 0;
918
- var i = m.B, s = i.readUshort, n = m.T.cmap;
917
+ var i = m.B, s = i.readUshort, a = m.T.cmap;
919
918
  s(h, e), e += 2;
920
- var a = s(h, e);
919
+ var n = s(h, e);
921
920
  e += 2;
922
- for (var l = [], c = 0; c < a; c++) {
921
+ for (var l = [], c = 0; c < n; c++) {
923
922
  var u = s(h, e);
924
923
  e += 2;
925
924
  var d = s(h, e);
@@ -932,16 +931,16 @@ m.T.cmap = {
932
931
  var p = {};
933
932
  l.push(f);
934
933
  var b = p.format = s(h, f);
935
- b == 4 ? p = n.parse4(h, f, p) : b == 12 && (p = n.parse12(h, f, p)), r.tables.push(p);
934
+ b == 4 ? p = a.parse4(h, f, p) : b == 12 && (p = a.parse12(h, f, p)), r.tables.push(p);
936
935
  }
937
936
  r.ids[g] != null && console.log("multiple tables for one platform+encoding: " + g), r.ids[g] = _;
938
937
  }
939
938
  return r;
940
939
  },
941
940
  parse4: function(h, e, t) {
942
- var r = m.B, i = r.readUshort, s = r.readUshorts, n = e;
941
+ var r = m.B, i = r.readUshort, s = r.readUshorts, a = e;
943
942
  e += 2;
944
- var a = i(h, e);
943
+ var n = i(h, e);
945
944
  e += 2, i(h, e), e += 2;
946
945
  var l = i(h, e);
947
946
  e += 2;
@@ -949,15 +948,15 @@ m.T.cmap = {
949
948
  t.searchRange = i(h, e), e += 2, t.entrySelector = i(h, e), e += 2, t.rangeShift = i(h, e), e += 2, t.endCount = s(h, e, c), e += c * 2, e += 2, t.startCount = s(h, e, c), e += c * 2, t.idDelta = [];
950
949
  for (var u = 0; u < c; u++)
951
950
  t.idDelta.push(r.readShort(h, e)), e += 2;
952
- return t.idRangeOffset = s(h, e, c), e += c * 2, t.glyphIdArray = s(h, e, n + a - e >> 1), t;
951
+ return t.idRangeOffset = s(h, e, c), e += c * 2, t.glyphIdArray = s(h, e, a + n - e >> 1), t;
953
952
  },
954
953
  parse12: function(h, e, t) {
955
954
  var r = m.B, i = r.readUint;
956
955
  e += 4, i(h, e), e += 4, i(h, e), e += 4;
957
956
  var s = i(h, e) * 3;
958
957
  e += 4;
959
- for (var n = t.groups = new Uint32Array(s), a = 0; a < s; a += 3)
960
- n[a] = i(h, e + (a << 2)), n[a + 1] = i(h, e + (a << 2) + 4), n[a + 2] = i(h, e + (a << 2) + 8);
958
+ for (var a = t.groups = new Uint32Array(s), n = 0; n < s; n += 3)
959
+ a[n] = i(h, e + (n << 2)), a[n + 1] = i(h, e + (n << 2) + 4), a[n + 2] = i(h, e + (n << 2) + 8);
961
960
  return t;
962
961
  }
963
962
  };
@@ -988,20 +987,20 @@ m.T.hhea = {
988
987
  "res3",
989
988
  "metricDataFormat",
990
989
  "numberOfHMetrics"
991
- ], n = 0; n < s.length; n++) {
992
- var a = s[n], l = a == "advanceWidthMax" || a == "numberOfHMetrics" ? r.readUshort : r.readShort;
993
- i[a] = l(h, e + n * 2);
990
+ ], a = 0; a < s.length; a++) {
991
+ var n = s[a], l = n == "advanceWidthMax" || n == "numberOfHMetrics" ? r.readUshort : r.readShort;
992
+ i[n] = l(h, e + a * 2);
994
993
  }
995
994
  return i;
996
995
  }
997
996
  };
998
997
  m.T.hmtx = {
999
998
  parseTab: function(h, e, t, r) {
1000
- for (var i = m.B, s = [], n = [], a = r.maxp.numGlyphs, l = r.hhea.numberOfHMetrics, c = 0, u = 0, d = 0; d < l; )
1001
- c = i.readUshort(h, e + (d << 2)), u = i.readShort(h, e + (d << 2) + 2), s.push(c), n.push(u), d++;
1002
- for (; d < a; )
1003
- s.push(c), n.push(u), d++;
1004
- return { aWidth: s, lsBearing: n };
999
+ for (var i = m.B, s = [], a = [], n = r.maxp.numGlyphs, l = r.hhea.numberOfHMetrics, c = 0, u = 0, d = 0; d < l; )
1000
+ c = i.readUshort(h, e + (d << 2)), u = i.readShort(h, e + (d << 2) + 2), s.push(c), a.push(u), d++;
1001
+ for (; d < n; )
1002
+ s.push(c), a.push(u), d++;
1003
+ return { aWidth: s, lsBearing: a };
1005
1004
  }
1006
1005
  };
1007
1006
  m.T.maxp = {
@@ -1012,55 +1011,55 @@ m.T.maxp = {
1012
1011
  };
1013
1012
  m.T.loca = {
1014
1013
  parseTab: function(h, e, t, r) {
1015
- var i = m.B, s = [], n = r.head.indexToLocFormat, a = r.maxp.numGlyphs + 1;
1016
- if (n == 0) for (var l = 0; l < a; l++) s.push(i.readUshort(h, e + (l << 1)) << 1);
1017
- if (n == 1) for (var l = 0; l < a; l++) s.push(i.readUint(h, e + (l << 2)));
1014
+ var i = m.B, s = [], a = r.head.indexToLocFormat, n = r.maxp.numGlyphs + 1;
1015
+ if (a == 0) for (var l = 0; l < n; l++) s.push(i.readUshort(h, e + (l << 1)) << 1);
1016
+ if (a == 1) for (var l = 0; l < n; l++) s.push(i.readUint(h, e + (l << 2)));
1018
1017
  return s;
1019
1018
  }
1020
1019
  };
1021
1020
  m.T.glyf = {
1022
1021
  parseTab: function(h, e, t, r) {
1023
- for (var i = [], s = r.maxp.numGlyphs, n = 0; n < s; n++) i.push(null);
1022
+ for (var i = [], s = r.maxp.numGlyphs, a = 0; a < s; a++) i.push(null);
1024
1023
  return i;
1025
1024
  },
1026
1025
  _parseGlyf: function(h, e) {
1027
1026
  var t = m.B, r = h._data, i = h.loca;
1028
1027
  if (i[e] == i[e + 1]) return null;
1029
- var s = m.findTable(r, "glyf", h._offset)[0] + i[e], n = {};
1030
- if (n.noc = t.readShort(r, s), s += 2, n.xMin = t.readShort(r, s), s += 2, n.yMin = t.readShort(r, s), s += 2, n.xMax = t.readShort(r, s), s += 2, n.yMax = t.readShort(r, s), s += 2, n.xMin >= n.xMax || n.yMin >= n.yMax) return null;
1031
- if (n.noc > 0) {
1032
- n.endPts = [];
1033
- for (var a = 0; a < n.noc; a++)
1034
- n.endPts.push(t.readUshort(r, s)), s += 2;
1028
+ var s = m.findTable(r, "glyf", h._offset)[0] + i[e], a = {};
1029
+ if (a.noc = t.readShort(r, s), s += 2, a.xMin = t.readShort(r, s), s += 2, a.yMin = t.readShort(r, s), s += 2, a.xMax = t.readShort(r, s), s += 2, a.yMax = t.readShort(r, s), s += 2, a.xMin >= a.xMax || a.yMin >= a.yMax) return null;
1030
+ if (a.noc > 0) {
1031
+ a.endPts = [];
1032
+ for (var n = 0; n < a.noc; n++)
1033
+ a.endPts.push(t.readUshort(r, s)), s += 2;
1035
1034
  var l = t.readUshort(r, s);
1036
1035
  if (s += 2, r.length - s < l) return null;
1037
1036
  s += l;
1038
- var c = n.endPts[n.noc - 1] + 1;
1039
- n.flags = [];
1040
- for (var a = 0; a < c; a++) {
1037
+ var c = a.endPts[a.noc - 1] + 1;
1038
+ a.flags = [];
1039
+ for (var n = 0; n < c; n++) {
1041
1040
  var u = r[s];
1042
- if (s++, n.flags.push(u), u & 8) {
1041
+ if (s++, a.flags.push(u), u & 8) {
1043
1042
  var d = r[s];
1044
1043
  s++;
1045
1044
  for (var f = 0; f < d; f++)
1046
- n.flags.push(u), a++;
1045
+ a.flags.push(u), n++;
1047
1046
  }
1048
1047
  }
1049
- n.xs = [];
1050
- for (var a = 0; a < c; a++) {
1051
- var g = (n.flags[a] & 2) != 0, _ = (n.flags[a] & 16) != 0;
1052
- g ? (n.xs.push(_ ? r[s] : -r[s]), s++) : _ ? n.xs.push(0) : (n.xs.push(t.readShort(r, s)), s += 2);
1048
+ a.xs = [];
1049
+ for (var n = 0; n < c; n++) {
1050
+ var g = (a.flags[n] & 2) != 0, _ = (a.flags[n] & 16) != 0;
1051
+ g ? (a.xs.push(_ ? r[s] : -r[s]), s++) : _ ? a.xs.push(0) : (a.xs.push(t.readShort(r, s)), s += 2);
1053
1052
  }
1054
- n.ys = [];
1055
- for (var a = 0; a < c; a++) {
1056
- var g = (n.flags[a] & 4) != 0, _ = (n.flags[a] & 32) != 0;
1057
- g ? (n.ys.push(_ ? r[s] : -r[s]), s++) : _ ? n.ys.push(0) : (n.ys.push(t.readShort(r, s)), s += 2);
1053
+ a.ys = [];
1054
+ for (var n = 0; n < c; n++) {
1055
+ var g = (a.flags[n] & 4) != 0, _ = (a.flags[n] & 32) != 0;
1056
+ g ? (a.ys.push(_ ? r[s] : -r[s]), s++) : _ ? a.ys.push(0) : (a.ys.push(t.readShort(r, s)), s += 2);
1058
1057
  }
1059
- for (var p = 0, b = 0, a = 0; a < c; a++)
1060
- p += n.xs[a], b += n.ys[a], n.xs[a] = p, n.ys[a] = b;
1058
+ for (var p = 0, b = 0, n = 0; n < c; n++)
1059
+ p += a.xs[n], b += a.ys[n], a.xs[n] = p, a.ys[n] = b;
1061
1060
  } else
1062
- n.parts = [];
1063
- return n;
1061
+ a.parts = [];
1062
+ return a;
1064
1063
  }
1065
1064
  };
1066
1065
  typeof module < "u" && module.exports ? module.exports = m : typeof window < "u" && (window.Typr = m);
@@ -1095,9 +1094,9 @@ class me {
1095
1094
  for (let r = 0; r < e.startCount.length; r++) {
1096
1095
  const i = e.startCount[r], s = e.endCount[r];
1097
1096
  if (!(i === 65535 && s === 65535)) {
1098
- for (let n = i; n <= s; n++)
1099
- if (this._calculateGlyphIndexFormat4(e, n, r) > 0) {
1100
- const l = String.fromCodePoint(n);
1097
+ for (let a = i; a <= s; a++)
1098
+ if (this._calculateGlyphIndexFormat4(e, a, r) > 0) {
1099
+ const l = String.fromCodePoint(a);
1101
1100
  t.push(l);
1102
1101
  }
1103
1102
  }
@@ -1114,10 +1113,10 @@ class me {
1114
1113
  if (!e.groups)
1115
1114
  return t;
1116
1115
  for (let r = 0; r < e.groups.length; r += 3) {
1117
- const i = e.groups[r], s = e.groups[r + 1], n = e.groups[r + 2];
1118
- for (let a = i; a <= s; a++)
1119
- if (n + (a - i) > 0) {
1120
- const c = String.fromCodePoint(a);
1116
+ const i = e.groups[r], s = e.groups[r + 1], a = e.groups[r + 2];
1117
+ for (let n = i; n <= s; n++)
1118
+ if (a + (n - i) > 0) {
1119
+ const c = String.fromCodePoint(n);
1121
1120
  t.push(c);
1122
1121
  }
1123
1122
  }
@@ -1181,13 +1180,13 @@ class ge {
1181
1180
  * @returns Object containing framebuffer, columns, and rows
1182
1181
  */
1183
1182
  createTextureAtlas(e, t, r, i) {
1184
- const s = e.length, n = Math.ceil(Math.sqrt(s)), a = Math.ceil(s / n), l = t.width * n, c = t.height * a;
1185
- this._setupCanvas(l, c, r, i), this._renderCharactersToCanvas(e, t, n, r), this._applyBlackWhiteThreshold();
1183
+ const s = e.length, a = Math.ceil(Math.sqrt(s)), n = Math.ceil(s / a), l = t.width * a, c = t.height * n;
1184
+ this._setupCanvas(l, c, r, i), this._renderCharactersToCanvas(e, t, a, r), this._applyBlackWhiteThreshold();
1186
1185
  const u = this._renderer.createFramebuffer(l, c, { filter: "nearest" });
1187
1186
  return u.update(this._textureCanvas), {
1188
1187
  framebuffer: u,
1189
- columns: n,
1190
- rows: a
1188
+ columns: a,
1189
+ rows: n
1191
1190
  };
1192
1191
  }
1193
1192
  /**
@@ -1211,7 +1210,7 @@ class ge {
1211
1210
  */
1212
1211
  _renderCharactersToCanvas(e, t, r, i) {
1213
1212
  for (let s = 0; s < e.length; s++) {
1214
- const n = s % r, a = Math.floor(s / r), l = n * t.width + t.width * 0.5, c = a * t.height + t.height * 0.5, u = Math.round(l - t.width * 0.5), d = Math.round(c - i * 0.5);
1213
+ const a = s % r, n = Math.floor(s / r), l = a * t.width + t.width * 0.5, c = n * t.height + t.height * 0.5, u = Math.round(l - t.width * 0.5), d = Math.round(c - i * 0.5);
1215
1214
  this._textureContext.fillText(e[s].character, u, d);
1216
1215
  }
1217
1216
  }
@@ -1224,8 +1223,8 @@ class ge {
1224
1223
  _applyBlackWhiteThreshold(e = 128) {
1225
1224
  const t = this._textureContext.getImageData(0, 0, this._textureCanvas.width, this._textureCanvas.height), r = t.data;
1226
1225
  for (let i = 0; i < r.length; i += 4) {
1227
- const s = 0.299 * r[i] + 0.587 * r[i + 1] + 0.114 * r[i + 2], n = e + 32, a = s > n ? 255 : 0;
1228
- r[i] = a, r[i + 1] = a, r[i + 2] = a;
1226
+ const s = 0.299 * r[i] + 0.587 * r[i + 1] + 0.114 * r[i + 2], a = e + 32, n = s > a ? 255 : 0;
1227
+ r[i] = n, r[i + 1] = n, r[i + 2] = n;
1229
1228
  }
1230
1229
  this._textureContext.putImageData(t, 0, 0);
1231
1230
  }
@@ -1250,8 +1249,8 @@ class pe {
1250
1249
  calculateMaxGlyphDimensions(e, t, r) {
1251
1250
  this._tempContext.font = `${t}px ${r}`;
1252
1251
  let i = 0, s = 0;
1253
- for (const n of e) {
1254
- const a = this._tempContext.measureText(n), l = a.width, c = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent;
1252
+ for (const a of e) {
1253
+ const n = this._tempContext.measureText(a), l = n.width, c = n.actualBoundingBoxAscent + n.actualBoundingBoxDescent;
1255
1254
  l > 0 && (i = Math.max(i, l), s = Math.max(s, c));
1256
1255
  }
1257
1256
  return {
@@ -1269,17 +1268,17 @@ class _e {
1269
1268
  */
1270
1269
  createCharacterObjects(e, t) {
1271
1270
  return e.map((r, i) => {
1272
- const s = r.codePointAt(0) || 0, n = this._generateCharacterColor(i);
1273
- let a = 0;
1271
+ const s = r.codePointAt(0) || 0, a = this._generateCharacterColor(i);
1272
+ let n = 0;
1274
1273
  if (t.hmtx && t.hmtx.aWidth) {
1275
1274
  const l = this._getGlyphIndex(t, s);
1276
- l > 0 && t.hmtx.aWidth[l] !== void 0 && (a = t.hmtx.aWidth[l]);
1275
+ l > 0 && t.hmtx.aWidth[l] !== void 0 && (n = t.hmtx.aWidth[l]);
1277
1276
  }
1278
1277
  return {
1279
1278
  character: r,
1280
1279
  unicode: s,
1281
- color: n,
1282
- advanceWidth: a
1280
+ color: a,
1281
+ advanceWidth: n
1283
1282
  };
1284
1283
  });
1285
1284
  }
@@ -1300,11 +1299,11 @@ class _e {
1300
1299
  if (i.idRangeOffset[s] === 0)
1301
1300
  return t + i.idDelta[s] & 65535;
1302
1301
  {
1303
- const n = i.idRangeOffset[s] / 2 + (t - i.startCount[s]) - (i.startCount.length - s);
1304
- if (n >= 0 && n < i.glyphIdArray.length) {
1305
- const a = i.glyphIdArray[n];
1306
- if (a !== 0)
1307
- return a + i.idDelta[s] & 65535;
1302
+ const a = i.idRangeOffset[s] / 2 + (t - i.startCount[s]) - (i.startCount.length - s);
1303
+ if (a >= 0 && a < i.glyphIdArray.length) {
1304
+ const n = i.glyphIdArray[a];
1305
+ if (n !== 0)
1306
+ return n + i.idDelta[s] & 65535;
1308
1307
  }
1309
1308
  }
1310
1309
  }
@@ -1563,9 +1562,8 @@ class xe {
1563
1562
  */
1564
1563
  reset() {
1565
1564
  if (!this._fixedDimensions) {
1566
- const e = this._canvas.getBoundingClientRect();
1567
- let t = Math.round(e.width), r = Math.round(e.height);
1568
- [this._cols, this._rows] = [Math.floor(t / this._cellWidth), Math.floor(r / this._cellHeight)];
1565
+ const e = this._canvas.width, t = this._canvas.height;
1566
+ [this._cols, this._rows] = [Math.floor(e / this._cellWidth), Math.floor(t / this._cellHeight)];
1569
1567
  }
1570
1568
  this._resizeGrid();
1571
1569
  }
@@ -1573,9 +1571,8 @@ class xe {
1573
1571
  * Reset the total grid width & height, and the offset to the outer canvas.
1574
1572
  */
1575
1573
  _resizeGrid() {
1576
- const e = this._canvas.getBoundingClientRect();
1577
- let t = Math.round(e.width), r = Math.round(e.height);
1578
- this._width = this._cols * this._cellWidth, this._height = this._rows * this._cellHeight, this._offsetX = Math.floor((t - this._width) / 2), this._offsetY = Math.floor((r - this._height) / 2);
1574
+ const e = this._canvas.width, t = this._canvas.height;
1575
+ this._width = this._cols * this._cellWidth, this._height = this._rows * this._cellHeight, this._offsetX = Math.floor((e - this._width) / 2), this._offsetY = Math.floor((t - this._height) / 2);
1579
1576
  }
1580
1577
  /**
1581
1578
  * Re-assign the grid cell dimensions and `reset()` the grid.
@@ -1679,12 +1676,12 @@ class be {
1679
1676
  r.width = e || 800, r.height = t || 600, document.body.appendChild(r);
1680
1677
  else {
1681
1678
  const s = this.captureSource.getBoundingClientRect();
1682
- let n = Math.round(s.width), a = Math.round(s.height);
1679
+ let a = Math.round(s.width), n = Math.round(s.height);
1683
1680
  if (this.captureSource instanceof HTMLVideoElement) {
1684
1681
  const u = this.captureSource;
1685
- (n === 0 || a === 0) && u.videoWidth > 0 && u.videoHeight > 0 && (n = u.videoWidth, a = u.videoHeight);
1682
+ (a === 0 || n === 0) && u.videoWidth > 0 && u.videoHeight > 0 && (a = u.videoWidth, n = u.videoHeight);
1686
1683
  }
1687
- r.width = n, r.height = a, r.style.position = "absolute", r.style.pointerEvents = "none";
1684
+ r.width = a, r.height = n, r.style.position = "absolute", r.style.pointerEvents = "none";
1688
1685
  const l = window.getComputedStyle(this.captureSource);
1689
1686
  let c = parseInt(l.zIndex || "0", 10);
1690
1687
  isNaN(c) && (c = 0), r.style.zIndex = (c + 1).toString(), this.positionOverlayCanvas(r), (i = this.captureSource.parentNode) == null || i.insertBefore(r, this.captureSource.nextSibling);
@@ -1707,8 +1704,8 @@ class be {
1707
1704
  const r = this.captureSource.getBoundingClientRect();
1708
1705
  let i = Math.round(r.width), s = Math.round(r.height);
1709
1706
  if (this.captureSource instanceof HTMLVideoElement) {
1710
- const n = this.captureSource;
1711
- (i === 0 || s === 0) && n.videoWidth > 0 && n.videoHeight > 0 && (i = n.videoWidth, s = n.videoHeight);
1707
+ const a = this.captureSource;
1708
+ (i === 0 || s === 0) && a.videoWidth > 0 && a.videoHeight > 0 && (i = a.videoWidth, s = a.videoHeight);
1712
1709
  }
1713
1710
  this._canvas.width = i, this._canvas.height = s, this.positionOverlayCanvas(this._canvas);
1714
1711
  }
@@ -1734,15 +1731,7 @@ class be {
1734
1731
  * Get the effective rendering dimensions accounting for CSS transforms
1735
1732
  */
1736
1733
  getEffectiveRenderingDimensions() {
1737
- if (!this._canvas)
1738
- return { width: 0, height: 0 };
1739
- const e = this._canvas.getBoundingClientRect(), t = Math.round(e.width), r = Math.round(e.height);
1740
- if (this._isStandalone) {
1741
- const i = this._canvas.width, s = this._canvas.height;
1742
- if (t !== i || r !== s)
1743
- return { width: t, height: r };
1744
- }
1745
- return { width: this._canvas.width, height: this._canvas.height };
1734
+ return this._canvas ? { width: this._canvas.width, height: this._canvas.height } : { width: 0, height: 0 };
1746
1735
  }
1747
1736
  /**
1748
1737
  * Check if the canvas is affected by CSS transforms
@@ -1891,8 +1880,8 @@ class Ce {
1891
1880
  this._framebuffer.width !== e && this._framebuffer.resize(e, t);
1892
1881
  const r = new Uint8Array(e * t * 4);
1893
1882
  for (let i = 0; i < e; i++) {
1894
- const s = i < this._colors.length ? this._colors[i] : [0, 0, 0], n = i * 4;
1895
- r[n] = s[0], r[n + 1] = s[1], r[n + 2] = s[2], r[n + 3] = 255;
1883
+ const s = i < this._colors.length ? this._colors[i] : [0, 0, 0], a = i * 4;
1884
+ r[a] = s[0], r[a + 1] = s[1], r[a + 2] = s[2], r[a + 3] = 255;
1896
1885
  }
1897
1886
  this._framebuffer.updatePixels(r, e, t);
1898
1887
  }
@@ -1948,7 +1937,7 @@ class O extends U {
1948
1937
  * @param a Alpha component (0-255).
1949
1938
  */
1950
1939
  characterColor(t, r, i, s = 255) {
1951
- let n, a, l, c;
1940
+ let a, n, l, c;
1952
1941
  if (typeof t == "string") {
1953
1942
  const u = this.parseHexColor(t);
1954
1943
  if (!u) {
@@ -1959,14 +1948,14 @@ class O extends U {
1959
1948
  );
1960
1949
  return;
1961
1950
  }
1962
- [n, a, l, c] = u;
1963
- } else if (n = t, a = r !== void 0 ? r : t, l = i !== void 0 ? i : t, c = s, !v.validate(
1964
- [n, a, l, c].every((u) => u >= 0 && u <= 255),
1951
+ [a, n, l, c] = u;
1952
+ } else if (a = t, n = r !== void 0 ? r : t, l = i !== void 0 ? i : t, c = s, !v.validate(
1953
+ [a, n, l, c].every((u) => u >= 0 && u <= 255),
1965
1954
  "Character color values must be between 0 and 255",
1966
- { method: "characterColor", providedValues: { r: n, g: a, b: l, a: c } }
1955
+ { method: "characterColor", providedValues: { r: a, g: n, b: l, a: c } }
1967
1956
  ))
1968
1957
  return;
1969
- this._options.characterColor = [n / 255, a / 255, l / 255, c / 255];
1958
+ this._options.characterColor = [a / 255, n / 255, l / 255, c / 255];
1970
1959
  }
1971
1960
  /**
1972
1961
  * Sets the character color mode.
@@ -1990,7 +1979,7 @@ class O extends U {
1990
1979
  * @param a Alpha component (0-255).
1991
1980
  */
1992
1981
  cellColor(t, r, i, s = 255) {
1993
- let n, a, l, c;
1982
+ let a, n, l, c;
1994
1983
  if (typeof t == "string") {
1995
1984
  const u = this.parseHexColor(t);
1996
1985
  if (!u) {
@@ -2001,14 +1990,14 @@ class O extends U {
2001
1990
  );
2002
1991
  return;
2003
1992
  }
2004
- [n, a, l, c] = u;
2005
- } else if (n = t, a = r !== void 0 ? r : t, l = i !== void 0 ? i : t, c = s, !v.validate(
2006
- [n, a, l, c].every((u) => u >= 0 && u <= 255),
1993
+ [a, n, l, c] = u;
1994
+ } else if (a = t, n = r !== void 0 ? r : t, l = i !== void 0 ? i : t, c = s, !v.validate(
1995
+ [a, n, l, c].every((u) => u >= 0 && u <= 255),
2007
1996
  "Cell color values must be between 0 and 255",
2008
- { method: "cellColor", providedValues: { r: n, g: a, b: l, a: c } }
1997
+ { method: "cellColor", providedValues: { r: a, g: n, b: l, a: c } }
2009
1998
  ))
2010
1999
  return;
2011
- this._options.cellColor = [n / 255, a / 255, l / 255, c / 255];
2000
+ this._options.cellColor = [a / 255, n / 255, l / 255, c / 255];
2012
2001
  }
2013
2002
  /**
2014
2003
  * Sets the cell color mode.
@@ -2079,7 +2068,7 @@ class O extends U {
2079
2068
  parseHexColor(t) {
2080
2069
  if (t = t.replace(/^#/, ""), !/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t))
2081
2070
  return null;
2082
- t.length === 3 && (t = t.split("").map((n) => n + n).join(""));
2071
+ t.length === 3 && (t = t.split("").map((a) => a + a).join(""));
2083
2072
  const r = parseInt(t.slice(0, 2), 16), i = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16);
2084
2073
  return [r, i, s, 255];
2085
2074
  }
@@ -2195,8 +2184,8 @@ class Ue {
2195
2184
  const t = (r, i) => {
2196
2185
  r.begin(), this.renderer.clear();
2197
2186
  for (const s of this.converters) {
2198
- const n = s.converter;
2199
- n.options.enabled && this.renderer.image(i(n), 0, 0);
2187
+ const a = s.converter;
2188
+ a.options.enabled && this.renderer.image(i(a), 0, 0);
2200
2189
  }
2201
2190
  r.end();
2202
2191
  };
@@ -2343,13 +2332,13 @@ class H {
2343
2332
  * @returns Object containing all pixel data arrays
2344
2333
  */
2345
2334
  extractFramebufferData(e) {
2346
- const t = e.get("brightness"), r = t == null ? void 0 : t.characterFramebuffer, i = t == null ? void 0 : t.primaryColorFramebuffer, s = t == null ? void 0 : t.secondaryColorFramebuffer, n = t == null ? void 0 : t.transformFramebuffer, a = t == null ? void 0 : t.rotationFramebuffer;
2347
- return r == null || r.loadPixels(), i == null || i.loadPixels(), s == null || s.loadPixels(), n == null || n.loadPixels(), a == null || a.loadPixels(), {
2335
+ const t = e.get("brightness"), r = t == null ? void 0 : t.characterFramebuffer, i = t == null ? void 0 : t.primaryColorFramebuffer, s = t == null ? void 0 : t.secondaryColorFramebuffer, a = t == null ? void 0 : t.transformFramebuffer, n = t == null ? void 0 : t.rotationFramebuffer;
2336
+ return r == null || r.loadPixels(), i == null || i.loadPixels(), s == null || s.loadPixels(), a == null || a.loadPixels(), n == null || n.loadPixels(), {
2348
2337
  characterPixels: (r == null ? void 0 : r.pixels) || new Uint8Array(0),
2349
2338
  primaryColorPixels: (i == null ? void 0 : i.pixels) || new Uint8Array(0),
2350
2339
  secondaryColorPixels: (s == null ? void 0 : s.pixels) || new Uint8Array(0),
2351
- transformPixels: (n == null ? void 0 : n.pixels) || new Uint8Array(0),
2352
- rotationPixels: (a == null ? void 0 : a.pixels) || new Uint8Array(0)
2340
+ transformPixels: (a == null ? void 0 : a.pixels) || new Uint8Array(0),
2341
+ rotationPixels: (n == null ? void 0 : n.pixels) || new Uint8Array(0)
2353
2342
  };
2354
2343
  }
2355
2344
  /**
@@ -2396,8 +2385,8 @@ class X {
2396
2385
  */
2397
2386
  downloadFile(e, t, r) {
2398
2387
  try {
2399
- const i = this.createBlob(e, r), s = URL.createObjectURL(i), n = document.createElement("a");
2400
- n.href = s, n.download = t, n.style.display = "none", n.rel = "noopener", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(s);
2388
+ const i = this.createBlob(e, r), s = URL.createObjectURL(i), a = document.createElement("a");
2389
+ a.href = s, a.download = t, a.style.display = "none", a.rel = "noopener", document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(s);
2401
2390
  } catch (i) {
2402
2391
  throw console.error("Failed to download file:", i), new Error(`File download failed: ${i instanceof Error ? i.message : "Unknown error"}`);
2403
2392
  }
@@ -2444,9 +2433,9 @@ class Ae extends H {
2444
2433
  * @returns Transform data object
2445
2434
  */
2446
2435
  extractTransformData(e, t, r) {
2447
- const i = e[r], s = e[r + 1], n = e[r + 2], a = i === 255, l = s === 255, c = n === 255, u = t[r], d = t[r + 1], f = u + d / 255, g = Math.round(f * 360 / 255 * 100) / 100;
2436
+ const i = e[r], s = e[r + 1], a = e[r + 2], n = i === 255, l = s === 255, c = a === 255, u = t[r], d = t[r + 1], f = u + d / 255, g = Math.round(f * 360 / 255 * 100) / 100;
2448
2437
  return {
2449
- isInverted: a,
2438
+ isInverted: n,
2450
2439
  flipHorizontal: l,
2451
2440
  flipVertical: c,
2452
2441
  rotation: g
@@ -2478,22 +2467,22 @@ class Ae extends H {
2478
2467
  const r = [];
2479
2468
  let i = 0;
2480
2469
  for (let s = 0; s < t.rows; s++)
2481
- for (let n = 0; n < t.cols; n++) {
2482
- const a = i * 4, l = this.getCharacterIndex(
2470
+ for (let a = 0; a < t.cols; a++) {
2471
+ const n = i * 4, l = this.getCharacterIndex(
2483
2472
  e.characterPixels,
2484
- a
2473
+ n
2485
2474
  );
2486
- let c = this.pixelsToRGBA(e.primaryColorPixels, a), u = this.pixelsToRGBA(e.secondaryColorPixels, a);
2475
+ let c = this.pixelsToRGBA(e.primaryColorPixels, n), u = this.pixelsToRGBA(e.secondaryColorPixels, n);
2487
2476
  const d = this.extractTransformData(
2488
2477
  e.transformPixels,
2489
2478
  e.rotationPixels,
2490
- a
2479
+ n
2491
2480
  );
2492
2481
  if (d.isInverted) {
2493
2482
  const g = c;
2494
2483
  c = u, u = g;
2495
2484
  }
2496
- const f = this.calculateCellPosition(n, s, t);
2485
+ const f = this.calculateCellPosition(a, s, t);
2497
2486
  r.push({
2498
2487
  charIndex: l,
2499
2488
  primaryColor: c,
@@ -2522,11 +2511,11 @@ class Me {
2522
2511
  if (i.idRangeOffset[s] === 0)
2523
2512
  return t + i.idDelta[s] & 65535;
2524
2513
  {
2525
- const n = i.idRangeOffset[s] / 2 + (t - i.startCount[s]) - (i.startCount.length - s);
2526
- if (n >= 0 && n < i.glyphIdArray.length) {
2527
- const a = i.glyphIdArray[n];
2528
- if (a !== 0)
2529
- return a + i.idDelta[s] & 65535;
2514
+ const a = i.idRangeOffset[s] / 2 + (t - i.startCount[s]) - (i.startCount.length - s);
2515
+ if (a >= 0 && a < i.glyphIdArray.length) {
2516
+ const n = i.glyphIdArray[a];
2517
+ if (n !== 0)
2518
+ return n + i.idDelta[s] & 65535;
2530
2519
  }
2531
2520
  }
2532
2521
  }
@@ -2555,15 +2544,15 @@ class Me {
2555
2544
  createGlyphPath(e, t, r, i, s) {
2556
2545
  if (!t || !t.xs || t.xs.length === 0)
2557
2546
  return this.createEmptyPath();
2558
- const n = s / e.head.unitsPerEm;
2547
+ const a = s / e.head.unitsPerEm;
2559
2548
  return {
2560
2549
  getBoundingBox: () => ({
2561
- x1: r + t.xMin * n,
2562
- y1: i + -t.yMax * n,
2563
- x2: r + t.xMax * n,
2564
- y2: i + -t.yMin * n
2550
+ x1: r + t.xMin * a,
2551
+ y1: i + -t.yMax * a,
2552
+ x2: r + t.xMax * a,
2553
+ y2: i + -t.yMin * a
2565
2554
  }),
2566
- toSVG: () => this.glyphToSVGPath(t, r, i, n)
2555
+ toSVG: () => this.glyphToSVGPath(t, r, i, a)
2567
2556
  };
2568
2557
  }
2569
2558
  /**
@@ -2576,28 +2565,28 @@ class Me {
2576
2565
  */
2577
2566
  glyphToSVGPath(e, t, r, i) {
2578
2567
  if (!e || !e.xs) return "";
2579
- const { xs: s, ys: n, endPts: a, flags: l } = e;
2580
- if (!s || !n || !a || !l) return "";
2568
+ const { xs: s, ys: a, endPts: n, flags: l } = e;
2569
+ if (!s || !a || !n || !l) return "";
2581
2570
  let c = "", u = 0;
2582
- for (let d = 0; d < a.length; d++) {
2583
- const f = a[d];
2571
+ for (let d = 0; d < n.length; d++) {
2572
+ const f = n[d];
2584
2573
  if (!(f < u)) {
2585
2574
  if (f >= u) {
2586
- const g = t + s[u] * i, _ = r - n[u] * i;
2575
+ const g = t + s[u] * i, _ = r - a[u] * i;
2587
2576
  c += `M${g.toFixed(2)},${_.toFixed(2)}`;
2588
2577
  let p = u + 1;
2589
2578
  for (; p <= f; )
2590
2579
  if ((l[p] & 1) !== 0) {
2591
- const C = t + s[p] * i, x = r - n[p] * i;
2580
+ const C = t + s[p] * i, x = r - a[p] * i;
2592
2581
  c += `L${C.toFixed(2)},${x.toFixed(2)}`, p++;
2593
2582
  } else {
2594
- const C = t + s[p] * i, x = r - n[p] * i;
2583
+ const C = t + s[p] * i, x = r - a[p] * i;
2595
2584
  let w = p + 1 > f ? u : p + 1;
2596
2585
  if ((l[w] & 1) !== 0) {
2597
- const R = t + s[w] * i, S = r - n[w] * i;
2586
+ const R = t + s[w] * i, S = r - a[w] * i;
2598
2587
  c += `Q${C.toFixed(2)},${x.toFixed(2)} ${R.toFixed(2)},${S.toFixed(2)}`, p = w + 1;
2599
2588
  } else {
2600
- const R = t + s[w] * i, S = r - n[w] * i, P = (C + R) / 2, D = (x + S) / 2;
2589
+ const R = t + s[w] * i, S = r - a[w] * i, P = (C + R) / 2, D = (x + S) / 2;
2601
2590
  c += `Q${C.toFixed(2)},${x.toFixed(2)} ${P.toFixed(2)},${D.toFixed(2)}`, p = w;
2602
2591
  }
2603
2592
  }
@@ -2619,18 +2608,18 @@ class Me {
2619
2608
  */
2620
2609
  generateCharacterPath(e, t, r, i, s) {
2621
2610
  try {
2622
- const n = e.codePointAt(0) || 0, a = this.getGlyphIndex(t, n);
2623
- if (a === 0)
2611
+ const a = e.codePointAt(0) || 0, n = this.getGlyphIndex(t, a);
2612
+ if (n === 0)
2624
2613
  return this.createEmptyPath();
2625
2614
  let l = null;
2626
2615
  try {
2627
- t.glyf && t.glyf[a] !== null ? l = t.glyf[a] : m && m.T && m.T.glyf && m.T.glyf._parseGlyf && (l = m.T.glyf._parseGlyf(t, a), t.glyf && l && (t.glyf[a] = l));
2616
+ t.glyf && t.glyf[n] !== null ? l = t.glyf[n] : m && m.T && m.T.glyf && m.T.glyf._parseGlyf && (l = m.T.glyf._parseGlyf(t, n), t.glyf && l && (t.glyf[n] = l));
2628
2617
  } catch (c) {
2629
- console.warn(`Failed to parse glyph ${a}:`, c);
2618
+ console.warn(`Failed to parse glyph ${n}:`, c);
2630
2619
  }
2631
2620
  return l ? this.createGlyphPath(t, l, r, i, s) : this.createEmptyPath();
2632
- } catch (n) {
2633
- return console.warn(`Failed to generate path for character "${e}":`, n), this.createEmptyPath();
2621
+ } catch (a) {
2622
+ return console.warn(`Failed to generate path for character "${e}":`, a), this.createEmptyPath();
2634
2623
  }
2635
2624
  }
2636
2625
  /**
@@ -2645,10 +2634,10 @@ class Me {
2645
2634
  * @param advanceWidth Character advance width
2646
2635
  * @returns SVG path data string or null if generation fails
2647
2636
  */
2648
- generatePositionedCharacterPath(e, t, r, i, s, n, a, l) {
2637
+ generatePositionedCharacterPath(e, t, r, i, s, a, n, l) {
2649
2638
  try {
2650
- const c = a / t.head.unitsPerEm, u = l * c, d = r + (s - u) / 2, f = i + (n + a * 0.7) / 2;
2651
- return this.generateCharacterPath(e, t, d, f, a).toSVG() || null;
2639
+ const c = n / t.head.unitsPerEm, u = l * c, d = r + (s - u) / 2, f = i + (a + n * 0.7) / 2;
2640
+ return this.generateCharacterPath(e, t, d, f, n).toSVG() || null;
2652
2641
  } catch (c) {
2653
2642
  return console.warn(`Failed to generate positioned character path for "${e}":`, c), null;
2654
2643
  }
@@ -2709,12 +2698,12 @@ class De {
2709
2698
  * @returns Transform attribute string or empty string
2710
2699
  */
2711
2700
  generateTransformAttribute(e, t) {
2712
- const { transform: r, position: i } = e, s = i.cellX + t.cellWidth / 2, n = i.cellY + t.cellHeight / 2, a = [];
2701
+ const { transform: r, position: i } = e, s = i.cellX + t.cellWidth / 2, a = i.cellY + t.cellHeight / 2, n = [];
2713
2702
  if (r.flipHorizontal || r.flipVertical) {
2714
2703
  const l = r.flipHorizontal ? -1 : 1, c = r.flipVertical ? -1 : 1;
2715
- a.push(`translate(${s} ${n})`), a.push(`scale(${l} ${c})`), a.push(`translate(${-s} ${-n})`);
2704
+ n.push(`translate(${s} ${a})`), n.push(`scale(${l} ${c})`), n.push(`translate(${-s} ${-a})`);
2716
2705
  }
2717
- return r.rotation && a.push(`rotate(${r.rotation} ${s} ${n})`), a.length ? ` transform="${a.join(" ")}"` : "";
2706
+ return r.rotation && n.push(`rotate(${r.rotation} ${s} ${a})`), n.length ? ` transform="${n.join(" ")}"` : "";
2718
2707
  }
2719
2708
  /**
2720
2709
  * Generates background rectangle for a cell
@@ -2743,7 +2732,7 @@ class De {
2743
2732
  const s = r.characters[e.charIndex];
2744
2733
  if (!s)
2745
2734
  return "";
2746
- const n = this.pathGenerator.generatePositionedCharacterPath(
2735
+ const a = this.pathGenerator.generatePositionedCharacterPath(
2747
2736
  s.character,
2748
2737
  r.font,
2749
2738
  e.position.cellX,
@@ -2753,12 +2742,12 @@ class De {
2753
2742
  r.fontSize,
2754
2743
  s.advanceWidth
2755
2744
  );
2756
- if (!n)
2745
+ if (!a)
2757
2746
  return "";
2758
- const a = this.rgbaToColorString(e.primaryColor);
2747
+ const n = this.rgbaToColorString(e.primaryColor);
2759
2748
  return i.drawMode === "stroke" ? `
2760
- <path id="${`path-${e.charIndex}-${e.position.cellX}-${e.position.cellY}`.replace(/\./g, "-")}" d="${n}" stroke="${a}" stroke-width="${i.strokeWidth}" fill="none" />` : `
2761
- <path d="${n}" fill="${a}" />`;
2749
+ <path id="${`path-${e.charIndex}-${e.position.cellX}-${e.position.cellY}`.replace(/\./g, "-")}" d="${a}" stroke="${n}" stroke-width="${i.strokeWidth}" fill="none" />` : `
2750
+ <path d="${a}" fill="${n}" />`;
2762
2751
  }
2763
2752
  /**
2764
2753
  * Generates complete SVG content for a single cell
@@ -2771,10 +2760,10 @@ class De {
2771
2760
  generateCellContent(e, t, r, i) {
2772
2761
  let s = "";
2773
2762
  s += this.generateCellBackground(e, t, i);
2774
- const n = this.generateTransformAttribute(e, t), a = this.generateCharacterPath(e, t, r, i);
2775
- return a && (n ? (s += `
2776
- <g${n}>`, s += a, s += `
2777
- </g>`) : s += a), s;
2763
+ const a = this.generateTransformAttribute(e, t), n = this.generateCharacterPath(e, t, r, i);
2764
+ return n && (a ? (s += `
2765
+ <g${a}>`, s += n, s += `
2766
+ </g>`) : s += n), s;
2778
2767
  }
2779
2768
  /**
2780
2769
  * Generates the complete SVG content from cell data
@@ -2788,8 +2777,8 @@ class De {
2788
2777
  let s = this.generateSVGHeader(t);
2789
2778
  s += this.generateBackground(t, i), s += `
2790
2779
  <g id="ascii-cells">`;
2791
- for (const n of e)
2792
- s += this.generateCellContent(n, t, r, i);
2780
+ for (const a of e)
2781
+ s += this.generateCellContent(a, t, r, i);
2793
2782
  return s += this.generateSVGFooter(), s;
2794
2783
  }
2795
2784
  /**
@@ -2862,13 +2851,13 @@ class Y {
2862
2851
  const r = this.applyDefaultOptions(t), i = this.dataExtractor.extractFramebufferData(e.pipeline), s = this.dataExtractor.extractSVGCellData(
2863
2852
  i,
2864
2853
  e.grid
2865
- ), n = this.contentGenerator.generateSVGContent(
2854
+ ), a = this.contentGenerator.generateSVGContent(
2866
2855
  s,
2867
2856
  e.grid,
2868
2857
  e.font,
2869
2858
  r
2870
2859
  );
2871
- return this.contentGenerator.optimizeSVGContent(n);
2860
+ return this.contentGenerator.optimizeSVGContent(a);
2872
2861
  }
2873
2862
  /**
2874
2863
  * Exports SVG content to a downloadable file
@@ -2894,17 +2883,17 @@ class Pe extends H {
2894
2883
  * @returns 2D array of characters (rows x columns)
2895
2884
  */
2896
2885
  extractCharacterGrid(e, t, r, i = " ") {
2897
- var a;
2886
+ var n;
2898
2887
  const s = [];
2899
- let n = 0;
2888
+ let a = 0;
2900
2889
  for (let l = 0; l < t.rows; l++) {
2901
2890
  const c = [];
2902
2891
  for (let u = 0; u < t.cols; u++) {
2903
- const d = n * 4, f = this.getCharacterIndex(
2892
+ const d = a * 4, f = this.getCharacterIndex(
2904
2893
  e.characterPixels,
2905
2894
  d
2906
- ), g = ((a = r.characters[f]) == null ? void 0 : a.character) || i;
2907
- c.push(g), n++;
2895
+ ), g = ((n = r.characters[f]) == null ? void 0 : n.character) || i;
2896
+ c.push(g), a++;
2908
2897
  }
2909
2898
  s.push(c);
2910
2899
  }
@@ -2921,8 +2910,8 @@ class Be {
2921
2910
  generateTXTContent(e, t) {
2922
2911
  const r = [];
2923
2912
  for (const s of e) {
2924
- let n = s.join("");
2925
- t.preserveTrailingSpaces || (n = n.replace(/\s+$/, "")), r.push(n);
2913
+ let a = s.join("");
2914
+ t.preserveTrailingSpaces || (a = a.replace(/\s+$/, "")), r.push(a);
2926
2915
  }
2927
2916
  const i = t.lineEnding === "crlf" ? `\r
2928
2917
  ` : `
@@ -3017,8 +3006,8 @@ class Ve extends H {
3017
3006
  const i = e.canvas;
3018
3007
  if (t === 1 && r === "transparent")
3019
3008
  return i;
3020
- const s = document.createElement("canvas"), n = s.getContext("2d"), a = Math.round(i.width * t), l = Math.round(i.height * t);
3021
- return s.width = a, s.height = l, r !== "transparent" && (n.fillStyle = r, n.fillRect(0, 0, a, l)), n.imageSmoothingEnabled = !1, n.drawImage(
3009
+ const s = document.createElement("canvas"), a = s.getContext("2d"), n = Math.round(i.width * t), l = Math.round(i.height * t);
3010
+ return s.width = n, s.height = l, r !== "transparent" && (a.fillStyle = r, a.fillRect(0, 0, n, l)), a.imageSmoothingEnabled = !1, a.drawImage(
3022
3011
  i,
3023
3012
  0,
3024
3013
  0,
@@ -3026,7 +3015,7 @@ class Ve extends H {
3026
3015
  i.height,
3027
3016
  0,
3028
3017
  0,
3029
- a,
3018
+ n,
3030
3019
  l
3031
3020
  ), s;
3032
3021
  }
@@ -3050,10 +3039,10 @@ class ke {
3050
3039
  */
3051
3040
  async generateImageBlob(e, t) {
3052
3041
  return new Promise((r, i) => {
3053
- const s = this.getMimeType(t.format), n = (a) => {
3054
- a ? r(a) : i(new Error(`Failed to generate ${t.format.toUpperCase()} blob`));
3042
+ const s = this.getMimeType(t.format), a = (n) => {
3043
+ n ? r(n) : i(new Error(`Failed to generate ${t.format.toUpperCase()} blob`));
3055
3044
  };
3056
- t.format === "png" ? e.toBlob(n, s) : e.toBlob(n, s, t.quality);
3045
+ t.format === "png" ? e.toBlob(a, s) : e.toBlob(a, s, t.quality);
3057
3046
  });
3058
3047
  }
3059
3048
  /**
@@ -3280,13 +3269,10 @@ class I {
3280
3269
  static async create(e = null, t = {}) {
3281
3270
  const r = new I(e, t), i = r._standalone ? t : void 0;
3282
3271
  r.textmodeCanvas = new be(r.captureSource, r._standalone, i), r._renderer = new fe(r.textmodeCanvas.getWebGLContext());
3283
- let s, n;
3284
- r._standalone ? (s = t.width || 800, n = t.height || 600) : (s = r.textmodeCanvas.width || 800, n = r.textmodeCanvas.height || 600), r._canvasFramebuffer = r._renderer.createFramebuffer(s, n), r._font = new ve(r._renderer, t.fontSize ?? 16), await r._font.initialize(t.fontSource);
3285
- const a = r._font.maxGlyphDimensions;
3286
- return r._grid = new xe(r.textmodeCanvas.canvas, a.width, a.height), r._pipeline = new Ue(r._renderer, r._font, r._grid), r.setupEventListeners(), r._standalone && (r.textmodeCanvas.onTransformChange = () => {
3287
- const l = r.textmodeCanvas.getEffectiveRenderingDimensions();
3288
- r._renderer.resetViewport(l.width, l.height), r._mode === "auto" && r.render();
3289
- }), r.startAutoRendering(), r;
3272
+ let s, a;
3273
+ r._standalone ? (s = t.width || 800, a = t.height || 600) : (s = r.textmodeCanvas.width || 800, a = r.textmodeCanvas.height || 600), r._canvasFramebuffer = r._renderer.createFramebuffer(s, a), r._font = new ve(r._renderer, t.fontSize ?? 16), await r._font.initialize(t.fontSource);
3274
+ const n = r._font.maxGlyphDimensions;
3275
+ return r._grid = new xe(r.textmodeCanvas.canvas, n.width, n.height), r._pipeline = new Ue(r._renderer, r._font, r._grid), r.setupEventListeners(), r.startAutoRendering(), r;
3290
3276
  }
3291
3277
  setupEventListeners() {
3292
3278
  this._windowResizeListener = () => {
@@ -3527,12 +3513,7 @@ class I {
3527
3513
  }
3528
3514
  }
3529
3515
  resize() {
3530
- if (this.textmodeCanvas.resize(), this._canvasFramebuffer.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this._grid.resize(), this._pipeline.resize(), this._standalone) {
3531
- const e = this.textmodeCanvas.getEffectiveRenderingDimensions();
3532
- this._renderer.resetViewport(e.width, e.height);
3533
- } else
3534
- this._renderer.resetViewport();
3535
- this._mode !== "manual" && this.render();
3516
+ this.textmodeCanvas.resize(), this._canvasFramebuffer.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this._grid.resize(), this._pipeline.resize(), this._renderer.resetViewport(), this._mode !== "manual" && this.render();
3536
3517
  }
3537
3518
  /**
3538
3519
  * Start automatic rendering
@@ -3766,16 +3747,11 @@ class I {
3766
3747
  * ```
3767
3748
  */
3768
3749
  fontSize(e) {
3769
- if (v.validate(
3750
+ v.validate(
3770
3751
  typeof e == "number" && e > 0,
3771
3752
  "Font size must be a positive number greater than 0.",
3772
3753
  { method: "fontSize", providedValue: e }
3773
- ) && this._font.fontSize !== e)
3774
- if (this._font.setFontSize(e), this._grid.resizeCellPixelDimensions(this._font.maxGlyphDimensions.width, this._font.maxGlyphDimensions.height), this._pipeline.resize(), this._standalone) {
3775
- const t = this.textmodeCanvas.getEffectiveRenderingDimensions();
3776
- this._renderer.resetViewport(t.width, t.height);
3777
- } else
3778
- this._renderer.resetViewport();
3754
+ ) && this._font.fontSize !== e && (this._font.setFontSize(e), this._grid.resizeCellPixelDimensions(this._font.maxGlyphDimensions.width, this._font.maxGlyphDimensions.height), this._pipeline.resize(), this._renderer.resetViewport());
3779
3755
  }
3780
3756
  /**
3781
3757
  * Set a draw callback function that will be executed before each render.
@@ -3842,12 +3818,7 @@ class I {
3842
3818
  * @param height The new height of the canvas.
3843
3819
  */
3844
3820
  resizeCanvas(e, t) {
3845
- if (this.textmodeCanvas.resize(e, t), this._canvasFramebuffer.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this._grid.resize(), this._pipeline.resize(), this._standalone) {
3846
- const r = this.textmodeCanvas.getEffectiveRenderingDimensions();
3847
- this._renderer.resetViewport(r.width, r.height);
3848
- } else
3849
- this._renderer.resetViewport();
3850
- this._mode !== "manual" && this.render();
3821
+ this.textmodeCanvas.resize(e, t), this._canvasFramebuffer.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this._grid.resize(), this._pipeline.resize(), this._renderer.resetViewport(), this._mode !== "manual" && this.render();
3851
3822
  }
3852
3823
  /**
3853
3824
  * @inheritDoc TextmodeConversionPipeline.get
@@ -4458,7 +4429,7 @@ class N {
4458
4429
  * ```
4459
4430
  */
4460
4431
  static get version() {
4461
- return "0.1.6-beta.2";
4432
+ return "0.1.6-beta.3";
4462
4433
  }
4463
4434
  constructor() {
4464
4435
  throw new Error("Textmode is a static class and cannot be instantiated.");
@@ -4470,7 +4441,7 @@ const He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4470
4441
  export {
4471
4442
  be as TextmodeCanvas,
4472
4443
  Ue as TextmodeConversionPipeline,
4473
- ae as TextmodeErrorLevel,
4444
+ ne as TextmodeErrorLevel,
4474
4445
  ve as TextmodeFont,
4475
4446
  xe as TextmodeGrid,
4476
4447
  I as Textmodifier,