def self.installed_fonts
return @installed_fonts if @installed_fonts
fonts = {}
Prawn::Svg::Interface.font_path.uniq.collect {|path| Dir["#{path}/*"]}.flatten.each do |filename|
information = font_information(filename) rescue nil
if information && font_name = information[1]
font_style = case information[2]
when 'Bold' then :bold
when 'Italic' then :italic
when 'Bold Italic' then :bold_italic
else :normal
end
(fonts[font_name.downcase] ||= {})[font_style] = filename
end
end
@installed_fonts = fonts
end