class NumPlot::Font

The class representing a font in gnuplot.

Example:

Font["ariel"] # ariel font, default size
Font["ariel", 12] # ariel font, the size is 12 point

Public Class Methods

[](fontname, size=nil)
Alias for: new
new(fontname, size=nil) click to toggle source

Create a new Font object. @param fontname the name of font @param size[String, nil] the size of font, nil to default @example

Font.new("ariel") # ariel font, default size
Font.new("ariel", 12) # ariel font, the size is 12 point
# File lib/numplot.rb, line 135
def initialize(fontname, size=nil)
  @s = size ? "#{fontname},#{size}" : fontname
end
Also aliased as: []

Public Instance Methods

to_gnuplot_string() click to toggle source

Convert self to gnuplot font (quoted) string. @visibility private

# File lib/numplot.rb, line 141
def to_gnuplot_string
  "\"#{@s}\""
end