R
Railway14mo ago
Natália

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
Percy14mo ago
Project ID: 0f008f7a-ba8e-4529-8c34-36c1578c7e2d
Brody
Brody14mo ago
do you have any logs that mention missing fonts?
Natália
Natália14mo ago
Yes, here it is, it's the same error described in the Sharp documentation
No description
Brody
Brody14mo ago
send it again without cropping
Natália
Natália14mo 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ália14mo ago
here it is anyway
No description
Brody
Brody14mo ago
try setting a service variable FONTCONFIG_PATH = /etc/fonts
Natália
Natália14mo ago
Tried right now, it seems it didn't work :/ Thanks for the help anyway, I'll continue searching
Brody
Brody14mo 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ália10mo 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
Brody10mo ago
that would have been the very next thing i would have had you try