Spacing!
parent
82ff08041e
commit
9cde048c00
|
|
@ -26,8 +26,10 @@ module Squib
|
||||||
:valign => :top,
|
:valign => :top,
|
||||||
:justify => false,
|
:justify => false,
|
||||||
:ellipsize => :end,
|
:ellipsize => :end,
|
||||||
|
:wrap => true,
|
||||||
:width => :native,
|
:width => :native,
|
||||||
:height => :native,
|
:height => :native,
|
||||||
|
:spacing => 0,
|
||||||
:alpha => 1.0,
|
:alpha => 1.0,
|
||||||
:format => :png,
|
:format => :png,
|
||||||
:dir => "_output",
|
:dir => "_output",
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ module Squib
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
# @api private
|
# @api private
|
||||||
def text(str, font, x, y, color, options)
|
def text(str, font, x, y, color, options)
|
||||||
|
Squib.logger.debug {"Placing '#{str}'' with font '#{font}' @ #{x}, #{y}, color: #{color}, and options: #{options}"}
|
||||||
cc = cairo_context
|
cc = cairo_context
|
||||||
cc.set_source_color(color)
|
cc.set_source_color(color)
|
||||||
cc.move_to(x,y)
|
cc.move_to(x,y)
|
||||||
|
|
@ -98,6 +99,7 @@ module Squib
|
||||||
layout = ellipsize(layout, options)
|
layout = ellipsize(layout, options)
|
||||||
layout = align(layout, options)
|
layout = align(layout, options)
|
||||||
layout.justify = options[:justify] unless options[:justify].nil?
|
layout.justify = options[:justify] unless options[:justify].nil?
|
||||||
|
layout.spacing = options[:spacing] * Pango::SCALE unless options[:spacing].nil?
|
||||||
cc.update_pango_layout(layout)
|
cc.update_pango_layout(layout)
|
||||||
valign(cc, layout, x,y, options[:valign])
|
valign(cc, layout, x,y, options[:valign])
|
||||||
cc.update_pango_layout(layout) ; cc.show_pango_layout(layout)
|
cc.update_pango_layout(layout) ; cc.show_pango_layout(layout)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue