[cairo] Want to stretch my fonts

Behdad Esfahbod behdad.esfahbod at gmail.com
Wed Jul 28 00:27:55 PDT 2010


On 07/28/10 03:20, Kayven Riese wrote:
> Is that why I am getting a seg fault?

No.  The reason is that you defined fatrix as a pointer.  A pointer pointing
nowhere.  Instead you should define it as a cairo_matrix_t, then in your code,
replace all "fatrix" occurrences with "&fatrix", and also use
cairo_matrix_scale(&fatrix,0.8,1) instead of that cairo_matrix_init_scale()
line of yours.

behdad

>      /**********************************
>  80          * Nuclear Proteins
>  81          **********************************/
>  82         cairo_set_font_size (cr, (1400.0*nuclear)/total);
>  83         cairo_set_source_rgb (cr, 0.4, 0.2, 0.6);
>  84         cairo_move_to (cr, BORDER+CELL_DIAM/2-3600*nuclear/total,
> TOP_BORDER+1000*nuclear    /total);
>  85         cairo_get_font_matrix(cr,fatrix);
>  86         cairo_matrix_init_scale(fatrix,0.8,0);
>  87         cairo_set_font_matrix(cr,fatrix);
>  88         cairo_show_text (cr, "N");
>  89         cairo_set_font_size (cr, (1040.0*nuclear)/total);
>  90         cairo_show_text (cr, "ucLea");/**/
>  91         cairo_set_font_size (cr, (1400.0*nuclear)/total);
>  92         cairo_show_text (cr, "R");/**/
>  93
> 
> Do the scale factors multiply or add?  I am supply sy = 0.. maybe I want
> sy = 1
> 
> 
> On Wed, Jul 28, 2010 at 12:16 AM, donn <donn.ingle at gmail.com
> <mailto:donn.ingle at gmail.com>> wrote:
> 
>     On 28/07/2010 08:56, Kayven Riese wrote:
> 
>         I need to learn to make my letters on a different
>         canvas and combine the two canvases or something, don't I?
> 
>     Have a look at context.save() and context.restore() -- you can have
>     a different matrix within those two and not affect the one outside.
> 
> 
>     \d
> 
> 
>     --
>     cairo mailing list
>     cairo at cairographics.org <mailto:cairo at cairographics.org>
>     http://lists.cairographics.org/mailman/listinfo/cairo
> 
> 
> 
> 
> -- 
> 
> *----------------------------------------------------------*
>   Kayven Riese, BSCS,
>                       MS  (Physiology and Biophysics)
>   (415) 902 5513 cellular
>   http://kayve.net
>   Webmaster http://ChessYoga.org
> *----------------------------------------------------------*
> 
> 
> 
> 
> 
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list