@unmade/text-renderer 0.1.2 → 0.1.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.
@@ -2728,7 +2728,7 @@ function Ks(e) {
2728
2728
  l.length * 2 + c.length * 2 + u.length * 2 + h.length * 2, !t) {
2729
2729
  const d = 16 + // Subtable header
2730
2730
  p.length * 4;
2731
- s.cmap12Offset = 12 + 2 * 2 + 4 + s.cmap4Length, s.fields.push({ name: "cmap12Format", type: "USHORT", value: 12 }, { name: "cmap12Reserved", type: "USHORT", value: 0 }, { name: "cmap12Length", type: "ULONG", value: d }, { name: "cmap12Language", type: "ULONG", value: 0 }, { name: "cmap12nGroups", type: "ULONG", value: p.length / 3 });
2731
+ s.cmap12Offset = 20 + s.cmap4Length, s.fields.push({ name: "cmap12Format", type: "USHORT", value: 12 }, { name: "cmap12Reserved", type: "USHORT", value: 0 }, { name: "cmap12Length", type: "ULONG", value: d }, { name: "cmap12Language", type: "ULONG", value: 0 }, { name: "cmap12nGroups", type: "ULONG", value: p.length / 3 });
2732
2732
  for (let f = 0; f < p.length; f++)
2733
2733
  s.fields.push(p[f]);
2734
2734
  }
@@ -5350,6 +5350,7 @@ function Zt(e, t, n, r, s) {
5350
5350
  z();
5351
5351
  break;
5352
5352
  case 19:
5353
+ // hintmask
5353
5354
  case 20:
5354
5355
  z(), B += h + 7 >> 3;
5355
5356
  break;
@@ -8110,7 +8111,7 @@ function Qa(e, t) {
8110
8111
  }
8111
8112
  function Gn(e, t, n, r, s) {
8112
8113
  let o;
8113
- return (t & r) > 0 ? (o = e.parseByte(), t & s || (o = -o), o = n + o) : (t & s) > 0 ? o = n : o = n + e.parseShort(), o;
8114
+ return (t & r) > 0 ? (o = e.parseByte(), (t & s) === 0 && (o = -o), o = n + o) : (t & s) > 0 ? o = n : o = n + e.parseShort(), o;
8114
8115
  }
8115
8116
  function ss(e, t, n) {
8116
8117
  const r = new S.Parser(t, n);
@@ -8926,6 +8927,7 @@ function we(e, t) {
8926
8927
  switch (this.env = e, this.stack = [], this.prog = t, e) {
8927
8928
  case "glyf":
8928
8929
  this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
8930
+ /* fall through */
8929
8931
  case "prep":
8930
8932
  this.fv = this.pv = this.dpv = ye, this.round = cs;
8931
8933
  }
@@ -12024,18 +12026,17 @@ function cc(e, t = {}) {
12024
12026
  return s.palettes = new rs(s), s;
12025
12027
  }
12026
12028
  function pc(e) {
12027
- var t;
12028
- const n = (t = e.tables) == null ? void 0 : t.svg, r = /* @__PURE__ */ new Map();
12029
- if (!n)
12030
- return r;
12031
- for (const [s, o] of n.entries()) {
12032
- const a = e.glyphs.get(s).getBoundingBox();
12033
- r.set(s, {
12034
- svg: new TextDecoder("utf-8").decode(o),
12035
- viewbox: `${a.x1} ${-a.y2} ${a.x2 - a.x1} ${a.y2 - a.y1}`
12029
+ const t = e.tables?.svg, n = /* @__PURE__ */ new Map();
12030
+ if (!t)
12031
+ return n;
12032
+ for (const [r, s] of t.entries()) {
12033
+ const o = e.glyphs.get(r).getBoundingBox();
12034
+ n.set(r, {
12035
+ svg: new TextDecoder("utf-8").decode(s),
12036
+ viewbox: `${o.x1} ${-o.y2} ${o.x2 - o.x1} ${o.y2 - o.y1}`
12036
12037
  });
12037
12038
  }
12038
- return r;
12039
+ return n;
12039
12040
  }
12040
12041
  async function hc(e) {
12041
12042
  const t = await cc(e);