Re: GTK+ with Pango support



Owen Taylor wrote:
> 
> 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 think it may be font-dependent. The Adobe fonts may have been
rasterized based on a particular (exact) point size, in which case the
latter may be more appropriate, but the JIS X 0208 fonts are 14, 16 and
24 pixel fonts. They were not rasterized based on a particular point
size and resolution. So for those, the former may be more appropriate.
Mozilla currently uses the former, though we don't always use the
reported screen resolution, since we have a preference value for that.
We call it the logical resolution.

> I do want to try and take
> advantage of both 100dpi and 72dpi fonts when both are available
> in the font path.

I agree. (Minor nit: you meant 75dpi, I think.)

Erik



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