Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiberationSans-Regular fonts 404 (Not Found) #32

Open
pendelru opened this issue Apr 22, 2024 · 1 comment
Open

LiberationSans-Regular fonts 404 (Not Found) #32

pendelru opened this issue Apr 22, 2024 · 1 comment

Comments

@pendelru
Copy link

The entire QR-bill shows up but the fonts cannot be loaded:

GET https:///app/vendor/bundle/ruby/3.0.0/gems/qr-bills-1.0.9/web/assets/fonts/LiberationSans-Regular.woff net::ERR_ABORTED 404 (Not Found)
GET https:///app/vendor/bundle/ruby/3.0.0/gems/qr-bills-1.0.9/web/assets/fonts/LiberationSans-Regular.ttf net::ERR_ABORTED 404 (Not Found)

Code:
params[:output_params][:format] = "html"
@Bill = QRBills.generate(params)
<%= raw @Bill[:output] %>

Can anybody help?

@phylor
Copy link

phylor commented May 9, 2024

I assume you want to embed the HTML output in a website. For that, the fonts need to be served by your web server. If you use Rails and sprockets, you need to copy the fonts to your assets/fonts directory.

In addition, you need to configure qr-bill to use those font paths:

  params[:fonts][:eot] = font_url('LiberationSans-Regular.eot')
  params[:fonts][:woff] = font_url('LiberationSans-Regular.woff')
  params[:fonts][:ttf] = font_url('LiberationSans-Regular.ttf')
  params[:fonts][:svg] = font_url('LiberationSans-Regular.svg')

The URLs here have to be publicly available, as the browser will try to fetch them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants