lib/prawn/svg/font.rb in prawn-svg-0.34.2 vs lib/prawn/svg/font.rb in prawn-svg-0.35.0
- old
+ new
@@ -1,13 +1,13 @@
class Prawn::SVG::Font
GENERIC_CSS_FONT_MAPPING = {
- "serif" => "Times-Roman",
- "sans-serif" => "Helvetica",
- "cursive" => "Times-Roman",
- "fantasy" => "Times-Roman",
- "monospace" => "Courier"
- }
+ 'serif' => 'Times-Roman',
+ 'sans-serif' => 'Helvetica',
+ 'cursive' => 'Times-Roman',
+ 'fantasy' => 'Times-Roman',
+ 'monospace' => 'Courier'
+ }.freeze
attr_reader :name, :weight, :style
def self.weight_for_css_font_weight(weight)
case weight
@@ -36,10 +36,10 @@
!subfamilies.nil? && subfamilies.key?(subfamily)
end
# Construct a subfamily name, ensuring that the subfamily is a valid one for the font.
def subfamily
- if subfamilies = @font_registry.installed_fonts[name]
+ if (subfamilies = @font_registry.installed_fonts[name])
if subfamilies.key?(subfamily_name)
subfamily_name
elsif subfamilies.key?(:normal)
:normal
else