class ImageParadise::SimpleLabel
Constants
- DEFAULT_FONT_TO_USE
#¶ ↑
DEFAULT_FONT_TO_USE
¶ ↑#¶ ↑
- DEFAULT_IMAGE_FORMAT
#¶ ↑
DEFAULT_IMAGE_FORMAT
¶ ↑#¶ ↑
- DO_OPEN_IN_BROWSER
#¶ ↑
DO_OPEN_IN_BROWSER
¶ ↑#¶ ↑
- REGEX_FOR_SIZE
#¶ ↑
REGEX_FOR_SIZE
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
add_default_background()
click to toggle source
add_default_fill()
click to toggle source
add_default_font()
click to toggle source
add_default_gravity()
click to toggle source
add_default_pointsize()
click to toggle source
add_label()
click to toggle source
add_output_file()
click to toggle source
add_size()
click to toggle source
build_up_main_command()
click to toggle source
#¶ ↑
build_up_main_command
¶ ↑
#¶ ↑
# File lib/image_paradise/label/simple_label.rb, line 97 def build_up_main_command @_ = 'convert'.dup add_default_background add_default_fill add_default_font add_default_gravity add_size add_label # add_default_pointsize # Do not add this option if you also added the default size. add_output_file end
consider_opening_in_the_browser()
click to toggle source
output_file?()
click to toggle source
output_then_run_the_main_command()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
ImageParadise::Base#reset
# File lib/image_paradise/label/simple_label.rb, line 75 def reset super() @_ = ''.dup @label = ''.dup @background = 'lightblue' @fill = 'blue' @font = DEFAULT_FONT_TO_USE @pointsize = '96' @output_file = 'label.'+DEFAULT_IMAGE_FORMAT.downcase set_size '250x75' end
run()
click to toggle source
set_label(i)
click to toggle source
#¶ ↑
set_label
¶ ↑
#¶ ↑
# File lib/image_paradise/label/simple_label.rb, line 54 def set_label(i) if i.is_a? Array i = i.join(' ').strip end # ======================================================================= # # Check whether the label includes a Dimension. This may be a conflict # if the user REALLY wants to use some integer value, as part of the # given label - but aside from this, I think in most other cases, # this is a good default. # ======================================================================= # if i =~ REGEX_FOR_SIZE size_dimension = $1.to_s.dup set_size(size_dimension) i.sub!(/#{size_dimension}/,'') end @label = i end