[cairo] toy text api, fonts and scales

Kozhevnikov Mikhail mikhailkozhevnikov at yandex.ru
Wed Nov 5 19:27:52 PST 2008


My one look like attached (zoomed 6400%).
I use Acrobat Reader 9. And you?

06.11.08, 02:26, "Behdad Esfahbod" <behdad at behdad.org>:

> My PDF viewer shows your PDF correctly, with some barely-visible text.  It's
> 1pt after all.  Maybe you can show me how it looks for you?
> Kozhevnikov Mikhail wrote:
> > 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.ya.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hw.GIF
Type: image/gif
Size: 4901 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20081106/6906cf03/attachment-0001.gif 


More information about the cairo mailing list