You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, first thanks for the great gem!
I recently tried to use the prawn-icon gem to include Font Awesome icons in my PDF document.
The issue is the following: I need the icons for my table, so I'm using the table_icon helper:
prawn_document(page_layout: :landscape, page_size: "A6", filename: "Bestellungen_#{I18n.l(Date.today)}") do |pdf|
# pdf.font_families.update(
# "Font Awesome" => { :normal => Rails.root.join("app", "assets", "fonts", "fa-solid-900.ttf") }
# )
@orders.each do |order|
data = [
["Salat", "Suppe", "Dessert"],
[pdf.table_icon('fas-birthday-cake')]
]
pdf.font("Helvetica", size: 20, style: :bold) do
pdf.float { pdf.text(order.user.name, align: :left) }
pdf.text(l(order.day), align: :right)
end
pdf.move_down 10
pdf.table(data)
end
end
Without changing the font for the whole document to Font Awesome with pdf.font "Font Awesome", I keep getting the following error:
Your document includes text that's not compatible with the Windows-1252 character set.
If you need full UTF-8 support, use external fonts instead of PDF's built-in fonts.
But unfortunately it neither works when I just change the cell font type like this:
Hi Guys! I'm the author of prawn-icon and I've done a bit of research here.
It looks like #60 was merged in years ago, but a release was never made on Rubygems. This PR should resolve the issue that @alliedarmour is running into.
Hey, first thanks for the great gem!
I recently tried to use the
prawn-icon
gem to include Font Awesome icons in my PDF document.The issue is the following: I need the icons for my table, so I'm using the table_icon helper:
Without changing the font for the whole document to Font Awesome with
pdf.font "Font Awesome"
, I keep getting the following error:But unfortunately it neither works when I just change the cell font type like this:
Is there anything I can do to use the gem with prawn-rails? Or might it be a problem with prawn-table?
The text was updated successfully, but these errors were encountered: