What kind of fonts does Railway have?
I'm doing some image manipulation and it doesn't have Arial bold? Yet, doing
railway run fc-list :family | grep Arial
it shows it right there.Solution:Jump to solution
wouldnt it be possible for you to simply include the font file in your repo? and have your code load the font from that set location?
17 Replies
Project ID:
dfec217a-7ab4-45ca-884f-2b630c39e9d4
Project ID: dfec217a-7ab4-45ca-884f-2b630c39e9d4
tbh i've no idea but you can create a Dockerfile and add any font you want
Isn't it because
railway run
runs locally on your machine. So when you do that, fc-list
returns what you have on your computer, but that's not what is hosted on railway (https://docs.railway.app/guides/cli#local-development)Oh what? I've been using
railway run rails c
to access the data on production.
This is news to me. Hmmm.railway run
also copies your environment variables so you might be connecting to your production database in your machineAny hints on how to create a dockerfile with the fonts for railway? I'm so noob with how to do that or is there like a nixPkg that can help install some defaults?
there's probably a ubuntu package that includes those fonts, so there's no need for a Dockerfile, i'll cc @Brody here because he knows how to use nixpacks config files to install custom ubuntu packages
but you can always read the documentation
https://nixpacks.com/docs/configuration/file
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image
Thanks @ThallesComH @jeremy for the help this morning!
And calling on @Brody , I think he is tired of helping me these days hahaha.
If I was tired of helping I wouldn't have taken a job at Railway
do you think you could provide a minimal reproducible example?
Not really, any font is OK at this point, I just don't know how to check what fonts are installed with the defaults on railway.
I have this in my nixpacks.toml, but it seems like the fonts are not installed? Or i'm not sure where to find them or whether i'm refering the right name because I can't do a
ls
on railway since I can't ssh
and see what's on there (or at least I don't know how).Solution
wouldnt it be possible for you to simply include the font file in your repo? and have your code load the font from that set location?
Hm. Good idea. Like what you did here: https://github.com/railwayapp/docs/tree/main/public/fonts
I'm guessing?
GitHub
docs/public/fonts at main · railwayapp/docs
Railway documentation. Contribute to railwayapp/docs development by creating an account on GitHub.
yeah or here - https://github.com/brody192/node-canvas-fonts/tree/main/fonts
you might need fontconfig as an apt package
That fixed it, thanks for the 💡 idea @Brody !
awsome!