@pixerate/editor 0.140.1 → 0.140.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.
@@ -4050,13 +4050,18 @@ function num(v, path, min, max) {
4050
4050
  if (!isNum2(v) || v < min || v > max) fail3(`${path} must be a number from ${min} to ${max}, got ${JSON.stringify(v)}.`);
4051
4051
  return v;
4052
4052
  }
4053
- var TEXT_STYLE_FIELDS = ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
4053
+ var TEXT_STYLE_FIELDS = ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
4054
4054
  function patchTextStyle(base, patch, path = "style") {
4055
4055
  const out = { ...base };
4056
4056
  const o = out;
4057
4057
  for (const [k, v] of Object.entries(patch)) {
4058
4058
  if (v === void 0) continue;
4059
4059
  switch (k) {
4060
+ case "postScriptName":
4061
+ if (typeof v !== "string" && v !== null) fail3(`${path}.postScriptName must be a PostScript font name.`);
4062
+ if (v) out.postScriptName = v.trim();
4063
+ else delete out.postScriptName;
4064
+ break;
4060
4065
  case "fontFamily":
4061
4066
  if (typeof v !== "string" || !v.trim()) fail3(`${path}.fontFamily must be a font family name.`);
4062
4067
  out.fontFamily = v.trim();
@@ -4050,13 +4050,18 @@ function num(v, path, min, max) {
4050
4050
  if (!isNum2(v) || v < min || v > max) fail3(`${path} must be a number from ${min} to ${max}, got ${JSON.stringify(v)}.`);
4051
4051
  return v;
4052
4052
  }
4053
- var TEXT_STYLE_FIELDS = ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
4053
+ var TEXT_STYLE_FIELDS = ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
4054
4054
  function patchTextStyle(base, patch, path = "style") {
4055
4055
  const out = { ...base };
4056
4056
  const o = out;
4057
4057
  for (const [k, v] of Object.entries(patch)) {
4058
4058
  if (v === void 0) continue;
4059
4059
  switch (k) {
4060
+ case "postScriptName":
4061
+ if (typeof v !== "string" && v !== null) fail3(`${path}.postScriptName must be a PostScript font name.`);
4062
+ if (v) out.postScriptName = v.trim();
4063
+ else delete out.postScriptName;
4064
+ break;
4060
4065
  case "fontFamily":
4061
4066
  if (typeof v !== "string" || !v.trim()) fail3(`${path}.fontFamily must be a font family name.`);
4062
4067
  out.fontFamily = v.trim();