Re: PangoFontMetrics: approximate_[char|digit]_width



Sven Neumann <sven gimp org> writes:
> 
> you recently added two new fields to PangoFontMetrics and 
> implemented methods to set these values in the Pango X backend.
> Since you mentioned other backends have to implement these
> methods as well, I gave it a try for the FT2 backend today.
> I'm wondering however what is the purpose of these fields. I 
> could not find any code in GTK/GDK using the fields, so if you 
> could give me a usage example, I could assure that I'm doing 
> the right thing before I commit the changes.
> 

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.

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

pangox.c is composing one font out of a bunch of subfonts, so the way
that it computes this is very suspect and somewhat arbitrary. We'll
probably tune it a bit after trying it out.

Havoc





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