Sha256: e24817caaca8345e4fc38721b5749ba1bcf19b722318b472d479d2687b169248

Contents?: true

Size: 1.16 KB

Versions: 24

Compression:

Stored size: 1.16 KB

Contents

require 'cairo'

class TextExtentsTest < Test::Unit::TestCase
  include Helper

  def test_new
    extents = Cairo::TextExtents.new
    assert_equal([0.0, -1.0, 0.0, 1.0, 1.0, 0.0],
                 [extents.x_bearing, extents.y_bearing,
                  extents.width, extents.height,
                  extents.x_advance, extents.y_advance])
  end

  def test_accessor
    extents = Cairo::TextExtents.new
    extents.x_bearing = 0.1
    extents.y_bearing = 0.2
    extents.width = 0.3
    extents.height = 0.4
    extents.x_advance = 0.5
    extents.y_advance = 0.6
    assert_equal([0.1, 0.2, 0.3, 0.4, 0.5, 0.6],
                 [extents.x_bearing, extents.y_bearing,
                  extents.width, extents.height,
                  extents.x_advance, extents.y_advance])
  end

  def test_to_s
    extents = Cairo::TextExtents.new
    extents.x_bearing = 0.1
    extents.y_bearing = 0.2
    extents.width = 0.3
    extents.height = 0.4
    extents.x_advance = 0.5
    extents.y_advance = 0.6
    assert_equal("#<Cairo::TextExtents: x_bearing=0.1, y_bearing=0.2, " +
                 "width=0.3, height=0.4, x_advance=0.5, y_advance=0.6>",
                 extents.to_s)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cairo-1.17.13 test/test_text_extents.rb
cairo-1.17.12 test/test_text_extents.rb
cairo-1.17.11 test/test_text_extents.rb
cairo-1.17.10 test/test_text_extents.rb
cairo-1.17.9 test/test_text_extents.rb
cairo-1.17.8 test/test_text_extents.rb
cairo-1.17.7 test/test_text_extents.rb
cairo-1.17.6 test/test_text_extents.rb
cairo-1.17.5 test/test_text_extents.rb
cairo-1.17.4 test/test_text_extents.rb
cairo-1.16.6 test/test_text_extents.rb
cairo-1.16.5 test/test_text_extents.rb
cairo-1.16.4 test/test_text_extents.rb
cairo-1.16.3 test/test_text_extents.rb
cairo-1.16.2 test/test_text_extents.rb
cairo-1.16.1-x86-mingw32 test/test_text_extents.rb
cairo-1.16.1-x64-mingw32 test/test_text_extents.rb
cairo-1.16.1 test/test_text_extents.rb
cairo-1.16.0-x86-mingw32 test/test_text_extents.rb
cairo-1.16.0-x64-mingw32 test/test_text_extents.rb