Re: fonts in gtk-2.0/pango



Hi,

Allin Cottrell <cottrell wfu edu> writes:

> (1) The pango font metrics apparatus fails to return correct metrics
> for a known monospaced font (e.g. Lucida Typewriter).  The only
> function for getting the width of a character directly (i.e. short of
> creating a pango layout and measuring its size in pixels) is the
> "approximate" char_width function.  In the Lucida Typewriter case,
> where no "approximation" is called for since every glyph has the exact
> same width, the value returned is out by 14 percent (8 instead of the
> correct 7 pixel width on my system).  This is just not good enough,
> for purposes such as sizing windows that are to hold a given length of
> line in monospaced characters.  It is a marked regression from the old
> GdkFont mechanism, which gave accurate metrics with a single function
> call.

please note that pango_font_metrics_get_approximate_char_width()
returns the approximate glyph advance, not the approximate glyph
width. The function is probably badly named but it seems that the
return value is reasonable if you take this into consideration.


Salut, Sveb



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