[cairo] toy text api, fonts and scales

Kozhevnikov Mikhail mikhailkozhevnikov at yandex.ru
Wed Nov 5 14:41:31 PST 2008


Ok. But if I set font size 10 and scale the whole picture down, the trouble is the same

   cairo_surface_t *surface;
   cairo_t *cr;
   cairo_pattern_t *linpat;
   surface = cairo_pdf_surface_create("tstfns.pdf", 50, 50);
   cr = cairo_create (surface);
   cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
   cairo_move_to(cr, 25, 25);
   cairo_scale(cr, 0.1, 0.1);
   cairo_set_font_size(cr, 10);
   cairo_show_text(cr, "hello world");
   cairo_destroy (cr);
   cairo_surface_destroy (surface);

Does it mean I can't draw letters smaller then some threshold?

Best regards, Mikhail.

06.11.08, 00:42, "Behdad Esfahbod" <behdad at behdad.org>:

> Thanks.  I assume you meant to CC the list but forgot?  Helps if you resend to
> list as our PDF expert and see and track the bug down.
> Thanks,
> behdad
> Mikhail Kozhevnikov wrote:
> > Hi Behdad,
> > 
> > The code is:
> >   cairo_surface_t *surface;
> >   cairo_t *cr;
> >   cairo_pattern_t *linpat;
> >   surface = cairo_pdf_surface_create("tstfns.pdf", 50, 50);
> >   cr = cairo_create (surface);
> >   cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
> > CAIRO_FONT_WEIGHT_NORMAL);
> >   cairo_set_font_size(cr, 1);
> >   cairo_move_to(cr, 25, 25);
> >   cairo_show_text(cr, "hello world");
> >   cairo_destroy (cr);
> >   cairo_surface_destroy (surface);
> > 
> > Simple, isn't it? :)
> > 
> > And if I run it, I get the result as attached.
> > 
> > Best regards, Mikhail.
> >> Mikhail Kozhevnikov wrote:
> >>  
> >>> Hi,
> >>>
> >>> I'm experiencing troubles with rendering text to PDF at different
> >>> scales with cairo_show_text().
> >>>
> >>> The labels are displayed with always the same font family and size
> >>> ("Sans Serif", 0.3), but as the scale value changes, intervals
> >>> between symbols stretch enormously - up to 10 times the width of a
> >>> letter.
> >>>
> >>> Anyone met the same? What could be the reason?
> >>>
> >>> Thanks, Mikhail.
> >>>     
> >>
> >> Hi Mikhail,
> >>
> >> Can you show us code and the unexpected PDF output?
> >>
> >> Have fun with cairo!
> >>
> >> behdad
> >>
> >>   

-- 
Яндекс.Почта. Поищите спам где-нибудь еще http://mail.yandex.ru/nospam 


More information about the cairo mailing list