]> Pileus Git - ~andy/gtk/commitdiff
Set the size of the font from the description. (gdk_text_width): Gross
authorAlexander Larsson <alexl@redhat.com>
Wed, 29 Nov 2000 13:49:37 +0000 (13:49 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Wed, 29 Nov 2000 13:49:37 +0000 (13:49 +0000)
2000-11-29  Alexander Larsson  <alexl@redhat.com>

* gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
Set the size of the font from the description.
(gdk_text_width): Gross hack that calculates the width
of text by text_length * size/2. This is necessary because
GtkLabel does some ugly gtk_string_width call to calculate
an good size.
(linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.

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/linux-fb/gdkfont-fb.c
gdk/linux-fb/gdkprivate-fb.h

index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index 3b2087a94d067a3470c2dfb4a3dd955f34e3b7d6..19ed57fc3cd4668030112cfe44559d9249f0464e 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-29  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
+       Set the size of the font from the description.
+       (gdk_text_width): Gross hack that calculates the width
+       of text by text_length * size/2. This is necessary because
+       GtkLabel does some ugly gtk_string_width call to calculate
+       an good size.
+       (linux-fb/gdkprivate-fb.h): Removed unused field FT_Face.
+
 Wed Nov 29 13:39:19 GMT 2000  Tony Gale <gale@gtk.org>
 
        * docs/tutorial/gtk-tut.sgml: DND updates
index a156234d325a6eb0c2c92822aa11dd7faef74fc0..5fc17a7eb02eaf0f1604a4c66664ea926eb73651 100644 (file)
@@ -48,8 +48,10 @@ gdk_font_from_description (PangoFontDescription *font_desc)
 
   private = g_new0 (GdkFontPrivateFB, 1);
   font = (GdkFont *)private;
+  font->type = GDK_FONT_FONT;
+  private->size = font_desc->size;
   private->base.ref_count = 1;
-
+  
   return font;
 }
 
@@ -294,7 +296,11 @@ gdk_text_width (GdkFont      *font,
 
   return width;
 #else
-  return 0;
+  GdkFontPrivateFB *private;
+
+  private = (GdkFontPrivateFB*) font;
+  
+  return text_length * private->size / (PANGO_SCALE/2);
 #endif
 }
 
index a7761b1afee35b0fb69b0ae13cb3226ba397abbc..ddf82c7164de8fb2a7ccb1312701268cec579a74 100644 (file)
@@ -147,9 +147,7 @@ typedef struct {
 
 typedef struct {
   GdkFontPrivate base;
-
-  FT_Face face;
-  double size;
+  int size;
 } GdkFontPrivateFB;
 
 void gdk_fb_font_init(void);