[cairo-commit] rcairo/test test_context.rb,1.3,1.4

Kouhei Sutou commit at pdx.freedesktop.org
Sat Aug 16 01:34:21 PDT 2008


Committed by: kou

Update of /cvs/cairo/rcairo/test
In directory kemper:/tmp/cvs-serv1768/test

Modified Files:
	test_context.rb 
Log Message:
        * src/rb_cairo_private.[ch] (rb_cairo__text_clusters_from_ruby_object)
        (rb_cairo__glyphs_from_ruby_object): add.

        * test/test_context.rb (ContextTest#test_text_to_glyphs): add a
        test for Cairo::Context#show_text_glyphs.

        * src/rb_cairo_context.c: support Cairo::Context#show_text_glyphs.


Index: test_context.rb
===================================================================
RCS file: /cvs/cairo/rcairo/test/test_context.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test_context.rb	16 Aug 2008 07:23:16 -0000	1.3
+++ test_context.rb	16 Aug 2008 08:34:19 -0000	1.4
@@ -58,4 +58,22 @@
     context = Cairo::Context.new(image_surface)
     assert_false(context.have_show_text_glyphs?)
   end
+
+
+  def test_text_to_glyphs
+    only_cairo_version(1, 7, 2)
+
+    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)
+
+    utf8 = "text"
+    glyphs, clusters, backward = scaled_font.text_to_glyphs(0, 0, utf8)
+    assert_nothing_raised do
+      context.show_text_glyphs(utf8, glyphs, clusters, backward)
+    end
+  end
 end



More information about the cairo-commit mailing list