云功能:访问系统字体 [英] Cloud Functions: Access System Fonts

查看:67
本文介绍了云功能:访问系统字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用hummusJS通过Firebase Cloud功能处理PDF文件.

Im am using hummusJS to manipulate PDF Files with Firebase Cloud functions.

据我所知,Hummus需要访问实际的真型字体文件,才能使用PDF中的字体.在我的本地环境中,我使用的是:

As far as I know, Hummus requires to have access to an actual true type font file, to be able to use fonts in PDFs. In my local env I'm using this:

> https://github.com/devongovett/font-manager

它有一些依赖于libfontconfig-dev,它不能在云功能上工作.

It has some depends on some libfontconfig-dev, its not working on cloud functions.

根据这篇文章,没有字体就无法使用鹰嘴豆泥:

According to this post there is no way to use hummus without fonts:

https://github.com/galkahana/HummusJS/issues/120

我可以在线存储所需的字体,并每次都将其下载到函数中,但这感觉不对.

I could store the needed fonts online and download it everytime into the function, but this doesn't feel right.

有什么主意我怎么做这项工作?

Any Idea how I could make this work?

我不挑剔,我会使用Comic Sans旁边的所有字体

edit: I'm not picky, I would use every font beside Comic Sans

推荐答案

我设法将TrueType文件放入包中.

I managed to get the TrueType File into my package.

只需将本地文件作为依赖项添加到package.json中,在Firebase功能上工作.

Just added the local file as dependency to package.json, its working on Firebase Functions.

这篇关于云功能:访问系统字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆