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



Havoc Pennington:

> Also be sure Scintilla isn't doing anything really easily fixable,
> like keeping a PangoLayout around permanently for every line, or
> computing them all at once, or (some people have done this) using a
> PangoLayout for every character cell.

   The main drawing strategy code is for each expose/draw:

# font descriptions already created at style definition time
gtk_widget_create_pango_context()
pango_layout_new()
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. Plain text (one style for the whole document)
is rendered significantly faster by this code. The target text is source
code and so is made up of many short runs with individual operator
characters often styled in different colours or weights to neighbouring
text.

   Neil




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