Re: patch -- fix resolution in pango (win32 backend)



Joaquín Cuenca Abela <cuenca pacaterie u-psud fr> writes:

> This patch fixes the resolution calculation in pango
> (for the win32 backend).
> 
> With the old resolution, when you ask for a font of
> size 12, pango used a font of ~7.5 points.

[ Note that the best thing to do with patches is to attach
  them to a bug report on bugzilla.gnome.org so they don't
  get lost. ]

I'm afraid something happened to your attachment and it is no longer
well-formed, and a bit hard to make it out.

Maybe Tor can figure figure it out though, since he's more familiar
with the Win32 API.

Can you also explain the change a bit more?

Regards,
                                        Owen

> Index: pango/pangowin32-fontmap.c
> ===================================================================
> RCS file: /cvs/gnome/pango/pango/pangowin32-fontmap.c,v
> retrieving revision 1.30
> diff -u -r1.30 pangowin32-fontmap.c
> --- pango/pangowin32-fontmap.c 1 Jan 2002 23:54:41 -0000 1.30
> +++ pango/pangowin32-fontmap.c 28 Apr 2002 20:36:40 -0000
> @@ -266,9 +266,7 @@
> #endif
> 
> SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
> - fontmap->resolution =
> - (PANGO_SCALE * 72.27 / 25.4) * ((double) GetDeviceCaps (pango_win32_hdc,
> HORZSIZE) /
> - (rect.right - rect.left));
> + fontmap->resolution = PANGO_SCALE / GetDeviceCaps(pango_win32_hdc,
> LOGPIXELSY) * 72.0;
> 
> return PANGO_FONT_MAP (fontmap);
> }
> @@ -911,7 +909,7 @@
> /* OK, we have a match; let's modify it to fit this size */
> 
> *out = *closest_match;
> - out->lfHeight = (int)((double)size / win32fontmap->resolution + 0.5);
> + out->lfHeight = -size / win32fontmap->resolution;
> out->lfWidth = 0;
> }
> else



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