@nxtedition/lib 26.0.14 → 26.0.15

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.
Files changed (2) hide show
  1. package/ass.js +7 -4
  2. package/package.json +1 -1
package/ass.js CHANGED
@@ -31,8 +31,9 @@ const BASE_HEIGHT = 1080
31
31
  *
32
32
  * @typedef {object} EmbeddableSubtitleFontFace
33
33
  * @property {string} family
34
- * @property {'normal'|'bold'} weight
35
- * @property {'normal'|'italic'} style
34
+ * @property {string} name
35
+ * @property {'normal'|'bold'} [weight]
36
+ * @property {'normal'|'italic'} [style]
36
37
  * @property {Uint8Array} data
37
38
  *
38
39
  * @typedef {object} Styles
@@ -351,8 +352,10 @@ function encFontFaces(fontFaces) {
351
352
  * @param {EmbeddableSubtitleFontFace} fontFace
352
353
  */
353
354
  function getFontName(fontFace) {
354
- const { family, weight, style } = fontFace
355
- return `${family}_${weight === 'bold' ? 'B' : ''}${style === 'italic' ? 'I' : ''}0`
355
+ const { name, family, weight, style } = fontFace
356
+ // NOTE: Seems like libass doesn't care about the font name as specified in the original spec.
357
+ // That is good, because then we can register more faces than the original spec allowed.
358
+ return name ?? `${family}_${weight === 'bold' ? 'B' : ''}${style === 'italic' ? 'I' : ''}0`
356
359
  }
357
360
 
358
361
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "26.0.14",
3
+ "version": "26.0.15",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",