cairo 1.7.0-x86-mswin32 → 1.8.0-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cairo might be problematic. Click here for more details.
- data/ChangeLog +32 -0
- data/NEWS +9 -1
- data/README +1 -0
- data/Rakefile +2 -2
- data/cairo/DLL_FAQ.txt +397 -0
- data/cairo/README.txt +53 -0
- data/cairo/USAGE.txt +94 -0
- data/cairo/bin/libcairo-2.dll +0 -0
- data/cairo/bin/libpng12-0.dll +0 -0
- data/cairo/bin/zlib1.dll +0 -0
- data/cairo/include/cairo/cairo-deprecated.h +0 -4
- data/cairo/include/cairo/cairo-features.h +7 -22
- data/cairo/include/cairo/cairo-pdf.h +1 -1
- data/cairo/include/cairo/cairo-ps.h +1 -1
- data/cairo/include/cairo/cairo-svg.h +1 -1
- data/cairo/include/cairo/cairo-version.h +8 -0
- data/cairo/include/cairo/cairo-win32.h +9 -1
- data/cairo/include/cairo/cairo.h +420 -32
- data/cairo/include/libpng12/png.h +3592 -0
- data/cairo/include/libpng12/pngconf.h +1481 -0
- data/cairo/include/png.h +36 -13
- data/cairo/include/pngconf.h +3 -3
- data/cairo/include/zconf.h +332 -0
- data/cairo/include/zlib.h +1357 -0
- data/cairo/lib/cairo.def +22 -0
- data/cairo/lib/cairo.lib +0 -0
- data/cairo/lib/libcairo.dll.a +0 -0
- data/cairo/lib/libpng.def +1 -0
- data/cairo/lib/libpng.lib +0 -0
- data/cairo/lib/libpng12.dll.a +0 -0
- data/cairo/lib/pkgconfig/cairo-pdf.pc +5 -5
- data/cairo/lib/pkgconfig/cairo-png.pc +5 -5
- data/cairo/lib/pkgconfig/cairo-ps.pc +5 -5
- data/cairo/lib/pkgconfig/cairo-svg.pc +4 -4
- data/cairo/lib/pkgconfig/cairo-win32-font.pc +4 -4
- data/cairo/lib/pkgconfig/cairo-win32.pc +4 -4
- data/cairo/lib/pkgconfig/cairo.pc +4 -4
- data/cairo/lib/pkgconfig/libpng.pc +3 -2
- data/cairo/lib/pkgconfig/libpng12.pc +3 -2
- data/cairo/lib/zdll.exp +0 -0
- data/cairo/lib/zdll.lib +0 -0
- data/cairo/lib/zlib.def +60 -0
- data/cairo/manifest/cairo-dev_1.8.0-1_win32.mft +76 -0
- data/cairo/manifest/cairo_1.8.0-1_win32.mft +5 -0
- data/cairo/manifest/{libpng-dev-1.2.29.mft → libpng-dev_1.2.32-1_win32.mft} +5 -2
- data/cairo/manifest/libpng_1.2.32-1_win32.mft +2 -0
- data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING +0 -0
- data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-LGPL-2.1 +0 -0
- data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-MPL-1.1 +0 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-errors.html +15 -11
- data/cairo/share/gtk-doc/html/cairo/bindings-fonts.html +15 -11
- data/cairo/share/gtk-doc/html/cairo/bindings-memory.html +20 -16
- data/cairo/share/gtk-doc/html/cairo/bindings-overloading.html +16 -12
- data/cairo/share/gtk-doc/html/cairo/bindings-path.html +17 -13
- data/cairo/share/gtk-doc/html/cairo/bindings-patterns.html +25 -21
- data/cairo/share/gtk-doc/html/cairo/bindings-return-values.html +17 -13
- data/cairo/share/gtk-doc/html/cairo/bindings-streams.html +14 -10
- data/cairo/share/gtk-doc/html/cairo/bindings-surfaces.html +19 -15
- data/cairo/share/gtk-doc/html/cairo/cairo-context.html +2721 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-drawing.html +57 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-error-status.html +361 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-font-face.html +418 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-font-options.html +695 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-fonts.html +63 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-ft-font.html +318 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-image-surface.html +486 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-cairo-matrix-t.html → cairo-matrix.html} +137 -156
- data/cairo/share/gtk-doc/html/cairo/{cairo-Paths.html → cairo-paths.html} +275 -306
- data/cairo/share/gtk-doc/html/cairo/cairo-pattern.html +1524 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-PDF-Surfaces.html → cairo-pdf-surface.html} +60 -70
- data/cairo/share/gtk-doc/html/cairo/cairo-png-functions.html +332 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-PostScript-Surfaces.html → cairo-ps-surface.html} +131 -150
- data/cairo/share/gtk-doc/html/cairo/cairo-quartz-font.html +153 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-Quartz-Surfaces.html → cairo-quartz-surface.html} +53 -62
- data/cairo/share/gtk-doc/html/cairo/cairo-scaled-font.html +1051 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-support.html +54 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-surface.html +1064 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-surfaces.html +69 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-svg-surface.html +324 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-text.html +1264 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-Transformations.html → cairo-transformations.html} +98 -115
- data/cairo/share/gtk-doc/html/cairo/cairo-types.html +134 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-user-font.html +769 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-version-info.html +355 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-win32-font.html +366 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-win32-surface.html +321 -0
- data/cairo/share/gtk-doc/html/cairo/{cairo-XLib-Surfaces.html → cairo-xlib-surface.html} +104 -121
- data/cairo/share/gtk-doc/html/cairo/cairo.devhelp +390 -405
- data/cairo/share/gtk-doc/html/cairo/cairo.devhelp2 +390 -405
- data/cairo/share/gtk-doc/html/cairo/index-1.2.html +63 -59
- data/cairo/share/gtk-doc/html/cairo/index-1.4.html +45 -41
- data/cairo/share/gtk-doc/html/cairo/index-1.6.html +29 -23
- data/cairo/share/gtk-doc/html/cairo/index-1.8.html +107 -0
- data/cairo/share/gtk-doc/html/cairo/index-all.html +759 -0
- data/cairo/share/gtk-doc/html/cairo/index.html +51 -41
- data/cairo/share/gtk-doc/html/cairo/index.sgml +478 -466
- data/cairo/share/gtk-doc/html/cairo/language-bindings.html +22 -18
- data/cairo/share/gtk-doc/html/cairo/style.css +14 -2
- data/cairo/share/man/man3/libpng.3 +443 -17
- data/cairo/share/man/man3/libpngpf.3 +618 -102
- data/cairo/share/man/man5/png.5 +1 -1
- data/cairo/src/tml/make/cairo_1.8.0-1_win32.log +1021 -0
- data/cairo/src/tml/make/cairo_1.8.0-1_win32.sh +68 -0
- data/cairo/src/tml/make/libpng_1.2.32-1_win32.log +269 -0
- data/cairo/src/tml/make/libpng_1.2.32-1_win32.sh +63 -0
- data/cairo/test/example_d.exe +0 -0
- data/cairo/test/minigzip_d.exe +0 -0
- data/cairo/test/testzlib_d.exe +0 -0
- data/cairo/test/untgz_d.exe +0 -0
- data/doc/en/cairo-context.html +81 -91
- data/doc/en/cairo-font-options.html +11 -26
- data/doc/en/cairo-text-cluster-flag.html +35 -0
- data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +3 -3
- data/doc/en/cairo.html +38 -42
- data/doc/en/index.html +129 -142
- data/doc/ja/cairo-font-options.html +3 -25
- data/doc/ja/cairo-text-cluster-flag.html +46 -0
- data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +16 -15
- data/doc/ja/cairo.html +3 -7
- data/doc/ja/index.html +9 -17
- data/src/cairo.def +1 -1
- data/src/cairo.so +0 -0
- data/src/lib/cairo/constants.rb +3 -1
- data/src/libruby-cairo.a +0 -0
- data/src/rb_cairo.c +2 -2
- data/src/rb_cairo.h +5 -5
- data/src/rb_cairo_constants.c +12 -19
- data/src/rb_cairo_context.c +25 -21
- data/src/rb_cairo_font_face.c +44 -29
- data/src/rb_cairo_font_options.c +1 -23
- data/src/rb_cairo_scaled_font.c +5 -5
- data/test/test_constants.rb +6 -9
- data/test/test_context.rb +0 -12
- data/test/test_font_face.rb +7 -7
- data/test/test_font_options.rb +2 -21
- data/test/test_scaled_font.rb +3 -3
- data/test/test_text_to_glyphs_data.rb +19 -15
- metadata +68 -45
- data/cairo/make/cairo-1.6.4-2.sh +0 -55
- data/cairo/make/libpng-1.2.29.sh +0 -35
- data/cairo/manifest/cairo-1.6.4-2.mft +0 -6
- data/cairo/manifest/cairo-dev-1.6.4-2.mft +0 -72
- data/cairo/manifest/libpng-1.2.29.mft +0 -2
- data/cairo/share/gtk-doc/html/cairo/Drawing.html +0 -53
- data/cairo/share/gtk-doc/html/cairo/Fonts.html +0 -56
- data/cairo/share/gtk-doc/html/cairo/Support.html +0 -50
- data/cairo/share/gtk-doc/html/cairo/Surfaces.html +0 -65
- data/cairo/share/gtk-doc/html/cairo/cairo-Error-Handling.html +0 -328
- data/cairo/share/gtk-doc/html/cairo/cairo-Font-Options.html +0 -720
- data/cairo/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +0 -297
- data/cairo/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +0 -484
- data/cairo/share/gtk-doc/html/cairo/cairo-PNG-Support.html +0 -345
- data/cairo/share/gtk-doc/html/cairo/cairo-Patterns.html +0 -1560
- data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html +0 -161
- data/cairo/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +0 -337
- data/cairo/share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html +0 -823
- data/cairo/share/gtk-doc/html/cairo/cairo-Text.html +0 -836
- data/cairo/share/gtk-doc/html/cairo/cairo-Types.html +0 -143
- data/cairo/share/gtk-doc/html/cairo/cairo-Version-Information.html +0 -325
- data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +0 -381
- data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +0 -331
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +0 -427
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +0 -995
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-t.html +0 -2795
- data/cairo/share/gtk-doc/html/cairo/ix01.html +0 -693
- data/doc/en/cairo-lcd-filter.html +0 -39
- data/doc/ja/cairo-lcd-filter.html +0 -63
data/src/rb_cairo_font_face.c
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
5
|
* $Author: kou $
|
6
|
-
* $Date: 2008-
|
6
|
+
* $Date: 2008-09-26 14:13:58 $
|
7
7
|
*
|
8
8
|
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
9
|
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
@@ -21,7 +21,7 @@ VALUE rb_cCairo_ToyFontFace = Qnil;
|
|
21
21
|
VALUE rb_cCairo_UserFontFace = Qnil;
|
22
22
|
VALUE rb_cCairo_UserFontFace_TextToGlyphsData = Qnil;
|
23
23
|
|
24
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
24
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
25
25
|
static cairo_user_data_key_t ruby_object_key;
|
26
26
|
static ID cr_id_call;
|
27
27
|
static ID cr_id_new;
|
@@ -33,10 +33,10 @@ static ID cr_id_unicode_to_glyph;
|
|
33
33
|
|
34
34
|
static ID cr_id_at_glyphs;
|
35
35
|
static ID cr_id_at_clusters;
|
36
|
-
static ID
|
36
|
+
static ID cr_id_at_cluster_flags;
|
37
37
|
static ID cr_id_at_need_glyphs;
|
38
38
|
static ID cr_id_at_need_clusters;
|
39
|
-
static ID
|
39
|
+
static ID cr_id_at_need_cluster_flags;
|
40
40
|
#endif
|
41
41
|
|
42
42
|
#define _SELF (RVAL2CRFONTFACE(self))
|
@@ -84,7 +84,7 @@ rb_cairo_font_face_to_ruby_object (cairo_font_face_t *face)
|
|
84
84
|
|
85
85
|
switch (cairo_font_face_get_type (face))
|
86
86
|
{
|
87
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
87
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
88
88
|
case CAIRO_FONT_TYPE_TOY:
|
89
89
|
klass = rb_cCairo_ToyFontFace;
|
90
90
|
break;
|
@@ -111,7 +111,7 @@ cr_font_face_allocate (VALUE klass)
|
|
111
111
|
return Data_Wrap_Struct (klass, NULL, cr_font_face_free, NULL);
|
112
112
|
}
|
113
113
|
|
114
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
114
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
115
115
|
static VALUE
|
116
116
|
cr_toy_font_face_initialize (int argc, VALUE *argv, VALUE self)
|
117
117
|
{
|
@@ -346,7 +346,7 @@ typedef struct _cr_text_to_glyphs_after_hook_data {
|
|
346
346
|
int *num_glyphs;
|
347
347
|
cairo_text_cluster_t **clusters;
|
348
348
|
int *num_clusters;
|
349
|
-
|
349
|
+
cairo_text_cluster_flags_t *cluster_flags;
|
350
350
|
} cr_text_to_glyphs_after_hook_data_t;
|
351
351
|
|
352
352
|
static VALUE
|
@@ -381,12 +381,14 @@ cr_user_font_face_text_to_glyphs_func_after (VALUE user_data)
|
|
381
381
|
after_hook_data->num_clusters);
|
382
382
|
}
|
383
383
|
|
384
|
-
if (after_hook_data->
|
384
|
+
if (after_hook_data->cluster_flags)
|
385
385
|
{
|
386
|
-
VALUE
|
386
|
+
VALUE rb_cluster_flags;
|
387
387
|
|
388
|
-
|
389
|
-
|
388
|
+
rb_cluster_flags = rb_ivar_get (text_to_glyphs_data,
|
389
|
+
cr_id_at_cluster_flags);
|
390
|
+
*(after_hook_data->cluster_flags) =
|
391
|
+
RVAL2CRTEXTCLUSTERFLAGS (rb_cluster_flags);
|
390
392
|
}
|
391
393
|
|
392
394
|
return data->result;
|
@@ -398,7 +400,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
|
|
398
400
|
cairo_glyph_t **glyphs, int *num_glyphs,
|
399
401
|
cairo_text_cluster_t **clusters,
|
400
402
|
int *num_clusters,
|
401
|
-
|
403
|
+
cairo_text_cluster_flags_t *cluster_flags)
|
402
404
|
{
|
403
405
|
cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
|
404
406
|
cairo_font_face_t *face;
|
@@ -434,7 +436,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
|
|
434
436
|
3,
|
435
437
|
CBOOL2RVAL (glyphs != NULL),
|
436
438
|
CBOOL2RVAL (clusters != NULL),
|
437
|
-
CBOOL2RVAL (
|
439
|
+
CBOOL2RVAL (cluster_flags != NULL));
|
438
440
|
argv[2] = text_to_glyphs_data;
|
439
441
|
|
440
442
|
data.receiver = receiver;
|
@@ -450,7 +452,7 @@ cr_user_font_face_text_to_glyphs_func (cairo_scaled_font_t *scaled_font,
|
|
450
452
|
after_hook_data.num_glyphs = num_glyphs;
|
451
453
|
after_hook_data.clusters = clusters;
|
452
454
|
after_hook_data.num_clusters = num_clusters;
|
453
|
-
after_hook_data.
|
455
|
+
after_hook_data.cluster_flags = cluster_flags;
|
454
456
|
|
455
457
|
rb_cairo__invoke_callback (cr_user_font_face_invoke_func, (VALUE)&data);
|
456
458
|
}
|
@@ -581,22 +583,30 @@ cr_user_font_face_on_unicode_to_glyph (VALUE self)
|
|
581
583
|
static VALUE
|
582
584
|
cr_text_to_glyphs_data_initialize (VALUE self,
|
583
585
|
VALUE need_glyphs, VALUE need_clusters,
|
584
|
-
VALUE
|
586
|
+
VALUE need_cluster_flags)
|
585
587
|
{
|
586
588
|
rb_ivar_set (self, cr_id_at_glyphs, Qnil);
|
587
589
|
rb_ivar_set (self, cr_id_at_clusters, Qnil);
|
588
|
-
rb_ivar_set (self,
|
590
|
+
rb_ivar_set (self, cr_id_at_cluster_flags, INT2NUM (0));
|
589
591
|
rb_ivar_set (self, cr_id_at_need_glyphs, need_glyphs);
|
590
592
|
rb_ivar_set (self, cr_id_at_need_clusters, need_clusters);
|
591
|
-
rb_ivar_set (self,
|
593
|
+
rb_ivar_set (self, cr_id_at_need_cluster_flags, need_cluster_flags);
|
592
594
|
|
593
595
|
return Qnil;
|
594
596
|
}
|
595
597
|
|
596
598
|
static VALUE
|
597
|
-
|
599
|
+
cr_text_to_glyphs_data_get_cluster_flags (VALUE self)
|
598
600
|
{
|
599
|
-
return rb_ivar_get (self,
|
601
|
+
return rb_ivar_get (self, cr_id_at_cluster_flags);
|
602
|
+
}
|
603
|
+
|
604
|
+
static VALUE
|
605
|
+
cr_text_to_glyphs_data_set_cluster_flags (VALUE self, VALUE cluster_flags)
|
606
|
+
{
|
607
|
+
rb_ivar_set (self, cr_id_at_cluster_flags,
|
608
|
+
INT2NUM (RVAL2CRTEXTCLUSTERFLAGS (cluster_flags)));
|
609
|
+
return Qnil;
|
600
610
|
}
|
601
611
|
|
602
612
|
static VALUE
|
@@ -612,16 +622,16 @@ cr_text_to_glyphs_data_need_clusters (VALUE self)
|
|
612
622
|
}
|
613
623
|
|
614
624
|
static VALUE
|
615
|
-
|
625
|
+
cr_text_to_glyphs_data_need_cluster_flags (VALUE self)
|
616
626
|
{
|
617
|
-
return rb_ivar_get (self,
|
627
|
+
return rb_ivar_get (self, cr_id_at_need_cluster_flags);
|
618
628
|
}
|
619
629
|
#endif
|
620
630
|
|
621
631
|
void
|
622
632
|
Init_cairo_font (void)
|
623
633
|
{
|
624
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
634
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
625
635
|
cr_id_call = rb_intern ("call");
|
626
636
|
cr_id_new = rb_intern ("new");
|
627
637
|
|
@@ -632,17 +642,17 @@ Init_cairo_font (void)
|
|
632
642
|
|
633
643
|
cr_id_at_glyphs = rb_intern ("@glyphs");
|
634
644
|
cr_id_at_clusters = rb_intern ("@clusters");
|
635
|
-
|
645
|
+
cr_id_at_cluster_flags = rb_intern ("@cluster_flags");
|
636
646
|
cr_id_at_need_glyphs = rb_intern ("@need_glyphs");
|
637
647
|
cr_id_at_need_clusters = rb_intern ("@need_clusters");
|
638
|
-
|
648
|
+
cr_id_at_need_cluster_flags = rb_intern ("@need_cluster_flags");
|
639
649
|
#endif
|
640
650
|
|
641
651
|
rb_cCairo_FontFace =
|
642
652
|
rb_define_class_under (rb_mCairo, "FontFace", rb_cObject);
|
643
653
|
rb_define_alloc_func (rb_cCairo_FontFace, cr_font_face_allocate);
|
644
654
|
|
645
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
655
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
646
656
|
rb_cCairo_ToyFontFace =
|
647
657
|
rb_define_class_under (rb_mCairo, "ToyFontFace", rb_cCairo_FontFace);
|
648
658
|
|
@@ -680,19 +690,24 @@ Init_cairo_font (void)
|
|
680
690
|
CR_TRUE, CR_TRUE, CR_TRUE);
|
681
691
|
rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("clusters"),
|
682
692
|
CR_TRUE, CR_TRUE, CR_TRUE);
|
683
|
-
rb_attr (rb_cCairo_UserFontFace_TextToGlyphsData, rb_intern ("backward"),
|
684
|
-
CR_FALSE, CR_TRUE, CR_TRUE);
|
685
693
|
|
686
694
|
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
687
695
|
"initialize", cr_text_to_glyphs_data_initialize, 3);
|
688
696
|
|
689
697
|
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
690
|
-
"
|
698
|
+
"cluster_flags",
|
699
|
+
cr_text_to_glyphs_data_get_cluster_flags, 0);
|
700
|
+
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
701
|
+
"cluster_flags=",
|
702
|
+
cr_text_to_glyphs_data_set_cluster_flags, 1);
|
691
703
|
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
692
704
|
"need_glyphs?", cr_text_to_glyphs_data_need_glyphs, 0);
|
693
705
|
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
694
706
|
"need_clusters?", cr_text_to_glyphs_data_need_clusters, 0);
|
695
707
|
rb_define_method (rb_cCairo_UserFontFace_TextToGlyphsData,
|
696
|
-
"
|
708
|
+
"need_cluster_flags?",
|
709
|
+
cr_text_to_glyphs_data_need_cluster_flags, 0);
|
710
|
+
|
711
|
+
RB_CAIRO_DEF_SETTERS (rb_cCairo_UserFontFace_TextToGlyphsData);
|
697
712
|
#endif
|
698
713
|
}
|
data/src/rb_cairo_font_options.c
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
5
|
* $Author: kou $
|
6
|
-
* $Date: 2008-
|
6
|
+
* $Date: 2008-09-19 12:56:27 $
|
7
7
|
*
|
8
8
|
* Copyright 2005-2008 Kouhei Sutou <kou@cozmixng.org>
|
9
9
|
*
|
@@ -160,22 +160,6 @@ cr_options_get_hint_metrics (VALUE self)
|
|
160
160
|
return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
|
161
161
|
}
|
162
162
|
|
163
|
-
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
164
|
-
static VALUE
|
165
|
-
cr_options_set_lcd_filter (VALUE self, VALUE lcd_filter)
|
166
|
-
{
|
167
|
-
cairo_font_options_set_lcd_filter (_SELF (self),
|
168
|
-
RVAL2CRLCDFILTER (lcd_filter));
|
169
|
-
return self;
|
170
|
-
}
|
171
|
-
|
172
|
-
static VALUE
|
173
|
-
cr_options_get_lcd_filter (VALUE self)
|
174
|
-
{
|
175
|
-
return INT2NUM (cairo_font_options_get_lcd_filter (_SELF (self)));
|
176
|
-
}
|
177
|
-
#endif
|
178
|
-
|
179
163
|
|
180
164
|
void
|
181
165
|
Init_cairo_font_options (void)
|
@@ -208,12 +192,6 @@ Init_cairo_font_options (void)
|
|
208
192
|
cr_options_set_hint_metrics, 1);
|
209
193
|
rb_define_method (rb_cCairo_FontOptions, "hint_metrics",
|
210
194
|
cr_options_get_hint_metrics, 0);
|
211
|
-
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
212
|
-
rb_define_method (rb_cCairo_FontOptions, "set_lcd_filter",
|
213
|
-
cr_options_set_lcd_filter, 1);
|
214
|
-
rb_define_method (rb_cCairo_FontOptions, "lcd_filter",
|
215
|
-
cr_options_get_lcd_filter, 0);
|
216
|
-
#endif
|
217
195
|
|
218
196
|
RB_CAIRO_DEF_SETTERS (rb_cCairo_FontOptions);
|
219
197
|
}
|
data/src/rb_cairo_scaled_font.c
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
5
|
* $Author: kou $
|
6
|
-
* $Date: 2008-
|
6
|
+
* $Date: 2008-09-19 12:56:27 $
|
7
7
|
*
|
8
8
|
* Copyright 2005-2008 Kouhei Sutou <kou@cozmixng.org>
|
9
9
|
*
|
@@ -114,7 +114,7 @@ cr_scaled_font_glyph_extents (VALUE self, VALUE rb_glyphs)
|
|
114
114
|
return CRTEXTEXTENTS2RVAL (&extents);
|
115
115
|
}
|
116
116
|
|
117
|
-
#if CAIRO_CHECK_VERSION(1, 7,
|
117
|
+
#if CAIRO_CHECK_VERSION(1, 7, 6)
|
118
118
|
static VALUE
|
119
119
|
cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8)
|
120
120
|
{
|
@@ -125,7 +125,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
|
|
125
125
|
int num_glyphs;
|
126
126
|
cairo_text_cluster_t *clusters = NULL;
|
127
127
|
int num_clusters;
|
128
|
-
|
128
|
+
cairo_text_cluster_flags_t cluster_flags;
|
129
129
|
cairo_status_t status;
|
130
130
|
VALUE rb_glyphs, rb_clusters;
|
131
131
|
|
@@ -138,7 +138,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
|
|
138
138
|
x, y, utf8, utf8_len,
|
139
139
|
&glyphs, &num_glyphs,
|
140
140
|
&clusters, &num_clusters,
|
141
|
-
&
|
141
|
+
&cluster_flags);
|
142
142
|
rb_cairo_check_status (status);
|
143
143
|
|
144
144
|
rb_glyphs = rb_cairo__glyphs_to_ruby_object (glyphs, num_glyphs);
|
@@ -146,7 +146,7 @@ cr_scaled_font_text_to_glyphs (VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_utf8
|
|
146
146
|
rb_clusters = rb_cairo__text_clusters_to_ruby_object (clusters, num_clusters);
|
147
147
|
cairo_text_cluster_free (clusters);
|
148
148
|
|
149
|
-
return rb_ary_new3 (3, rb_glyphs, rb_clusters,
|
149
|
+
return rb_ary_new3 (3, rb_glyphs, rb_clusters, INT2NUM (cluster_flags));
|
150
150
|
}
|
151
151
|
#endif
|
152
152
|
|
data/test/test_constants.rb
CHANGED
@@ -1,19 +1,16 @@
|
|
1
1
|
require 'cairo'
|
2
2
|
|
3
3
|
class ConstantsTest < Test::Unit::TestCase
|
4
|
-
def
|
5
|
-
constant_name = "
|
6
|
-
unless Cairo.satisfied_version?(1, 7,
|
4
|
+
def test_text_cluster_flags
|
5
|
+
constant_name = "TextClusterFlag"
|
6
|
+
unless Cairo.satisfied_version?(1, 7, 6)
|
7
7
|
assert_false(Cairo.const_defined?(constant_name))
|
8
8
|
return
|
9
9
|
end
|
10
10
|
|
11
11
|
assert_true(Cairo.const_defined?(constant_name))
|
12
|
-
assert_equal((0..
|
13
|
-
[
|
14
|
-
Cairo::
|
15
|
-
Cairo::LCDFilter::INTRA_PIXEL,
|
16
|
-
Cairo::LCDFilter::FIR3,
|
17
|
-
Cairo::LCDFilter::FIR5])
|
12
|
+
assert_equal((0..1).to_a,
|
13
|
+
[0,
|
14
|
+
Cairo::TextClusterFlag::BACKWARD])
|
18
15
|
end
|
19
16
|
end
|
data/test/test_context.rb
CHANGED
@@ -49,18 +49,6 @@ class ContextTest < Test::Unit::TestCase
|
|
49
49
|
assert_equal("sans", context.font_face.family)
|
50
50
|
end
|
51
51
|
|
52
|
-
def test_have_show_text_glyphs?
|
53
|
-
only_cairo_version(1, 7, 2)
|
54
|
-
|
55
|
-
pdf_surface = Cairo::PDFSurface.new(@output, 10, 10)
|
56
|
-
context = Cairo::Context.new(pdf_surface)
|
57
|
-
assert_true(context.have_show_text_glyphs?)
|
58
|
-
|
59
|
-
image_surface = Cairo::ImageSurface.new(10, 10)
|
60
|
-
context = Cairo::Context.new(image_surface)
|
61
|
-
assert_false(context.have_show_text_glyphs?)
|
62
|
-
end
|
63
|
-
|
64
52
|
def test_text_to_glyphs
|
65
53
|
only_cairo_version(1, 7, 2)
|
66
54
|
|
data/test/test_font_face.rb
CHANGED
@@ -54,7 +54,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
54
54
|
Cairo::Matrix.identity,
|
55
55
|
Cairo::Matrix.identity,
|
56
56
|
Cairo::FontOptions.new)
|
57
|
-
assert_equal([[], [],
|
57
|
+
assert_equal([[], [], 0],
|
58
58
|
scaled_font.text_to_glyphs(0, 0, "text"))
|
59
59
|
end
|
60
60
|
|
@@ -77,7 +77,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
77
77
|
face.on_text_to_glyphs do |*args|
|
78
78
|
text_to_glyphs_args << args
|
79
79
|
scaled_font, utf8, data = args
|
80
|
-
data.
|
80
|
+
data.cluster_flags = :backward
|
81
81
|
end
|
82
82
|
|
83
83
|
unicode_to_glyph_args = []
|
@@ -102,7 +102,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
102
102
|
[Cairo::ScaledFont, ?e],
|
103
103
|
[Cairo::ScaledFont, ?x],
|
104
104
|
[Cairo::ScaledFont, ?t]],
|
105
|
-
[[], [],
|
105
|
+
[[], [], Cairo::TextClusterFlag::BACKWARD]],
|
106
106
|
[classify_cairo_object(init_args),
|
107
107
|
classify_cairo_object(render_glyph_args),
|
108
108
|
classify_cairo_object(text_to_glyphs_args),
|
@@ -133,7 +133,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
133
133
|
def text_to_glyphs(*args)
|
134
134
|
@text_to_glyphs_args << args
|
135
135
|
scaled_font, utf8, data = args
|
136
|
-
data.
|
136
|
+
data.cluster_flags = :backward
|
137
137
|
end
|
138
138
|
|
139
139
|
def unicode_to_glyph(*args)
|
@@ -164,7 +164,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
164
164
|
[Cairo::ScaledFont, ?e],
|
165
165
|
[Cairo::ScaledFont, ?x],
|
166
166
|
[Cairo::ScaledFont, ?t]],
|
167
|
-
[[], [],
|
167
|
+
[[], [], Cairo::TextClusterFlag::BACKWARD]],
|
168
168
|
[classify_cairo_object(face.init_args),
|
169
169
|
classify_cairo_object(face.render_glyph_args),
|
170
170
|
classify_cairo_object(face.text_to_glyphs_args),
|
@@ -191,7 +191,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
191
191
|
face.on_text_to_glyphs do |*args|
|
192
192
|
text_to_glyphs_args << args
|
193
193
|
scaled_font, utf8, data = args
|
194
|
-
data.
|
194
|
+
data.cluster_flags = :backward
|
195
195
|
end
|
196
196
|
|
197
197
|
unicode_to_glyph_args = []
|
@@ -220,7 +220,7 @@ class FontFaceTest < Test::Unit::TestCase
|
|
220
220
|
[],
|
221
221
|
[],
|
222
222
|
[],
|
223
|
-
[[], [],
|
223
|
+
[[], [], Cairo::TextClusterFlag::BACKWARD]],
|
224
224
|
[classify_cairo_object(init_args),
|
225
225
|
classify_cairo_object(render_glyph_args),
|
226
226
|
classify_cairo_object(text_to_glyphs_args),
|
data/test/test_font_options.rb
CHANGED
@@ -7,26 +7,7 @@ class FontOptionsTest < Test::Unit::TestCase
|
|
7
7
|
@options = Cairo::FontOptions.new
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
12
|
-
|
13
|
-
assert_equal(Cairo::LCDFilter::DEFAULT, @options.lcd_filter)
|
14
|
-
@options.lcd_filter = :fir3
|
15
|
-
assert_equal(Cairo::LCDFilter::FIR3, @options.lcd_filter)
|
16
|
-
|
17
|
-
assert_invalid_lcd_filter(Cairo::LCDFilter::DEFAULT - 1)
|
18
|
-
assert_invalid_lcd_filter(Cairo::LCDFilter::FIR5 + 1)
|
19
|
-
end
|
20
|
-
|
21
|
-
def assert_invalid_lcd_filter(value)
|
22
|
-
options = Cairo::FontOptions.new
|
23
|
-
exception = assert_raise(ArgumentError) do
|
24
|
-
options.lcd_filter = value
|
25
|
-
end
|
26
|
-
min = Cairo::LCDFilter::DEFAULT
|
27
|
-
max = Cairo::LCDFilter::FIR5
|
28
|
-
assert_equal("invalid lcd_filter: #{value} " +
|
29
|
-
"(expect #{min} <= lcd_filter <= #{max})",
|
30
|
-
exception.message)
|
10
|
+
def test_something
|
11
|
+
# WRITE ME!
|
31
12
|
end
|
32
13
|
end
|
data/test/test_scaled_font.rb
CHANGED
@@ -17,7 +17,7 @@ class ScaledFontTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_text_to_glyphs
|
20
|
-
only_cairo_version(1, 7,
|
20
|
+
only_cairo_version(1, 7, 6)
|
21
21
|
|
22
22
|
surface = Cairo::PDFSurface.new(StringIO.new, 10, 10)
|
23
23
|
context = Cairo::Context.new(surface)
|
@@ -27,8 +27,8 @@ class ScaledFontTest < Test::Unit::TestCase
|
|
27
27
|
Cairo::FontOptions.new)
|
28
28
|
expected_glyphs = []
|
29
29
|
expected_clusters = []
|
30
|
-
|
31
|
-
assert_equal([expected_glyphs, expected_clusters,
|
30
|
+
expected_cluster_flags = 0
|
31
|
+
assert_equal([expected_glyphs, expected_clusters, expected_cluster_flags],
|
32
32
|
scaled_font.text_to_glyphs(0, 0, "text"))
|
33
33
|
end
|
34
34
|
end
|