WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Function measureTexts

    • 批量测量文字宽高

      默认按来源分流:带克隆标记(或显式指定了模板)的走服务端,其余走本地 WASM。 服务端那部分按模板分组,每组合并成一次请求。

      const results = await measureTexts([
      { text: '粉质粘土', height: 2.5, width: 30, cloneSource: 'clone_96BA_template_huanghe_v1' },
      { text: '普通文字', height: 3, type: 'TEXT', styleName: 'Standard' }
      ]);

      Parameters

      Returns Promise<ITextMeasureResult[]>

      与入参等长的结果数组,测不了的位置为 null