[cairo] pango_cairo_layout_path and hinting

Lutz Gehlen lrg_ml at gmx.net
Thu Jun 17 14:57:44 PDT 2010


Hello Arjen,
thank you (also to Behdad, of course) for your reply. I see that
there is more behind it than I thought. My original question was
only concerned with hinting. In my limited understanding, the
rasterization of glyphs is aided by hints of the font designer how
the glyph should be rasterized. I wondered if these information were
lost when turning the glyph into a "normal" path. Can anybody
comment on this?

At the moment and with the new information I got from you I am
unsure what the best way is for me. Speed is not the most important
issue for my application. I think for the time being, I will keep it
like I did it until now. If no stroke is required I use
show_layout(), otherwise path()+fill()+stroke().

Thanks for your help
Lutz

On Thu, Jun 17, 2010 at 10:51:50PM +0200, Arjen Nienhuis wrote:
> Hi,
> 
> In theory pango_cairo_show_layout() does all sorts of speed
> optimizations that ...path()+cairo_fill() does not. I believe
> ...show_layout() can do sub-pixel (LCD) stuff where cairo_fill can
> not. I think all glyphs are (sub?)pixel-aligned with ...show_layout().
> 
> In practice ...show_layout() is faster while ...fill() looks 'nicer'.
> 'nice' does not mean more readable. Especially with a very small font
> size (thumbnails) the line spacing is 'wrong' with ...show_layout().
> 3.5 pixel line spacing gets rounded to 3 or 4 every other line.
> 
> I'm not sure if it's possible to change the font settings to make
> show_layout() behave like ...fill().
> 
> Met vriendelijke groet,
> Arjen Nienhuis
> 
> On Sat, Jun 12, 2010 at 1:10 AM, Behdad Esfahbod <behdad at behdad.org> wrote:
> > On 06/11/2010 03:09 AM, Lutz Gehlen wrote:
> >
> >> However, I was wondering how the hinting for glyph rasterization is
> >> affected by this process. After converting the text to a path, is
> >> hinting performed at all? The question boils down to: Does
> >>
> >> pango_cairo_layout_path(cr, layout);
> >> cairo_fill(cr);
> >>
> >> give the same result as
> >>
> >> pango_cairo_show_layout(cr, layout);?
> >
> > It's supposed to give the same result, yes.  How good that actually works is
> > another question.  Let us know.
> >
> > behdad
> >
> >
> >> Thanks for your help
> >> Lutz
> >> --
> >> cairo mailing list
> >> cairo at cairographics.org
> >> http://lists.cairographics.org/mailman/listinfo/cairo
> >>
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
> >
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list