Add text rotation

This commit is contained in:
David Turner
2014-10-17 08:17:07 -04:00
committed by Andy Meneely
parent cdc994b77a
commit 91e7adafd5
5 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -88,11 +88,12 @@ module Squib
def text(str, font, font_size, color,
x, y, width, height,
markup, justify, wrap, ellipsize,
spacing, align, valign, hint)
spacing, align, valign, hint, rotation)
Squib.logger.debug {"Placing '#{str}'' with font '#{font}' @ #{x}, #{y}, color: #{color}, etc."}
use_cairo do |cc|
cc.set_source_color(color)
cc.move_to(x,y)
cc.rotate(rotation)
layout = cc.create_pango_layout
font_desc = Pango::FontDescription.new(font)
font_desc.size = font_size * Pango::SCALE unless font_size.nil?