Re: PangoFontMetrics: approximate_[char|digit]_width



Hi,

Havoc Pennington <hp redhat com> writes:

> Imagine that you are going to set an entry wide enough to hold 10
> characters. So you multiply 10 characters by approximate_char_width,
> and set the entry that wide.

Well, in that case I'd expect approximate_char_width to be 
max_char_width actually to assure that whatever string the user
enters, the entry is set up wide enough to show it completely.
If I understand the code in pangox.c correctly, you are 
calculating some sort of average char width. Is this correct?

> approximate_digit_width is doing the same but for the decimal digits
> only, so it amounts to width ("0123456789") / 10.

Especially in this case (most prominently GtkSpinButtons) I'd 
say that using a max value would make much more sense than 
using an average.


Salut, Sven




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