updateFont 更新字体
updateFont
类型: MethodDeclaration
所属类: Printer
定义位置: printer.ts
描述
更新字体
返回值
类型: Promise<void>
源代码
位置: 第 1388 行
private static async updateFont(): Promise<void> {
    let font = this.font ?? ''
    const fontFamily = Data.config.text.fontFamily || 'sans-serif'
    const guid = this.languageFont
    if (guid) {
      const meta = Data.manifest.guidMap[guid] as FontFileMeta | undefined
      if (!meta) return
      const name = meta.name ?? meta.path.match(/([^/]+)\.\S+\.\S+$/)?.[1]
      if (name) {
        await this.importFonts([guid])
        font = `${name}, ${fontFamily}`
      }
    } else {
      font = fontFamily
    }
    if (this.font !== font) {
      this.font = font
      this.updateAllPrinters()
    }
  }
文档生成时间:2025/7/21 20:53:39