You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Firebase Cloud Function中使用自定义资源与字体?

在Google Cloud Function中使用自定义字体的示例

以下是在Google Cloud Function里配置自定义字体资源的示例代码,用于定义Courier字体不同字重、样式的文件路径:

const fonts = {
  Courier: {
    normal: 'fonts/Courier.ttf',
    bold: 'fonts/Courier-Bold.ttf',
    italics: 'fonts/Courier-Oblique.ttf',
    bolditalics: 'fonts/Courier-BoldOblique.ttf'
  }
}

注:原代码中normal属性的路径拼写有误(fonst应为fonts),已修正为正确路径

内容的提问来源于stack exchange,提问作者Sivuyile TG Magutywa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 16:12:33