[cairo] Want to stretch my fonts
Kayven Riese
kayvey at gmail.com
Wed Jul 28 00:35:12 PDT 2010
OK.. but now I am confused about how this is supposed to work.
cairo_get_font_matrix(cr,&fatrix);
86 //cairo_matrix_init_scale(&fatrix,0.8,1);
87 cairo_set_font_matrix(cr,&fatrix);
The attached pngs are cellgram.png with line 86 commented out.. and the
other file with the cairo_matrix_init_scale active.. I am seeing a
translation instead of a vertical shear .. or.. umm.. I wanted to squish the
word so it would fit in the cell. I just wanted to do some numerical
experiments (hence just plugged in 0.8 and 1).. what am I missing?
On Wed, Jul 28, 2010 at 12:27 AM, Behdad Esfahbod <behdad.esfahbod at gmail.com
> wrote:
> 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
>
--
*----------------------------------------------------------*
Kayven Riese, BSCS,
MS (Physiology and Biophysics)
(415) 902 5513 cellular
http://kayve.net
Webmaster http://ChessYoga.org
*----------------------------------------------------------*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100728/2cd5373e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cellgram.png
Type: image/png
Size: 38526 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100728/2cd5373e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cellgram0.8.png
Type: image/png
Size: 35169 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100728/2cd5373e/attachment-0003.png>
More information about the cairo
mailing list