From 55a0dd9d3b522876dc97e109b2d38b261cdaf752 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Fri, 14 Sep 2012 18:13:40 +0900 Subject: Patch for 1.8.7 and update table style example to use custom name --- lib/axlsx/stylesheet/styles.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index fd956a8c..240d86fa 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -279,7 +279,11 @@ module Axlsx # @return [Font|Integer] def parse_font_options(options={}) return if (options.keys & [:fg_color, :sz, :b, :i, :u, :strike, :outline, :shadow, :charset, :family, :font_name]).empty? - font = Font.new(fonts.first.instance_values.merge(options)) + fonts.first.instance_values.each do |key, value| + # Thanks for that 1.8.7 - cant do a simple merge... + options[key.to_sym] = value unless options.keys.include?(key.to_sym) + end + font = Font.new(options) font.color = Color.new(:rgb => options[:fg_color]) if options[:fg_color] font.name = options[:font_name] if options[:font_name] options[:type] == :dxf ? font : fonts << font -- cgit v1.2.3