gp_cairo.c patch for win32

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

gp_cairo.c patch for win32

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Attached: request that pango/cairo use its FreeType + fontconfig
backend when operating on MS Windows.

Note: the patch doesn't seem to do any harm on Linux, but perhaps
should be made conditional on compilation for Windows.

--
Allin Cottrell
Department of Economics
Wake Forest University

--- gp_cairo.c.orig 2009-11-05 13:52:38.931514737 -0500
+++ gp_cairo.c 2009-11-05 13:52:57.619506286 -0500
@@ -686,6 +686,34 @@
  return string_utf8;
 }
 
+#define ALT_PANGO 1
+
+#if ALT_PANGO
+PangoLayout *gp_cairo_create_layout (cairo_t *cr)
+{
+    static PangoFontMap *fontmap;
+    PangoContext *context;
+    PangoLayout *layout;
+
+    if (fontmap == NULL) {  
+        fontmap = pango_cairo_font_map_new_for_font_type(CAIRO_FONT_TYPE_FT);
+        if (fontmap == NULL) {
+    fontmap = pango_cairo_font_map_get_default();
+        }
+    }
+
+    context = pango_font_map_create_context(fontmap);
+    layout = pango_layout_new(context);
+    g_object_unref(context);
+
+    return layout;
+}
+#else
+PangoLayout *gp_cairo_create_layout (cairo_t *cr)
+{
+    return pango_cairo_create_layout(cr);
+}
+#endif
 
 void gp_cairo_draw_text(plot_struct *plot, int x1, int y1, const char* string)
 {
@@ -724,7 +752,7 @@
  }
 
  /* Create a PangoLayout, set the font and text */
- layout = pango_cairo_create_layout (plot->cr);
+ layout = gp_cairo_create_layout (plot->cr);
 
  pango_layout_set_text (layout, string_utf8, -1);
  g_free(string_utf8);
@@ -743,7 +771,7 @@
  plot->fontstyle ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
  pango_layout_set_font_description (layout, desc);
  pango_font_description_free (desc);
-
+
  pango_layout_get_extents(layout, &ink_rect, &logical_rect);
 
  /* EAM Mar 2009 - Adjusting the vertical position for every character fragment */
@@ -1178,7 +1206,7 @@
 
  /* Create a PangoLayout, set the font and text
  * with the saved attributes list, get extents */
- save_layout = pango_cairo_create_layout (plot->cr);
+ save_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (save_layout, gp_cairo_save_utf8, -1);
  pango_layout_set_attributes (save_layout, gp_cairo_enhanced_save_AttrList);
  pango_layout_get_extents(save_layout, NULL, &save_logical_rect);
@@ -1201,7 +1229,7 @@
 
  /* Create a PangoLayout, set the font and text with
  * the saved attributes list, get extents */
- underprinted_layout = pango_cairo_create_layout (plot->cr);
+ underprinted_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (underprinted_layout, gp_cairo_underprinted_utf8, -1);
  pango_layout_set_attributes (underprinted_layout, gp_cairo_enhanced_underprinted_AttrList);
  pango_layout_get_extents(underprinted_layout, NULL, &underprinted_logical_rect);
@@ -1211,7 +1239,7 @@
  /* compute the size of the text to overprint*/
 
  /* Create a PangoLayout, set the font and text */
- current_layout = pango_cairo_create_layout (plot->cr);
+ current_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (current_layout, enhanced_text_utf8, -1);
  current_desc = pango_font_description_new ();
  pango_font_description_set_family (current_desc, gp_cairo_enhanced_get_fontname(plot));
@@ -1249,7 +1277,7 @@
  /* position must be modified, but text not actually drawn */
  /* the idea is to use a blank character, drawn with the width of the text*/
 
- current_layout = pango_cairo_create_layout (plot->cr);
+ current_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (current_layout, gp_cairo_utf8, -1);
  pango_layout_set_attributes (current_layout, gp_cairo_enhanced_AttrList);
  pango_layout_get_extents(current_layout, ¤t_ink_rect, ¤t_logical_rect);
@@ -1257,7 +1285,7 @@
 
  /* we first compute the size of the text */
  /* Create a PangoLayout, set the font and text */
- hide_layout = pango_cairo_create_layout (plot->cr);
+ hide_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (hide_layout, enhanced_text_utf8, -1);
  hide_desc = pango_font_description_new ();
  pango_font_description_set_family (hide_desc, gp_cairo_enhanced_get_fontname(plot));
@@ -1288,7 +1316,7 @@
  /* we first compute the size of the text */
 
  /* Create a PangoLayout, set the font and text */
- zerowidth_layout = pango_cairo_create_layout (plot->cr);
+ zerowidth_layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (zerowidth_layout, enhanced_text_utf8, -1);
  zerowidth_desc = pango_font_description_new ();
  pango_font_description_set_family (zerowidth_desc, gp_cairo_enhanced_get_fontname(plot));
@@ -1420,7 +1448,7 @@
  double vert_just, arg, enh_x, enh_y, delta, deltax, deltay;
 
  /* Create a PangoLayout, set the font and text */
- layout = pango_cairo_create_layout (plot->cr);
+ layout = gp_cairo_create_layout (plot->cr);
 
  pango_layout_set_text (layout, gp_cairo_utf8, -1);
 
@@ -1635,7 +1663,7 @@
  unsigned int tmp_v_char, tmp_h_char;
 
  /* Create a PangoLayout, set the font and text */
- layout = pango_cairo_create_layout (plot->cr);
+ layout = gp_cairo_create_layout (plot->cr);
  pango_layout_set_text (layout, "0123456789", -1);
  desc = pango_font_description_new ();
  pango_font_description_set_family (desc, plot->fontname);

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 05 November 2009 10:57:59 Allin Cottrell wrote:
> Attached: request that pango/cairo use its FreeType + fontconfig
> backend when operating on MS Windows.
>
> Note: the patch doesn't seem to do any harm on Linux, but perhaps
> should be made conditional on compilation for Windows.

Doesn't build for me under linux:

wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
wxterminal/gp_cairo.c:705: warning: implicit declaration of function ‘pango_font_map_create_context’
wxterminal/gp_cairo.c:705: warning: assignment makes pointer from integer without a cast
gp_cairo.o: In function `gp_cairo_create_layout':
/home/merritt/cvs/gnuplot-cvs/src/wxterminal/gp_cairo.c:705: undefined reference to `pango_font_map_create_context'
collect2: ld returned 1 exit status
make[1]: *** [gnuplot] Error 1
make[1]: Leaving directory `/home/merritt/cvs/gnuplot-cvs/src'
make: *** [all-recursive] Error 1

So yes, we'll have to wrap it in a conditional.
Or maybe we should test for the presence of pango_font_map_create_context()
in the ./configure script?


--
Ethan A Merritt

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, 5 Nov 2009, Ethan Merritt wrote:

> On Thursday 05 November 2009 10:57:59 Allin Cottrell wrote:
> > Attached: request that pango/cairo use its FreeType + fontconfig
> > backend when operating on MS Windows.
> >
> > Note: the patch doesn't seem to do any harm on Linux, but perhaps
> > should be made conditional on compilation for Windows.
>
> Doesn't build for me under linux:
>
> wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
> wxterminal/gp_cairo.c:705: warning: \
implicit declaration of function ‘pango_font_map_create_context’

Ah, in the pango docs it says that this is new since pango
version 1.22.  Maybe conditionalize the relevant line as:

#if PANGO_VERSION_MAJOR == 1 && PANGO_VERSION_MINOR < 22
  context = pango_cairo_font_map_create_context(fontmap);
#else
  context = pango_font_map_create_context(fontmap);
#endif

(The first forulation above is now "deprecated".)

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 05 November 2009 11:39:19 Allin Cottrell wrote:

> Ah, in the pango docs it says that this is new since pango
> version 1.22.  Maybe conditionalize the relevant line as:
>
> #if PANGO_VERSION_MAJOR == 1 && PANGO_VERSION_MINOR < 22
>   context = pango_cairo_font_map_create_context(fontmap);
> #else
>   context = pango_font_map_create_context(fontmap);
> #endif
>
> (The first formulation above is now "deprecated".)

Nope. Doesn't help:

p_cairo.o: In function `gp_cairo_create_layout':
/home/merritt/cvs/gnuplot-cvs/src/wxterminal/gp_cairo.c:708: undefined reference to `pango_font_map_create_context'
collect2: ld returned 1 exit status
make[1]: *** [gnuplot] Error 1
make[1]: Leaving directory `/home/merritt/cvs/gnuplot-cvs/src'
make: *** [all-recursive] Error 1

I think it's not picking up the right header, so it doesn't have values
for PANGO_VERSION_* at all.

How about if we turn that around, and see if this works for you

 #if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
   context = pango_font_map_create_context(fontmap);
 #else
   context = pango_cairo_font_map_create_context(fontmap);
 #endif



--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 05 November 2009 12:21:24 Ethan Merritt wrote:
>  #if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
>    context = pango_font_map_create_context(fontmap);
>  #else
>    context = pango_cairo_font_map_create_context(fontmap);
>  #endif
>

Sigh.  That doesn't work either:

wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
wxterminal/gp_cairo.c:708: warning: passing argument 1 of ‘pango_cairo_font_map_create_context’ from incompatible pointer type


We need a better handle on what versions and configurations this
alternate code works on.


--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, 5 Nov 2009, Ethan Merritt wrote:

> On Thursday 05 November 2009 12:21:24 Ethan Merritt wrote:
> >  #if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
> >    context = pango_font_map_create_context(fontmap);
> >  #else
> >    context = pango_cairo_font_map_create_context(fontmap);
> >  #endif
> >
>
> Sigh.  That doesn't work either:
>
> wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
> wxterminal/gp_cairo.c:708: warning: passing argument 1 of ‘pango_cairo_font_map_create_context’ from incompatible pointer type

Urgh.  That function wants a pointer to PangoCairoFontMap, not to
PangoFontMap.

> We need a better handle on what versions and configurations this
> alternate code works on.

Yes, I can work on that if you like.  What's the pango version on
your system, BTW?

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 05 November 2009 13:36:11 Allin Cottrell wrote:

>
> On Thu, 5 Nov 2009, Ethan Merritt wrote:
>
> > On Thursday 05 November 2009 12:21:24 Ethan Merritt wrote:
> > >  #if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
> > >    context = pango_font_map_create_context(fontmap);
> > >  #else
> > >    context = pango_cairo_font_map_create_context(fontmap);
> > >  #endif
> > >
> >
> > Sigh.  That doesn't work either:
> >
> > wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
> > wxterminal/gp_cairo.c:708: warning: passing argument 1 of ‘pango_cairo_font_map_create_context’ from incompatible pointer type
>
> Urgh.  That function wants a pointer to PangoCairoFontMap, not to
> PangoFontMap.
>
> > We need a better handle on what versions and configurations this
> > alternate code works on.
>
> Yes, I can work on that if you like.  What's the pango version on
> your system, BTW?

The errors I reported are from a system with pango 1.18.2
libpango1.0_0-1.18.2-1mdv2008.0

I can build successfully on a newer system with
libpango1.0_0-1.24.1-1mdv2009.1


--
Ethan A Merritt

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gp_cairo.c patch for win32

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, 5 Nov 2009, Ethan Merritt wrote:

> On Thursday 05 November 2009 13:36:11 Allin Cottrell wrote:
> >
> > On Thu, 5 Nov 2009, Ethan Merritt wrote:
> >
> > > On Thursday 05 November 2009 12:21:24 Ethan Merritt wrote:
> > > >  #if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
> > > >    context = pango_font_map_create_context(fontmap);
> > > >  #else
> > > >    context = pango_cairo_font_map_create_context(fontmap);
> > > >  #endif
> > > >
> > >
> > > Sigh.  That doesn't work either:
> > >
> > > wxterminal/gp_cairo.c: In function ‘gp_cairo_create_layout’:
> > > wxterminal/gp_cairo.c:708: warning: passing argument 1 of ‘pango_cairo_font_map_create_context’ from incompatible pointer type
> >
> > Urgh.  That function wants a pointer to PangoCairoFontMap, not to
> > PangoFontMap.
> >
> > > We need a better handle on what versions and configurations this
> > > alternate code works on.
> >
> > Yes, I can work on that if you like.  What's the pango version on
> > your system, BTW?
>
> The errors I reported are from a system with pango 1.18.2
> libpango1.0_0-1.18.2-1mdv2008.0
>
> I can build successfully on a newer system with
> libpango1.0_0-1.24.1-1mdv2009.1

Thanks.  I'm now trying at home where I have pango 1.20.5 on
Ubuntu 8.04.  I was getting exactly the same errors as you
described, but I find this works OK (i.e. builds and runs alright)
for the relevant lines in gp_cairo.c.

<C-snippet>
#if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR >= 22
    context = pango_font_map_create_context(fontmap);
#else
    context =
      pango_cairo_font_map_create_context((PangoCairoFontMap *) fontmap);
#endif
    layout = pango_layout_new(context);
    g_object_unref(context);
</C-snippet>

That is, it seems you're OK casting from PangoFontMap to
PangoCairoFontMap.  I'll check this with the pango people.  (I
didn't find a clear account of this in the pango docs.)

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Allin and Ethan

I have tested pngcairo on win32 by  Allin Cottrell at 2009-11-06.

set term pngcairo
set title 'Title'
set out 'testpngcairo_ChangeLog20091106.png'
plot sin(x)
set out

on win32 binaries on CVS trees at 2009-11-06 with change by by  Allin Cottrell

The result is shown at
http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0029
0029 testpngcairo_ChangeLog20091106.png, 23,804 bytes, 2009-11-08

However now I just notice that it requires in the ChangeLog
libcairo > 1.21

What is libcairo 1.21?

https://launchpad.net/libcairo
The latest version is Latest version is 1.9.4

http://www.cairographics.org/
Latest news: 2009-10-15: cairo 1.9.4 snapshot available 2009-06-16: cairo 1.8.8 release available

I am using cairo Libraries for MinGW from
http://www.gtk.org/download-windows.html
cairo 1.8.8

Regards

Tatsuro

--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 07 November 2009, Tatsuro MATSUOKA wrote:

> Hello Allin and Ethan
>
> I have tested pngcairo on win32 by  Allin Cottrell at 2009-11-06.
>
> set term pngcairo
> set title 'Title'
> set out 'testpngcairo_ChangeLog20091106.png'
> plot sin(x)
> set out
>
> on win32 binaries on CVS trees at 2009-11-06 with change by by  Allin Cottrell
>
> The result is shown at
> http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0029
> 0029 testpngcairo_ChangeLog20091106.png, 23,804 bytes, 2009-11-08
>
> However now I just notice that it requires in the ChangeLog
> libcairo > 1.21
>
> What is libcairo 1.21?

Ah. Sorry, that's the pango version not the cairo version.
I will correct the ChangeLog.

        Ethan

> https://launchpad.net/libcairo
> The latest version is Latest version is 1.9.4
>
> http://www.cairographics.org/
> Latest news: 2009-10-15: cairo 1.9.4 snapshot available 2009-06-16: cairo 1.8.8 release available
>
> I am using cairo Libraries for MinGW from
> http://www.gtk.org/download-windows.html
> cairo 1.8.8
>
> Regards
>
> Tatsuro
>
> --------------------------------------
> GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
> http://pr.mail.yahoo.co.jp/gyao/
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, 8 Nov 2009, Tatsuro MATSUOKA wrote:

> I have tested pngcairo on win32 by  Allin Cottrell at 2009-11-06.
>
> set term pngcairo
> set title 'Title'
> set out 'testpngcairo_ChangeLog20091106.png'
> plot sin(x)
> set out
>
> on win32 binaries on CVS trees at 2009-11-06 with change by by
> Allin Cottrell
>
> The result is shown at
> http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0029
> 0029 testpngcairo_ChangeLog20091106.png, 23,804 bytes, 2009-11-08

I notice that the font-rendering is not good in this PNG file.  I
suspect that the FreeType + fontconfig backend is not being used
in this case.  To get the benefit of the change in gp_cairo.c, the
pango and cairo libraries must be built with support for
fontconfig, and the DLLs for freetype, fontconfig and expat must
all be present.  DLLs that work in this respect can be found at

http://www.gtk.org/download-windows.html

For testing purposes, it would be easy to put a debugging print
statement into gp-cairo.c following line 703, to see if the
FreeType backend is in fact activated.

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--- Allin Cottrell <cottrell@...> wrote:

>
> On Sun, 8 Nov 2009, Tatsuro MATSUOKA wrote:
>
> > I have tested pngcairo on win32 by  Allin Cottrell at 2009-11-06.
> >
> > set term pngcairo
> > set title 'Title'
> > set out 'testpngcairo_ChangeLog20091106.png'
> > plot sin(x)
> > set out
> >
> > on win32 binaries on CVS trees at 2009-11-06 with change by by
> > Allin Cottrell
> >
> > The result is shown at
> > http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0029
> > 0029 testpngcairo_ChangeLog20091106.png, 23,804 bytes, 2009-11-08
>
> I notice that the font-rendering is not good in this PNG file.  I
> suspect that the FreeType + fontconfig backend is not being used
> in this case.  To get the benefit of the change in gp_cairo.c, the
> pango and cairo libraries must be built with support for
> fontconfig, and the DLLs for freetype, fontconfig and expat must
> all be present.  DLLs that work in this respect can be found at
>
> http://www.gtk.org/download-windows.html
>
> For testing purposes, it would be easy to put a debugging print
> statement into gp-cairo.c following line 703, to see if the
> FreeType backend is in fact activated.
>
The above address is the same as I have used.

***************** Part of my post.
I am using cairo Libraries for MinGW from
http://www.gtk.org/download-windows.html
****************

However what I used the is not latest version.
(Ex. Pango version of mine 1.24.5, latest 1.26.0)

I will update libraries and try the test again.

Regards

Tatsuro

--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--- Tatsuro MATSUOKA wrote:

>
>
> --- Allin Cottrell  wrote:
> >
> > I notice that the font-rendering is not good in this PNG file.  I
> > suspect that the FreeType + fontconfig backend is not being used
> > in this case.  To get the benefit of the change in gp_cairo.c, the
> > pango and cairo libraries must be built with support for
> > fontconfig, and the DLLs for freetype, fontconfig and expat must
> > all be present.  DLLs that work in this respect can be found at
> >
> > http://www.gtk.org/download-windows.html
> >
> > For testing purposes, it would be easy to put a debugging print
> > statement into gp-cairo.c following line 703, to see if the
> > FreeType backend is in fact activated.
> >
> The above address is the same as I have used.
>
> ***************** Part of my post.
> I am using cairo Libraries for MinGW from
> http://www.gtk.org/download-windows.html
> ****************
>
> However what I used the is not latest version.
> (Ex. Pango version of mine 1.24.5, latest 1.26.0)
>
> I will update libraries and try the test again.

I have update the latest glib and pango.
glib 2.20.5-1 -> glib_2.22.2-1
pango_1.24.5-2 -> pango_1.26.0-1

Results went worse :-(.

Please see

Script
***********
set term pngcairo
set title 'Title'
set out 'testpngcairo_ChangeLog20091106_2.png'
plot sin(x)
set out

Screen output
***********
gnuplot> set term pngcairo
Terminal type set to 'pngcairo'
Options are ' size 640, 480 '
gnuplot> set title 'Title'
gnuplot> set out 'testpngcairo_ChangeLog20091106_2.png'
gnuplot> plot sin(x)
Fontconfig error: Cannot load default config file

(gnuplot.exe:236): Pango-WARNING **: failed to choose a font, expect ugly output.
engine-type='PangoRenderFc', script='common'

(gnuplot.exe:236): Pango-WARNING **: failed to choose a font, expect ugly output.
engine-type='PangoRenderFc', script='latin'
gnuplot> set out
************

http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0031 

0029 testpngcairo_ChangeLog20091106.png *** previous one on win32
0030 testpngcairo_ChangeLog20091106_2.png  *** this time  on win32
0031 testpngcairo_ChangeLog20091106_cyg.png *** this time on cygwin
0032 wxt_ChangeLog20091106.png **** this time for wxt term on win32

As is seen in testpngcairo_ChangeLog20091106_2.png, plot area is full of screen and all labels seem to
be out of plot area.

This is also seen at the wxt terminal as is seen in wxt_ChangeLog20091106.png.

Terminal type set to 'wxt'
gnuplot> plot sin(x)
Fontconfig error: Cannot load default config file

(gnuplot.exe:2208): Pango-WARNING **: failed to choose a font, expect ugly output.
engine-type='PangoRenderFc', script='common'

(gnuplot.exe:2208): Pango-WARNING **: failed to choose a font, expect ugly output.
engine-type='PangoRenderFc', script='latin'


Perhaps the latest pango (also glib ) libraries are too new for the  fontconfig-dev_2.7.3-1 (and also
for freetype_2.3.9-1, libpng_1.2.39-1)

My version list at present
glib_2.22.2-1
pango_1.26.0-1
cairo_1.8.8-2
fontconfig_2.7.3-1
freetype_2.3.9-1

Please tell me your version list that you have used this time change.

Regards

Tatsuro




--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: test of pngcairo on win32 by Allin Cottrell at 2009-11-06

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

--- Tatsuro MATSUOKA wrote:
> I have update the latest glib and pango.
> glib 2.20.5-1 -> glib_2.22.2-1
> pango_1.24.5-2 -> pango_1.26.0-1
>
> Results went worse :-(.

I have taken a serious mistake.  I did not copy etc/fonts/fonts.conf of fontconfig to gnuplot
directry. Just coping it gave me successful results.

The results are seen
http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0034

0033 testpngcairo_ChangeLog20091106_3.png
0034 testpngcairo_Kanji.png

Jananese Kanji test was also successful by your correction.
Great!!

People can enjoy high quality png output on cairo and pango technology on windows platform.

Thanks a lot!!

Tatsuro

--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Side effect of change src/wxterminal/gp_cairo.c to wxt terminal on gnuplot cvs / win32 ?

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

I have noticed not-good styles in some plots in gnuplot demo (all.dem) in wxt terminal at cvs trees of
2009-11-06. The multiplot graphs seem to be more oblate than those before change.

In some demos, labels are far from axes so that shapes of graghs are oblate.

I have uploaded the latest cvs snapshot as testing one.

Please examine by the below

http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/
0004 gp45-winbin_2009_1106.zip
0005 gp45-winbin-wxt-diff_2009_1106.zip,

Regards

Tatsuro

--- Tatsuro MATSUOKA  wrote:

> Hello
>
> --- Tatsuro MATSUOKA wrote:
> > I have update the latest glib and pango.
> > glib 2.20.5-1 -> glib_2.22.2-1
> > pango_1.24.5-2 -> pango_1.26.0-1
> >
> > Results went worse :-(.
>
> I have taken a serious mistake.  I did not copy etc/fonts/fonts.conf of fontconfig to gnuplot
> directry. Just coping it gave me successful results.
>
> The results are seen
> http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0034
>
> 0033 testpngcairo_ChangeLog20091106_3.png
> 0034 testpngcairo_Kanji.png
>
> Jananese Kanji test was also successful by your correction.
> Great!!
>
> People can enjoy high quality png output on cairo and pango technology on windows platform.
>
> Thanks a lot!!
>
> Tatsuro
>
> --------------------------------------
> GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
> http://pr.mail.yahoo.co.jp/gyao/
>


--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Example of chage of snapshot of image demo before and after Nov. 06 [was Side effect of change src/wxterminal/gp_cairo.c ...]

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

--- Tatsuro MATSUOKA  wrote:

> I have noticed not-good styles in some plots in gnuplot demo (all.dem) in wxt terminal at cvs
> trees of
> 2009-11-06. The multiplot graphs seem to be more oblate than those before change.
> In some demos, labels are far from axes so that shapes of graghs are oblate.
> I have uploaded the latest cvs snapshot as testing one.
> Please examine by the below
> http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/
> 0004 gp45-winbin_2009_1106.zip
> 0005 gp45-winbin-wxt-diff_2009_1106.zip,


The previous post was lack of an example.

Here I show an example

http://www.geocities.jp/tmgpltwin/Files/Files.html#0037


0036 wxt_ex_20091104.png, 36,821 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
in imagae.dem at the latest ChangeLog Date 2009-11-04

0037 wxt_ex_20091106.png, 40,086 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
in imagae.dem at the latest ChangeLog Date 2009-11-06

0038 wxt_ex_20091106_2.png, 40,086 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
in imagae.dem at the latest ChangeLog Date 2009-11-06 (After windows size expanded in y direction)

I think that default window size is better to be expanded in y direction.

Regards

Tatsuro



--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Example of chage of snapshot of image demo before and after Nov. 06 [was Side effect of change src/wxterminal/gp_cairo.c ...]

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 11 November 2009, Tatsuro MATSUOKA wrote:

> Hello
>
> --- Tatsuro MATSUOKA  wrote:
>
> > I have noticed not-good styles in some plots in gnuplot demo (all.dem) in wxt terminal at cvs
> > trees of
> > 2009-11-06. The multiplot graphs seem to be more oblate than those before change.
> > In some demos, labels are far from axes so that shapes of graghs are oblate.
> > I have uploaded the latest cvs snapshot as testing one.
> > Please examine by the below
> > http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/
> > 0004 gp45-winbin_2009_1106.zip
> > 0005 gp45-winbin-wxt-diff_2009_1106.zip,
>
>
> The previous post was lack of an example.
>
> Here I show an example
>
> http://www.geocities.jp/tmgpltwin/Files/Files.html#0037

I see what you mean.
I suppose it is a side-effect of requesting the freetype back end rather
than the win32 back end.

> 0036 wxt_ex_20091104.png, 36,821 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
> in imagae.dem at the latest ChangeLog Date 2009-11-04
>
> 0037 wxt_ex_20091106.png, 40,086 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
> in imagae.dem at the latest ChangeLog Date 2009-11-06
>
> 0038 wxt_ex_20091106_2.png, 40,086 bytes, 2009-11-11, wxt terminal on gnuplot4.5(CVS) MinGW, an exaple
> in imagae.dem at the latest ChangeLog Date 2009-11-06 (After windows size expanded in y direction)
>
> I think that default window size is better to be expanded in y direction.

The window size in your screenshot is the same as I see under linux.
The difference is the vertical space allocated for each text string.
The program is reserving too much space for each line of text, presumably
because  pango_layout_get_extents() is reporting too large a vertical extent.
I am guessing that it is another bug in the Windows implementation of pango.  

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Example of chage of snapshot of image demo before and after Nov. 06 [was Side effect of change src/wxterminal/gp_cairo.c ...]

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Wed, 11 Nov 2009, Ethan Merritt wrote:

> On Wednesday 11 November 2009, Tatsuro MATSUOKA wrote:
> > http://www.geocities.jp/tmgpltwin/Files/Files.html#0037
>
> I see what you mean.
> I suppose it is a side-effect of requesting the freetype back
> end rather than the win32 back end.

> > I think that default window size is better to be expanded in y
> > direction.
>
> The window size in your screenshot is the same as I see under
> linux. The difference is the vertical space allocated for each
> text string. The program is reserving too much space for each
> line of text, presumably because pango_layout_get_extents() is
> reporting too large a vertical extent. I am guessing that it is
> another bug in the Windows implementation of pango.

This part of the image demo looks pretty bad to me on Linux (in a
setup where most things that use FreeType + fontconfig look fine).
This is using current CVS gnuplot (with the new code in gp_cairo.c
inactive, since WIN32 is not defined).  Sample screenshot at

http://www.wfu.edu/~cottrell/gptest/penguins.png

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Example of chage of snapshot of image demo before and after Nov. 06 [was Side effect of change src/wxterminal/gp_cairo.c ...]

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 11 November 2009, Allin Cottrell wrote:

>
> On Wed, 11 Nov 2009, Ethan Merritt wrote:
>
> > On Wednesday 11 November 2009, Tatsuro MATSUOKA wrote:
> > > http://www.geocities.jp/tmgpltwin/Files/Files.html#0037
> >
> > I see what you mean.
> > I suppose it is a side-effect of requesting the freetype back
> > end rather than the win32 back end.
>
> > > I think that default window size is better to be expanded in y
> > > direction.
> >
> > The window size in your screenshot is the same as I see under
> > linux. The difference is the vertical space allocated for each
> > text string. The program is reserving too much space for each
> > line of text, presumably because pango_layout_get_extents() is
> > reporting too large a vertical extent. I am guessing that it is
> > another bug in the Windows implementation of pango.
>
> This part of the image demo looks pretty bad to me on Linux (in a
> setup where most things that use FreeType + fontconfig look fine).
> This is using current CVS gnuplot (with the new code in gp_cairo.c
> inactive, since WIN32 is not defined).  Sample screenshot at
>
> http://www.wfu.edu/~cottrell/gptest/penguins.png

Yes, that's very close to what I see here with the default font.
The layout works much better if I say
   set term wxt ",7"

Perhaps more relevant, it also looks better if I force the wxt terminal
window size to 640x480 to match the bitmap terminals.

  set term wxt size 640,480

But is this a bug?  Or does it just indicate you shouldn't use the
default aspect ratio for drawing 2x2 multiplots?
Maybe the default font size should change dependent on the canvas size?


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Example of chage of snapshot of image demo before and after Nov. 06 [was Side effect of change src/wxterminal/gp_cairo.c ...]

by Allin Cottrell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Wed, 11 Nov 2009, Ethan Merritt wrote:

> On Wednesday 11 November 2009, Allin Cottrell wrote:
> >
> > On Wed, 11 Nov 2009, Ethan Merritt wrote:
> >
> > > On Wednesday 11 November 2009, Tatsuro MATSUOKA wrote:
> > > > http://www.geocities.jp/tmgpltwin/Files/Files.html#0037
> > >
> > > I see what you mean.
> > > I suppose it is a side-effect of requesting the freetype back
> > > end rather than the win32 back end.
> >
> > > > I think that default window size is better to be expanded in y
> > > > direction.
> > >
> > > The window size in your screenshot is the same as I see under
> > > linux. The difference is the vertical space allocated for each
> > > text string. The program is reserving too much space for each
> > > line of text, presumably because pango_layout_get_extents() is
> > > reporting too large a vertical extent. I am guessing that it is
> > > another bug in the Windows implementation of pango.
> >
> > This part of the image demo looks pretty bad to me on Linux (in a
> > setup where most things that use FreeType + fontconfig look fine).
> > This is using current CVS gnuplot (with the new code in gp_cairo.c
> > inactive, since WIN32 is not defined).  Sample screenshot at
> >
> > http://www.wfu.edu/~cottrell/gptest/penguins.png
>
> Yes, that's very close to what I see here with the default font.
> The layout works much better if I say
>    set term wxt ",7"
>
> Perhaps more relevant, it also looks better if I force the wxt terminal
> window size to 640x480 to match the bitmap terminals.
>
>   set term wxt size 640,480
>
> But is this a bug?

No, I wouldn't say it's a bug.  I think maybe it's an infelicity
in the demo file, but then it could get complicated to put lots of
conditionals into the demo, dependent on the terminal type.

I think my point is this: Tatsuro got some bad-looking results
from the demo on wxt on Windows, but this by itself is not
"evidence against" the current gnuplot code, if the demofile
parameters are not properly "tuned" for cairo/wxt output.

Allin Cottrell

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
< Prev | 1 - 2 | Next >