Class: NumPlot::Font

Inherits:
Object
  • Object
show all
Defined in:
lib/numplot.rb

Overview

The class representing a font in gnuplot.

Example: Font # ariel font, default size Font[“ariel”, 12] # ariel font, the size is 12 point

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Font) initialize(fontname, size = nil)

Create a new Font object.

Examples:

Font.new("ariel") # ariel font, default size
Font.new("ariel", 12) # ariel font, the size is 12 point

Parameters:

  • fontname (String)

    the name of font

  • size (String, nil) (defaults to: nil)

    the size of font, nil to default



135
136
137
# File 'lib/numplot.rb', line 135

def initialize(fontname, size=nil)
  @s = size ? "#{fontname},#{size}" : fontname
end

Class Method Details

+ (Font) [](fontname, size = nil)

Create a new Font object. See #initialize.

Returns:

  • (Font)

    A new Font object



149
# File 'lib/numplot.rb', line 149

__yard_ignore_here{ alias [] new }