Robert Roessler:
> As I was studying Scintilla usage of Pango, one of the calls I looked
> at was SurfaceImpl::WidthText(), and how it seemed to be getting
> called for every line IF the line# margin was being displayed...
>
> Hmmm... an *expensive* call on every line... and I am having
> performance problems... ;)
Width calculation isn't the only thing occurring there. It may also
be switching fonts and releasing cached resources.
> Possible approaches: besides using a mono-spaced font for line numbers
> (or just not using line numbers), is it the case that the rendered
> width of a numeric string in s particular font is just the sum of the
> widths of its individual glyphs (plus possible inter-character
> spacing), *irrespective* of their ordering?
This is a dangerous assumption and is worse now there are so many
tweaks for fonts: I've seen very different spacing from playing with
the GNOME font control panel. Any patch should be an option.
Digit widths are more variable on GTK+ than on Windows where many
fonts that are otherwise strongly proportional have equally wide
digits. Many italics fonts have '7' drawn outside the character box
but I haven't found any (yet) that change spacing because of kerning
on digit strings.
> As for how much of this is exposed at the level of the Scintilla API,
> there could either be an additional variant of the SCI_TEXTWIDTH call,
> *or* SCI_TEXTWIDTH could just note that a given invocation is using
> STYLE_LINENUMBER, and use the "alternate" implementation.
Why does this get exposed to the container? The value is supposed
to be the same as performing the costly version, so the API can just
use the current code. Its Scintilla internally that is doing the right
justified drawing.
Neil
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest