]> Pileus Git - ~andy/gtk/commitdiff
Fix string measurement code. For now, the rbearing is set to the same as
authorTor Lillqvist <tml@iki.fi>
Mon, 6 Dec 1999 23:48:08 +0000 (23:48 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Mon, 6 Dec 1999 23:48:08 +0000 (23:48 +0000)
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.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkfont-win32.c

index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 39d6311425b02171702cd40e28ec66810727cee4..7fbb7f21ee4056efddde5b9f06b82d68feeeceec 100644 (file)
@@ -1,11 +1,17 @@
+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.
index 1174b0d089b9655fb877bd702f406d67fd5e1828..e64c3f95d283e526adb1a599dad03e7fc3598c0b 100644 (file)
@@ -1734,7 +1734,6 @@ gdk_wchar_text_handle (GdkFont       *font,
 typedef struct
 {
   SIZE total;
-  SIZE max;
 } gdk_text_size_arg;
 
 static void
@@ -1759,9 +1758,7 @@ gdk_text_size_handler (GdkWin32SingleFont *singlefont,
   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
@@ -1800,7 +1797,6 @@ gdk_text_width (GdkFont      *font,
   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;
@@ -1835,7 +1831,6 @@ gdk_text_width_wc (GdkFont          *font,
     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);
@@ -1881,7 +1876,6 @@ gdk_text_extents (GdkFont     *font,
   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)
@@ -1895,11 +1889,12 @@ gdk_text_extents (GdkFont     *font,
   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;
 }
@@ -1948,7 +1943,6 @@ gdk_text_extents_wc (GdkFont        *font,
     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);
@@ -1960,11 +1954,11 @@ gdk_text_extents_wc (GdkFont        *font,
   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;
 }