Sha256: 17fceb3ff01fcaec597c84a2a7ce2007c853821d11948124b8c0492a63906beb

Contents?: true

Size: 1.73 KB

Versions: 103

Compression:

Stored size: 1.73 KB

Contents

require 'cairo'

class TextToGlyphsDataTest < Test::Unit::TestCase
  include CairoTestUtils

  def test_new
    only_cairo_version(1, 7, 6)

    data = Cairo::UserFontFace::TextToGlyphsData.new(false, false, false)
    assert_equal([false, false, false],
                 [data.need_glyphs?, data.need_clusters?,
                  data.need_cluster_flags?])

    data = Cairo::UserFontFace::TextToGlyphsData.new(true, false, false)
    assert_equal([true, false, false],
                 [data.need_glyphs?, data.need_clusters?,
                  data.need_cluster_flags?])

    data = Cairo::UserFontFace::TextToGlyphsData.new(false, true, false)
    assert_equal([false, true, false],
                 [data.need_glyphs?, data.need_clusters?,
                  data.need_cluster_flags?])

    data = Cairo::UserFontFace::TextToGlyphsData.new(false, false, true)
    assert_equal([false, false, true],
                 [data.need_glyphs?, data.need_clusters?,
                  data.need_cluster_flags?])
  end

  def test_accessor
    only_cairo_version(1, 7, 6)

    data = Cairo::UserFontFace::TextToGlyphsData.new(true, true, true)
    assert_equal([nil, nil, 0],
                 [data.glyphs, data.clusters, data.cluster_flags])

    glyph = Cairo::Glyph.new(0, 5, 10)
    data.glyphs = [glyph]
    assert_equal([[glyph], nil, 0],
                 [data.glyphs, data.clusters, data.cluster_flags])

    cluster = Cairo::TextCluster.new(0, 1)
    data.clusters = [cluster]
    assert_equal([[glyph], [cluster], 0],
                 [data.glyphs, data.clusters, data.cluster_flags])

    data.cluster_flags = :backward
    assert_equal([[glyph], [cluster], Cairo::TextClusterFlag::BACKWARD],
                 [data.glyphs, data.clusters, data.cluster_flags])
  end
end

Version data entries

103 entries across 95 versions & 2 rubygems

Version Path
cairo-1.15.13-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.13-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.13 test/test_text_to_glyphs_data.rb
cairo-1.15.12-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.12-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.12 test/test_text_to_glyphs_data.rb
cairo-1.15.11-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.11-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.11 test/test_text_to_glyphs_data.rb
cairo-1.15.10-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.10-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.10 test/test_text_to_glyphs_data.rb
cairo-1.15.9-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.9 test/test_text_to_glyphs_data.rb
cairo-1.15.9-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.8-x86-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.8-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.8 test/test_text_to_glyphs_data.rb
cairo-1.15.7-x64-mingw32 test/test_text_to_glyphs_data.rb
cairo-1.15.7-x86-mingw32 test/test_text_to_glyphs_data.rb