summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2000-11-29 13:49:37 +0000
committerAlexander Larsson <alexl@src.gnome.org>2000-11-29 13:49:37 +0000
commitb1b6c9fc7af328101fb7664e2c36d7116697ba92 (patch)
tree41e1fbc5bde4a57706240924d99317285fcaa246
parent696d0bc1b0cf64bce68a78a227fe5d29abdbb3ea (diff)
downloadgtk+-b1b6c9fc7af328101fb7664e2c36d7116697ba92.tar.gz
Set the size of the font from the description. (gdk_text_width): Gross
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.
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.pre-2-010
-rw-r--r--ChangeLog.pre-2-1010
-rw-r--r--ChangeLog.pre-2-210
-rw-r--r--ChangeLog.pre-2-410
-rw-r--r--ChangeLog.pre-2-610
-rw-r--r--ChangeLog.pre-2-810
-rw-r--r--gdk/linux-fb/gdkfont-fb.c10
-rw-r--r--gdk/linux-fb/gdkprivate-fb.h4
9 files changed, 79 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b2087a94d..19ed57fc3c 100644
--- 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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 3b2087a94d..19ed57fc3c 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -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
diff --git a/gdk/linux-fb/gdkfont-fb.c b/gdk/linux-fb/gdkfont-fb.c
index a156234d32..5fc17a7eb0 100644
--- a/gdk/linux-fb/gdkfont-fb.c
+++ b/gdk/linux-fb/gdkfont-fb.c
@@ -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
}
diff --git a/gdk/linux-fb/gdkprivate-fb.h b/gdk/linux-fb/gdkprivate-fb.h
index a7761b1afe..ddf82c7164 100644
--- a/gdk/linux-fb/gdkprivate-fb.h
+++ b/gdk/linux-fb/gdkprivate-fb.h
@@ -147,9 +147,7 @@ typedef struct {
typedef struct {
GdkFontPrivate base;
-
- FT_Face face;
- double size;
+ int size;
} GdkFontPrivateFB;
void gdk_fb_font_init(void);