Sha256: f70bd66c828ebf748f991ccd77b9dfe073e7939f8c8eac876dcab7d13f728d30

Contents?: true

Size: 1.05 KB

Versions: 24

Compression:

Stored size: 1.05 KB

Contents

require 'cairo'
require 'stringio'

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

  def test_scale_matrix
    only_cairo_version(1, 7, 2)

    surface = Cairo::ImageSurface.new(100, 100)
    context = Cairo::Context.new(surface)
    scaled_font = context.scaled_font

    assert_equal(Cairo::Matrix.new(10.0, 0.0, 0.0,
                                   10.0, 0.0, 0.0),
                 scaled_font.scale_matrix)
  end

  def test_text_to_glyphs
    only_cairo_version(1, 7, 6)

    surface = Cairo::PDFSurface.new(StringIO.new, 10, 10)
    context = Cairo::Context.new(surface)
    scaled_font = Cairo::ScaledFont.new(context.font_face,
                                        Cairo::Matrix.identity,
                                        Cairo::Matrix.identity,
                                        Cairo::FontOptions.new)
    expected_glyphs = []
    expected_clusters = []
    expected_cluster_flags = 0
    assert_equal([expected_glyphs, expected_clusters, expected_cluster_flags],
                 scaled_font.text_to_glyphs(0, 0, "text"))
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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