Re: [scintilla] Pango support on GTK+ 2.x



On Mon, Mar 10, 2003 at 08:18:28AM +1100, Neil Hodgson wrote: 
> # font descriptions already created at style definition time
> gtk_widget_create_pango_context()
> pango_layout_new()

(irrelevant side note, gtk_widget_create_pango_layout() combines those
two steps)

> for each line:
>   for each text run in one style:
>      gdk_gc_set_foreground()
>      pango_layout_set_text()
>      pango_layout_set_font_description()
>      pango_layout_get_line()
>      gdk_draw_layout_line()
> unref layout and context
> 
>    Possibly it may pay to insert all the runs into one pango layout and then
> render the whole line at once.

I would expect so, you're doing significant extra work per-run by
using separate layouts. Also, for natural-language text (which might
appear in a comment), if you break it into multiple layouts you will
break things. The smallest "atomic" unit of text layout is the
paragraph, you need to have the whole paragraph to avoid losing
context that may be needed. i.e. the rendering of one character can be
affected by surrounding characters.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]