[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    [cairo] FT fonts and Aqua ?
From:       Charles_سمير_Doutriaux
Date:       2009-03-31 18:08:45
Message-ID: 269F9F2D-A263-4ADB-B2B4-DB77EDF6EFDF () llnl ! gov
[Download RAW message or body]

Hello,

I'm trying to use cairo to draw on an aqua surface.

I'm successfull getting it to draw and update rectangles/lines, etc...

But I'm having an issue when it comes to text

I can get it to write on my surface, if i use the default font, but  
when creating a FT face for cairo it fails with "out_of_memory" when  
trying to use it for drawing,

here's a snippet of the code I use, any idea? IS it at all possible to  
use FT on Aqua surfaces?

Thanks

C.

code:

   context = static_cast<CGContextRef > (this->macCGHandle());
     CAIRO_SURFACE =    
cairo_quartz_surface_create_for_cg_context(context,width,height);
     cairo_surface_mark_dirty(CAIRO_SURFACE);
     cr = cairo_create(CAIRO_SURFACE);
   cairo_move_to(cr,x,y);
   printf("we are drawing: %s\n",msg);
   strcpy(path,"/Users/doutriaux1/Fonts/samba/Samba.ttf");
   index = FT_New_Face( ft_library, path, 0, &myftface );
   if ( index )
     {
       printf("londfont no file bug\n");
     }
   mycairoftface = (cairo_font_face_t  
*)cairo_ft_font_face_create_for_ft_face(myftface,0);
   printf("cairo status b4 ftface: %s 
\n",cairo_status_to_string(cairo_status(cr)));

   cairo_set_font_face (cr, mycairoftface);
   printf("cairo status after ftface: %s 
\n",cairo_status_to_string(cairo_status(cr)));
   cairo_set_font_size(cr, 100.);
   printf("cairo status after size: %s 
\n",cairo_status_to_string(cairo_status(cr)));

   cairo_show_text(cr,msg);
   printf("cairo status after msg ftface: %s 
\n",cairo_status_to_string(cairo_status(cr)));


The satus meesages are as follow:
cairo status b4 ftface: success
cairo status after ftface: success
cairo status after size: success
cairo status after msg ftface: out of memory

_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic