summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-14 16:12:14 +0900
committerRandy Morgan <[email protected]>2012-09-14 16:12:14 +0900
commitd92dffcef4b65fdef0d5cead0bc63444d8b34df0 (patch)
treea5eb15887b3770fc8ba6ec0b03c519b5098c08e8 /lib/axlsx/stylesheet
parentbcf38488906554162d1ec6dc04837f802873b567 (diff)
downloadcaxlsx-d92dffcef4b65fdef0d5cead0bc63444d8b34df0.tar.gz
caxlsx-d92dffcef4b65fdef0d5cead0bc63444d8b34df0.zip
New fonts should use the default font values before applying custom style options via add_style
Diffstat (limited to 'lib/axlsx/stylesheet')
-rw-r--r--lib/axlsx/stylesheet/styles.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index 0532af66..fd956a8c 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -279,7 +279,7 @@ 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(options)
+ font = Font.new(fonts.first.instance_values.merge(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