Skip to content

函数: getDefaultFontBuffers()

ts
function getDefaultFontBuffers(): Promise<DefaultFontBuffers>;

定义于: index.ts:237

默认海报字体(源文件在 assets/fonts/)。 模块级缓存;satori 等直接用 ArrayBuffer。

用法约定(见 draw loadFonts / fontFamily):

  • 中文 / 日文:Noto Sans SC
  • 英文装饰:Comfortaa

返回

Promise<DefaultFontBuffers>

默认 CJK 与 Latin 字体字节

抛出

字体资源读取或请求失败

示例

ts
const { notoSansSc, comfortaa } = await getDefaultFontBuffers();
const fonts = [
  { name: "Noto Sans SC", data: notoSansSc, weight: 700, style: "normal" },
  { name: "Comfortaa", data: comfortaa, weight: 700, style: "normal" },
];