[cairo-commit] rcairo/test test_context.rb, 1.1, 1.2 test_font_face.rb, NONE, 1.1
Kouhei Sutou
commit at pdx.freedesktop.org
Thu Aug 14 01:11:18 PDT 2008
- Previous message: [cairo-commit] rcairo/src cairo.def, 1.14, 1.15 rb_cairo.h, 1.19, 1.20 rb_cairo_font_face.c, 1.4, 1.5 rb_cairo_private.c, 1.5, 1.6 rb_cairo_private.h, 1.8, 1.9
- Next message: [cairo-commit] rcairo ChangeLog,1.289,1.290
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: kou
Update of /cvs/cairo/rcairo/test
In directory kemper:/tmp/cvs-serv8684/test
Modified Files:
test_context.rb
Added Files:
test_font_face.rb
Log Message:
* test/test_context.rb (ContextTest#test_font_face): add a test
for Cairo::Context#font_face{,=}.
* src/rb_cairo_private.[ch] (rb_cairo__inspect): add.
* test/test_font_face.rb: add.
* src/rb_cairo_font_face.c: support Cairo::ToyFontFace.
* src/cairo.def, src/rb_cairo.h: add rb_cCairo_ToyFontFace and
rb_cCairo_UserFontFace.
Index: test_context.rb
===================================================================
RCS file: /cvs/cairo/rcairo/test/test_context.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test_context.rb 11 Aug 2008 12:53:32 -0000 1.1
+++ test_context.rb 14 Aug 2008 08:11:15 -0000 1.2
@@ -30,4 +30,18 @@
end
end
end
+
+ def test_font_face
+ context = Cairo::Context.new(@surface)
+
+ assert_kind_of(Cairo::FontFace, context.font_face)
+
+ face = Cairo::ToyFontFace.new("serif")
+ context.font_face = face
+ assert_equal("serif", context.font_face.family)
+
+ face = Cairo::ToyFontFace.new("sans")
+ context.font_face = face
+ assert_equal("sans", context.font_face.family)
+ end
end
--- NEW FILE: test_font_face.rb ---
require 'cairo'
class FontFaceTest < Test::Unit::TestCase
include CairoTestUtils
def test_toy_font_face
only_cairo_version(1, 7, 2)
face = Cairo::ToyFontFace.new("sans")
assert_equal(["sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL],
[face.family, face.slant, face.weight])
face = Cairo::ToyFontFace.new("sans", :oblique)
assert_equal(["sans", Cairo::FONT_SLANT_OBLIQUE, Cairo::FONT_WEIGHT_NORMAL],
[face.family, face.slant, face.weight])
face = Cairo::ToyFontFace.new("sans", nil, :bold)
assert_equal(["sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD],
[face.family, face.slant, face.weight])
face = Cairo::ToyFontFace.new("sans", :italic, :bold)
assert_equal(["sans", Cairo::FONT_SLANT_ITALIC, Cairo::FONT_WEIGHT_BOLD],
[face.family, face.slant, face.weight])
end
end
- Previous message: [cairo-commit] rcairo/src cairo.def, 1.14, 1.15 rb_cairo.h, 1.19, 1.20 rb_cairo_font_face.c, 1.4, 1.5 rb_cairo_private.c, 1.5, 1.6 rb_cairo_private.h, 1.8, 1.9
- Next message: [cairo-commit] rcairo ChangeLog,1.289,1.290
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list