Re: Xft digit width
- From: Owen Taylor <otaylor redhat com>
- To: Alexander Larsson <alla lysator liu se>
- Cc: <gtk-devel-list gnome org>
- Subject: Re: Xft digit width
- Date: 20 Apr 2001 12:46:46 -0400
Alexander Larsson <alla lysator liu se> writes:
> This patch is needed to make with width of GtkSpinButtons sane when using
> Xft fonts. It is not perfect, but better than nothing. Can i commit it?
Hmmm, well, I think it is possible to do a lot better than
this. (Especially for the digit part, where "simply" shaping
0123456789 and dividing the width by ten should work pretty well.)
But if you file a bug report to do it right, I guess this is better
than nothing
Regards,
Owen
> Index: pangoxft-font.c
> ===================================================================
> RCS file: /cvs/gnome/pango/pango/pangoxft-font.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 pangoxft-font.c
> --- pangoxft-font.c 2000/12/20 04:41:35 1.4
> +++ pangoxft-font.c 2001/04/20 15:42:51
> @@ -289,6 +289,8 @@ pango_xft_font_get_metrics (PangoFont
>
> metrics->ascent = PANGO_SCALE * xfont->xft_font->ascent;
> metrics->descent = PANGO_SCALE * xfont->xft_font->descent;
> + metrics->approximate_digit_width = PANGO_SCALE * xfont->xft_font->max_advance_width;
> + metrics->approximate_char_width = PANGO_SCALE * xfont->xft_font->max_advance_width;
>
> return;
> }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]