【发布时间】:2013-08-01 10:33:08
【问题描述】:
我正在尝试使用带有“Arial”字体的虾生成 pdf。我在继承的 Prawn::Document 类中完成所有这些工作。
我已经导入了arial字体:
font_families.update("Arial" => {
:normal => { :file => "#{Rails.root}/app/assets/fonts/Arial.ttf", :font => "Arial" },
:bold => { :file => "#{Rails.root}/app/assets/fonts/Arial_Bold.ttf", :font => "Arial_Bold" }
})
font "Arial", size: 11 # use this font and size from now on
这可以正常工作,但只能在 bounding_boxes 之外。 bounding_box 内的文本与外部使用的字体无关。当我尝试在框中定义字体时,出现此错误:
is not a known font.
bounding_box 是否能够自定义字体?谢谢!
【问题讨论】:
标签: ruby-on-rails pdf fonts prawn