Is it possible to use Fonts?

Hello, I have a Node.js server where I use the Sharp library to turn SVG's into other image formats. The problem is when the SVG has text on it, the library won't render it due to the fact that can't find the fonts on the system. Any tip on how I can make this work? Ps.: Sorry if my english is bad, it's not my mother language. Thanks in advance! Project ID: 0f008f7a-ba8e-4529-8c34-36c1578c7e2d
11 Replies
Percy
Percy2y ago
Project ID: 0f008f7a-ba8e-4529-8c34-36c1578c7e2d
Brody
Brody2y ago
do you have any logs that mention missing fonts?
Natália
NatáliaOP2y ago
Yes, here it is, it's the same error described in the Sharp documentation
No description
Brody
Brody2y ago
send it again without cropping
Natália
NatáliaOP2y ago
It's just this, the rest of the log is only the default log from Sequelize when making database operations, for the error on the fonts it's just this
Natália
NatáliaOP2y ago
here it is anyway
No description
Brody
Brody2y ago
try setting a service variable FONTCONFIG_PATH = /etc/fonts
Natália
NatáliaOP2y ago
Tried right now, it seems it didn't work :/ Thanks for the help anyway, I'll continue searching
Brody
Brody2y ago
okay try this instead, use this as a nixpacks.toml file in your project
[phases.setup]
nixPkgs = ["...", "fontconfig"]
[phases.setup]
nixPkgs = ["...", "fontconfig"]
Natália
NatáliaOP15mo ago
Okay, I'll try it as soon as possible and comeback here with the results, thanks again! Hello! After some time trying different combinations of service variables and configurations on nixpacks.toml file, I solved the issue by just using this one configuration:
[phases.setup]
aptPkgs = ['...', 'fontconfig']
[phases.setup]
aptPkgs = ['...', 'fontconfig']
Brody
Brody15mo ago
that would have been the very next thing i would have had you try
Want results from more Discord servers?
Add your server