dascom-le-editor 0.0.50 → 0.0.51

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.
package/README.md CHANGED
@@ -440,7 +440,7 @@ editorInstance.toggleEditTabs(false);
440
440
 
441
441
  编辑器的默认字体是 `Source Han Sans SC`(思源黑体)。创建 `LabelEditor` 时会自动开始加载该字体;字体加载是异步的,可通过 `ready()` 等待完成。加载模板、导出图片或显示打印预览前应等待 `ready()`,避免字体尚未就绪时使用系统回退字体进行文字排版。
442
442
 
443
- 其余内置字体不会在创建编辑器时自动加载。宿主可根据模板实际使用的字体调用 `loadBuiltinFont()` 或 `loadBuiltinFonts()`;若需加载默认字体列表中的其余全部字体,可调用 `loadAllDefaultFonts()`。在加载模板或渲染前等待加载结果。内置字体资源随插件发布,调用加载接口时才会在页面中注册并加载相应字体。
443
+ 其余内置字体不会在创建编辑器时自动加载。宿主可根据模板实际使用的字体调用 `loadBuiltinFont()` 或 `loadBuiltinFonts()`;若需加载全部内置默认字体,可调用 `loadAllDefaultFonts()`。该方法也会等待思源黑体就绪;若它已由构造函数开始加载,会复用同一个加载任务。内置字体资源随插件发布,调用加载接口时才会在页面中注册并加载相应字体。
444
444
 
445
445
  ```js
446
446
  const editorInstance = new LabelEditor(container)
@@ -456,7 +456,7 @@ await editorInstance.loadBuiltinFonts([
456
456
  ])
457
457
  await editorInstance.loadBuiltinFont('Caladea')
458
458
 
459
- // 一次加载其余全部内置默认字体(不包括已自动加载的 Source Han Sans SC)
459
+ // 一次加载全部内置默认字体(包含 Source Han Sans SC;已开始加载时会复用加载任务)
460
460
  await editorInstance.loadAllDefaultFonts()
461
461
 
462
462
  // 内置字体加载完成后再加载引用这些字体的模板。
@@ -506,7 +506,7 @@ if (loaded) {
506
506
  // 字体已就绪,可将选中的文本对象设置为 Caladea
507
507
  }
508
508
 
509
- // 4. 需要完整字体列表时加载其余全部内置默认字体
509
+ // 4. 需要完整字体列表时加载全部内置默认字体
510
510
  const allLoaded = await editor.loadAllDefaultFonts()
511
511
  if (allLoaded.every(Boolean)) {
512
512
  // 内置默认字体均已就绪
package/dist/editor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { L as p } from "./main-CQ7DTA4w.js";
2
+ import { L as p } from "./main-C1gk8J06.js";
3
3
  import "vue-lazyload";
4
4
  export {
5
5
  p as default