Re: GTK+ with Pango support




erik@netscape.com (Erik van der Poel) writes:

> Owen Taylor wrote:
> > 
> > I hardcoded in 10 instead of the old 12 because the combination of:
> > 
> >  - No scaleable Helvetica with my configuration
> >  - Pango taking resolution into account when choosing fonts
> >  - XFree86 4.0 reporting the real resolution of my screen
> > 
> > Was producing a choice of font on my setup which was rather LARGE.
> > (24 pixel, I think) Just needs some tweaking, and writing the code
> > to set the Pango font in the gtkrc file. I'll probably do that after
> > I get rid of the last vestiges of old-style fonts from GTK+.
> 
> What is Pango doing with the reported screen resolution and the fonts'
> resolutions?

Right now, I'm taking the obvious approach of computing:

 point_size_of_bitmap_font = 

     72 * reported_pixel_size / reported_screen_resolution

When trying to match a requested point size. 

The problems you've mentioned in the past with pixel sizes not
corresponding to the actual design height of the font may
make this a non-optimal solution. Another way to do it would
be:

 point_size_of_bitmap_font = 

    reported_point_size * reported_font_resolution / reported_screen_resolution

I don't know if that would do any better. I do want to try and take
advantage of both 100dpi and 72dpi fonts when both are available
in the font path.

Regards,
                                           Owen



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