@coderline/alphatab 1.8.0-alpha.1668 → 1.8.0-alpha.1669

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,5 +1,5 @@
1
1
  /*!
2
- * alphaTab v1.8.0-alpha.1668 (develop, build 1668)
2
+ * alphaTab v1.8.0-alpha.1669 (develop, build 1669)
3
3
  *
4
4
  * Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -203,9 +203,9 @@ class AlphaTabError extends Error {
203
203
  * @internal
204
204
  */
205
205
  class VersionInfo {
206
- static version = '1.8.0-alpha.1668';
207
- static date = '2026-01-07T02:24:14.986Z';
208
- static commit = 'd04d3bea64ae690eb26684fa027594057bb043b6';
206
+ static version = '1.8.0-alpha.1669';
207
+ static date = '2026-01-08T02:24:31.439Z';
208
+ static commit = 'f7c00b0b8db32011293f475bf5e930d21c1903ac';
209
209
  static print(print) {
210
210
  print(`alphaTab ${VersionInfo.version}`);
211
211
  print(`commit: ${VersionInfo.commit}`);
@@ -55384,11 +55384,18 @@ class BrowserUiFacade {
55384
55384
  }
55385
55385
  }
55386
55386
  destroy() {
55387
- this.rootContainer.element.innerHTML = '';
55387
+ const element = this.rootContainer.element;
55388
+ element.innerHTML = '';
55388
55389
  const webFont = this._webFont;
55389
- webFont.usages--;
55390
- if (webFont.usages <= 0) {
55391
- webFont.element.remove();
55390
+ const styleElement = webFont.elements.get(element.ownerDocument);
55391
+ if (styleElement) {
55392
+ styleElement.usages--;
55393
+ if (styleElement.usages <= 0) {
55394
+ styleElement.element.remove();
55395
+ webFont.elements.delete(element.ownerDocument);
55396
+ }
55397
+ }
55398
+ if (webFont.elements.size === 0) {
55392
55399
  BrowserUiFacade._registeredWebFonts.delete(webFont.hash);
55393
55400
  }
55394
55401
  }
@@ -55520,8 +55527,8 @@ class BrowserUiFacade {
55520
55527
  const registeredWebFonts = BrowserUiFacade._registeredWebFonts;
55521
55528
  if (registeredWebFonts.has(hash)) {
55522
55529
  const webFont = registeredWebFonts.get(hash);
55523
- webFont.usages++;
55524
55530
  webFont.checker.fontLoaded.on(this._onFontLoaded.bind(this));
55531
+ this._createStyleElement(webFont, root);
55525
55532
  this._webFont = webFont;
55526
55533
  return;
55527
55534
  }
@@ -55552,10 +55559,6 @@ class BrowserUiFacade {
55552
55559
  font-size: ${settings.display.resources.engravingSettings.musicFontSize}px;
55553
55560
  overflow: visible !important;
55554
55561
  }`;
55555
- const styleElement = root.createElement('style');
55556
- styleElement.id = `alphaTabStyle${fontSuffix}`;
55557
- styleElement.innerHTML = css;
55558
- root.getElementsByTagName('head').item(0).appendChild(styleElement);
55559
55562
  const checker = new FontLoadingChecker([familyName]);
55560
55563
  checker.fontLoaded.on(this._onFontLoaded.bind(this));
55561
55564
  this._fontCheckers.set(familyName, checker);
@@ -55563,14 +55566,29 @@ class BrowserUiFacade {
55563
55566
  settings.display.resources.smuflFontFamilyName = familyName;
55564
55567
  const webFont = {
55565
55568
  hash,
55566
- element: styleElement,
55569
+ elements: new Map(),
55567
55570
  fontSuffix,
55568
- usages: 1,
55569
- checker
55571
+ checker,
55572
+ cssSource: css
55570
55573
  };
55574
+ this._createStyleElement(webFont, root);
55571
55575
  registeredWebFonts.set(hash, webFont);
55572
55576
  this._webFont = webFont;
55573
55577
  }
55578
+ _createStyleElement(webFont, root) {
55579
+ if (webFont.elements.has(root)) {
55580
+ webFont.elements.get(root).usages++;
55581
+ return;
55582
+ }
55583
+ const styleElement = root.createElement('style');
55584
+ styleElement.id = `alphaTabStyle${webFont.fontSuffix}`;
55585
+ styleElement.innerHTML = webFont.cssSource;
55586
+ root.getElementsByTagName('head').item(0).appendChild(styleElement);
55587
+ webFont.elements.set(root, {
55588
+ element: styleElement,
55589
+ usages: 1
55590
+ });
55591
+ }
55574
55592
  static _cssFormat(format) {
55575
55593
  switch (format) {
55576
55594
  case FontFileFormat.EmbeddedOpenType:
package/dist/alphaTab.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * alphaTab v1.8.0-alpha.1668 (develop, build 1668)
2
+ * alphaTab v1.8.0-alpha.1669 (develop, build 1669)
3
3
  *
4
4
  * Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -209,9 +209,9 @@
209
209
  * @internal
210
210
  */
211
211
  class VersionInfo {
212
- static version = '1.8.0-alpha.1668';
213
- static date = '2026-01-07T02:24:14.986Z';
214
- static commit = 'd04d3bea64ae690eb26684fa027594057bb043b6';
212
+ static version = '1.8.0-alpha.1669';
213
+ static date = '2026-01-08T02:24:31.439Z';
214
+ static commit = 'f7c00b0b8db32011293f475bf5e930d21c1903ac';
215
215
  static print(print) {
216
216
  print(`alphaTab ${VersionInfo.version}`);
217
217
  print(`commit: ${VersionInfo.commit}`);
@@ -55390,11 +55390,18 @@
55390
55390
  }
55391
55391
  }
55392
55392
  destroy() {
55393
- this.rootContainer.element.innerHTML = '';
55393
+ const element = this.rootContainer.element;
55394
+ element.innerHTML = '';
55394
55395
  const webFont = this._webFont;
55395
- webFont.usages--;
55396
- if (webFont.usages <= 0) {
55397
- webFont.element.remove();
55396
+ const styleElement = webFont.elements.get(element.ownerDocument);
55397
+ if (styleElement) {
55398
+ styleElement.usages--;
55399
+ if (styleElement.usages <= 0) {
55400
+ styleElement.element.remove();
55401
+ webFont.elements.delete(element.ownerDocument);
55402
+ }
55403
+ }
55404
+ if (webFont.elements.size === 0) {
55398
55405
  BrowserUiFacade._registeredWebFonts.delete(webFont.hash);
55399
55406
  }
55400
55407
  }
@@ -55526,8 +55533,8 @@
55526
55533
  const registeredWebFonts = BrowserUiFacade._registeredWebFonts;
55527
55534
  if (registeredWebFonts.has(hash)) {
55528
55535
  const webFont = registeredWebFonts.get(hash);
55529
- webFont.usages++;
55530
55536
  webFont.checker.fontLoaded.on(this._onFontLoaded.bind(this));
55537
+ this._createStyleElement(webFont, root);
55531
55538
  this._webFont = webFont;
55532
55539
  return;
55533
55540
  }
@@ -55558,10 +55565,6 @@
55558
55565
  font-size: ${settings.display.resources.engravingSettings.musicFontSize}px;
55559
55566
  overflow: visible !important;
55560
55567
  }`;
55561
- const styleElement = root.createElement('style');
55562
- styleElement.id = `alphaTabStyle${fontSuffix}`;
55563
- styleElement.innerHTML = css;
55564
- root.getElementsByTagName('head').item(0).appendChild(styleElement);
55565
55568
  const checker = new FontLoadingChecker([familyName]);
55566
55569
  checker.fontLoaded.on(this._onFontLoaded.bind(this));
55567
55570
  this._fontCheckers.set(familyName, checker);
@@ -55569,14 +55572,29 @@
55569
55572
  settings.display.resources.smuflFontFamilyName = familyName;
55570
55573
  const webFont = {
55571
55574
  hash,
55572
- element: styleElement,
55575
+ elements: new Map(),
55573
55576
  fontSuffix,
55574
- usages: 1,
55575
- checker
55577
+ checker,
55578
+ cssSource: css
55576
55579
  };
55580
+ this._createStyleElement(webFont, root);
55577
55581
  registeredWebFonts.set(hash, webFont);
55578
55582
  this._webFont = webFont;
55579
55583
  }
55584
+ _createStyleElement(webFont, root) {
55585
+ if (webFont.elements.has(root)) {
55586
+ webFont.elements.get(root).usages++;
55587
+ return;
55588
+ }
55589
+ const styleElement = root.createElement('style');
55590
+ styleElement.id = `alphaTabStyle${webFont.fontSuffix}`;
55591
+ styleElement.innerHTML = webFont.cssSource;
55592
+ root.getElementsByTagName('head').item(0).appendChild(styleElement);
55593
+ webFont.elements.set(root, {
55594
+ element: styleElement,
55595
+ usages: 1
55596
+ });
55597
+ }
55580
55598
  static _cssFormat(format) {
55581
55599
  switch (format) {
55582
55600
  case exports.FontFileFormat.EmbeddedOpenType: