+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
+1999-12-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
+ the rbearing is set to the same as the width, but this should be
+ fixed.
+
1999-12-06 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
- function. Guesstimate what Unicode subranges a font covers based
- on the codepages. Windows tells us it covers. This will hopefully
- help those Windows versions or fonts that don't give us any useful
- Unicode subrange information with GetTextCharsetInfo. Call this
- function in gdk_font_load_internal.
+ function. If Windows doesn't tell us what Unicode subranges a font
+ covers, guesstimate based on the codepages it covers. This will
+ hopefully help those Windows versions or fonts that don't give us
+ any useful Unicode subrange information with GetTextCharsetInfo.
+ Call this function in gdk_font_load_internal.
* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
typedef struct
{
SIZE total;
- SIZE max;
} gdk_text_size_arg;
static void
SelectObject (gdk_DC, oldfont);
arg->total.cx += this_size.cx;
- arg->total.cy += this_size.cy;
- arg->max.cx = MAX (this_size.cx, arg->max.cx);
- arg->max.cy = MAX (this_size.cy, arg->max.cy);
+ arg->total.cy = MAX (arg->total.cy, this_size.cy);
}
static gboolean
gdk_text_size_arg arg;
arg.total.cx = arg.total.cy = 0;
- arg.max.cx = arg.max.cy = 0;
if (!gdk_text_size (font, text, text_length, &arg))
return -1;
wcstr = (wchar_t *) text;
arg.total.cx = arg.total.cy = 0;
- arg.max.cx = arg.max.cy = 0;
gdk_wchar_text_handle (font, wcstr, text_length,
gdk_text_size_handler, &arg);
g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
arg.total.cx = arg.total.cy = 0;
- arg.max.cx = arg.max.cy = 0;
wcstr = g_new (wchar_t, text_length);
if ((wlen = gdk_nmbstowchar_ts (wcstr, text, text_length, text_length)) == -1)
if (lbearing)
*lbearing = 0;
if (rbearing)
- *rbearing = 0;
+ *rbearing = arg.total.cx;
+ /* What should be the difference between width and rbearing? */
if (width)
*width = arg.total.cx;
if (ascent)
- *ascent = arg.max.cy + 1;
+ *ascent = arg.total.cy + 1;
if (descent)
*descent = font->descent + 1;
}
wcstr = (wchar_t *) text;
arg.total.cx = arg.total.cy = 0;
- arg.max.cx = arg.max.cy = 0;
gdk_wchar_text_handle (font, wcstr, text_length,
gdk_text_size_handler, &arg);
if (lbearing)
*lbearing = 0;
if (rbearing)
- *rbearing = 0;
+ *rbearing = arg.total.cx;
if (width)
*width = arg.total.cx;
if (ascent)
- *ascent = arg.max.cy + 1;
+ *ascent = arg.total.cy + 1;
if (descent)
*descent = font->descent + 1;
}