class RubyXL::Font
Constants
- MAX_DIGIT_WIDTH
Since we have no capability to load the actual fonts, we'll have to live with the default.
Public Instance Methods
==(other)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 29 def ==(other) (!(self.i && self.i.val) == !(other.i && other.i.val)) && (!(self.b && self.b.val) == !(other.b && other.b.val)) && (!(self.u && self.u.val) == !(other.u && other.u.val)) && (!(self.strike && self.strike.val) == !(other.strike && other.strike.val)) && ((self.name && self.name.val) == (other.name && other.name.val)) && ((self.sz && self.sz.val) == (other.sz && other.sz.val)) && (self.color == other.color) # Need to write proper comparison for color end
get_name()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 71 def get_name name && name.val end
get_rgb_color()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 87 def get_rgb_color color && color.rgb end
get_size()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 79 def get_size sz && sz.val end
is_bold()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 47 def is_bold b && b.val end
is_italic()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 39 def is_italic i && i.val end
is_strikethrough()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 63 def is_strikethrough strike && strike.val end
is_underlined()
click to toggle source
# File lib/rubyXL/objects/font.rb, line 55 def is_underlined u && u.val end
set_bold(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 51 def set_bold(val) self.b = RubyXL::BooleanValue.new(:val => val) end
set_italic(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 43 def set_italic(val) self.i = RubyXL::BooleanValue.new(:val => val) end
set_name(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 75 def set_name(val) self.name = RubyXL::StringValue.new(:val => val) end
set_rgb_color(font_color)
click to toggle source
Helper method to modify the font color
# File lib/rubyXL/objects/font.rb, line 92 def set_rgb_color(font_color) self.color = RubyXL::Color.new(:rgb => font_color.to_s) end
set_size(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 83 def set_size(val) self.sz = RubyXL::FloatValue.new(:val => val) end
set_strikethrough(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 67 def set_strikethrough(val) self.strike = RubyXL::BooleanValue.new(:val => val) end
set_underline(val)
click to toggle source
# File lib/rubyXL/objects/font.rb, line 59 def set_underline(val) self.u = RubyXL::BooleanValue.new(:val => val) end