我一直在为 Ruby 随机尝试 Prawn 中的字体。
例如:Times New Roman - 是 Palatino Linotype - 否
有哪些字体可用哪些不可用的列表吗?
我一直在为 Ruby 随机尝试 Prawn 中的字体。
例如:Times New Roman - 是 Palatino Linotype - 否
有哪些字体可用哪些不可用的列表吗?
代码中有一个默认字体列表,位于 lib/prawn/font/afm.rb(版本 1.0.0.rc1):
module Prawn
class Font
class AFM < Font
BUILT_INS = %w[ Courier Helvetica Times-Roman Symbol ZapfDingbats
Courier-Bold Courier-Oblique Courier-BoldOblique
Times-Bold Times-Italic Times-BoldItalic
Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique ]
14 fonts are available by default: Courier, Helvetica, Symbol, Times and ZapfDingbats in various bold and italic forms.
In nearly every case I'd recommend using the font() method to load an external truetype font of your choosing. This has the added benefit of give you the option to use non latin characters.
Short answer: there's no list, just use TTF.