Hi,
As posted previously I get much ovesized default fonts
(title/labels) for plplot+extcairo+(gtk-fortran)+gfortran
combination. I am using pgplot  5.9.5 ie. default for Ubuntu 11.10
and gtk-2-fortran. The enclosed code reproducing my problem
is gtk/jerryd-gtk-fortran-5af09d1/graphics/plplot/hl_plplot1e.f90
example stripped to bare bones as in plplot-5.9.9/examples/c/ext-cairo-test.c.

The output I am getting is correct gtk gui window with correct gtk fonts and 
with an area set for plplot with
axes drawn properly, yet all labelling is using factor several oversized
fonts. Plplot knows size of this font as it leaves large margins for labelling. 
The margins may change by call plschr, with no effect to the font itself.

Any advice? Thanks in advance,
Alex
============================================================
! gfortran mycair.f90 -o m -g `pkg-config --cflags gtk-2-fortran plplotd-f95 
cairo pango` `pkg-config --libs gtk-2-fortran plplotd-f95 cairo pango`

module common
   use iso_c_binding
   use gtk, only: gtk_button_new, gtk_container_add, gtk_drawing_area&
        &_new, gtk_events_pending, gtk_main, gtk_main_iteration, 
gtk_main_iteration_do,&
        & gtk_widget_show, gtk_widget_show_all, gtk_window_new, gtk_init
   use g, only: g_object_get_data, g_usleep
   use gdk_pixbuf, only: gdk_pixbuf_get_height, gdk_pixbuf_get_pixels, &
         gdk_pixbuf_get_width

   use gtk_draw_hl

   use plplot_extra

end module common

module plplot_code
   use plplot
   use iso_c_binding
   use common

   implicit none

contains
   subroutine x01f95(area)

     type(c_ptr), intent(in) :: area

     type(c_ptr) :: cc

     character(len=80) :: version

     call plgver(version)
     write (*,'(a,a)') 'PLplot library version: ', trim(version)

     cc = hl_gtk_drawing_area_cairo_new(area)

     call plsdev("extcairo")
     call plinit()
     call pl_cmd(PLESC_DEVINIT, cc)
!    call plschr (0._plflt, 0.3_plflt)
!    call plssym (0._plflt, 0.3_plflt)
     call plenv( 0._plflt, 100._plflt, 0._plflt, 200._plflt, 1, 0 )
     call pllab( '(x)', '(y)', 'PLplot Example' )

     call plend()
     call hl_gtk_drawing_area_cairo_destroy(cc)

   end subroutine x01f95

!======================================================================

end module plplot_code

module cl_handlers

   use common

   use gtk_hl
   use gtk_draw_hl

   use iso_c_binding

   implicit none

   integer(kind=c_int) :: run_status = TRUE

contains
   function delete_cb (widget, event, gdata) result(ret)  bind(c)

     integer(c_int)    :: ret
     type(c_ptr), value :: widget, event, gdata

     run_status = FALSE
     ret = FALSE
   end function delete_cb

   subroutine quit_cb(widget, gdata) bind(c)
     type(c_ptr), value :: widget, gdata

     run_status = FALSE
   end subroutine quit_cb

   subroutine pending_events ()
     integer(kind=c_int) :: boolresult
     do while(IAND(gtk_events_pending(), run_status) /= FALSE)
        boolresult = gtk_main_iteration_do(FALSE) ! False for non-blocking
     end do
   end subroutine pending_events


end module cl_handlers

program cairo_plplot

   use cl_handlers
   use plplot_code

   implicit none

   type(c_ptr) :: window, drawing, scroll_w, base, qbut

   call gtk_init()

   window = hl_gtk_window_new("PLplot x01 / gtk-fortran (extcairo)"//cnull, &
        & delete_event = c_funloc(delete_cb))
   base = hl_gtk_box_new()
   call gtk_container_add(window, base)

   drawing = hl_gtk_drawing_area_new(size=(/600, 500/), &
        & has_alpha = FALSE, &
        & scroll = scroll_w, &
        & ssize=(/ 600, 500 /))
   call hl_gtk_box_pack(base, scroll_w)

   call gtk_widget_show_all (window)

   call x01f95(drawing)

   do
      call pending_events()
      if (run_status == FALSE) exit
      call g_usleep(10000_c_long) ! So we don't burn CPU cycles
   end do
   print *, "All done"
end program cairo_plplot
===================================================


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to