Bug 8772

Summary: improved text shaping for GNOME desktop icons
Product: [Retired] Red Hat Linux Reporter: jaboydjr
Component: mcAssignee: Jonathan Blandford <jrb>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ddumas, jaboydjr
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-03 18:44:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
text shaping patch for mc-4.5.42 none

Description jaboydjr 2000-01-23 17:04:43 UTC
I'm sending you a patch against mc-4.5.42 that uses a simple outlining
technique to improve the readability of desktop icons using shaped text.
To use it, edit .mc/ini (for a user) and set "desktop_use_shaped_text=2",
forexample.  I'm sure you can figure it out from the patch; if not; email
me and I'll describe it more fully.

I've submitted this already to the mc maintainers, but frankly, I'm also
submitting it to RH because I know you might use it before they do; I'd
like to see shaped text the default, so I'm hoping you like it and use
it in your next release (so I don't have to keep doing this patch myself).

By the way, folks... I'm an original Linux kernel contributor.  Other
distributors send free copies of their distributions to me, but as far as
I can remember, you've never done that.  Is that true?  I'm not
complaining, and I don't want a free copy; I'm just wondering...

-john

(patch follows)

diff -u mc-4.5.42-orig/gnome/gdesktop-icon.c
mc-4.5.42/gnome/gdesktop-icon.c
--- mc-4.5.42-orig/gnome/gdesktop-icon.c	Mon Dec  6 18:50:04 1999
+++ mc-4.5.42/gnome/gdesktop-icon.c	Fri Jan 21 15:40:01 2000
@@ -332,13 +332,16 @@
 	/* Fill the area for the text */

  	i = GNOME_ICON_TEXT_ITEM (dicon->text);
-	if (desktop_use_shaped_text && !i->editing && !i->selected)
-		gnome_icon_paint_text (i->ti,
-				       mask, mgc,
-				       dicon->text_x + 2,
-				       dicon->text_y + 2,
-				       GTK_JUSTIFY_CENTER);
-	else
+	if ((desktop_use_shaped_text > 0) && !i->editing && !i->selected) {
+	    int ox,oy, dust = desktop_use_shaped_text-1;
+	    for (ox = -(dust);  ox <= dust;  ox++)
+		for (oy = -(dust);  oy <= dust;  oy++)
+		    gnome_icon_paint_text (i->ti,
+					   mask, mgc,
+					   dicon->text_x + ox + 2,
+					   dicon->text_y + oy + 2,
+					   GTK_JUSTIFY_CENTER);
+	} else
 		gdk_draw_rectangle (mask, mgc, TRUE,
 				    dicon->text_x,
 				    dicon->text_y,
@@ -451,7 +454,7 @@

 	gnome_icon_text_item_select (GNOME_ICON_TEXT_ITEM (dicon->text), sel);

-	if (desktop_use_shaped_text)
+	if (desktop_use_shaped_text > 0)
 		desktop_icon_reshape (dicon);

 	if (sel)
diff -u mc-4.5.42-orig/gnome/gdesktop-icon.h
mc-4.5.42/gnome/gdesktop-icon.h
--- mc-4.5.42-orig/gnome/gdesktop-icon.h	Mon Dec  6 18:50:05 1999
+++ mc-4.5.42/gnome/gdesktop-icon.h	Sat Jan 22 10:21:16 2000
@@ -16,8 +16,9 @@
 BEGIN_GNOME_DECLS


-#define DESKTOP_ICON_FONT
"-*-helvetica-medium-r-normal--10-*-*-*-p-*-*-*," \
-			"-*-*-medium-r-normal-*-10-*-*-*-*-*-*-*,*"
+#define DESKTOP_ICON_FONT \
+     "-*-helvetica-bold-r-normal--10-*-*-*-p-*-*-*," \
+     "-*-*-bold-r-normal-*-10-*-*-*-*-*-*-*,*"


 #define TYPE_DESKTOP_ICON            (desktop_icon_get_type ())
diff -u mc-4.5.42-orig/gnome/gdesktop.c mc-4.5.42/gnome/gdesktop.c
--- mc-4.5.42-orig/gnome/gdesktop.c	Mon Dec  6 18:50:04 1999
+++ mc-4.5.42/gnome/gdesktop.c	Fri Jan 21 15:10:48 2000
@@ -43,7 +43,7 @@
 /* Configuration options for the desktop */

 int desktop_use_shaped_icons = TRUE;
-int desktop_use_shaped_text = FALSE;
+int desktop_use_shaped_text = 0;
 int desktop_auto_placement = FALSE;
 int desktop_snap_icons = FALSE;
 int desktop_arr_r2l = FALSE;
diff -u mc-4.5.42-orig/gnome/gdesktop.h mc-4.5.42/gnome/gdesktop.h
--- mc-4.5.42-orig/gnome/gdesktop.h	Mon Dec  6 18:50:05 1999
+++ mc-4.5.42/gnome/gdesktop.h	Fri Jan 21 15:40:45 2000
@@ -25,7 +25,7 @@
 /* Configuration options for the desktop */

 extern int desktop_use_shaped_icons;	/* Whether to use shaped icons or not
(for slow X servers) */
-extern int desktop_use_shaped_text;     /* Shaped text for the icons on
the desktop */
+extern int desktop_use_shaped_text;     /* Shaped text for the icons on
the desktop: value is outline thickness+1, >= 0, use shaped if >0 */
 extern int desktop_auto_placement;	/* Whether to auto-place icons or not
(user placement) */
 extern int desktop_snap_icons;		/* Whether to snap icons to the grid or
not */
 extern int desktop_arr_r2l; /* Arrange from right to left */

Comment 1 jaboydjr 2000-01-23 17:06:59 UTC
Created attachment 74 [details]
text shaping patch for mc-4.5.42

Comment 2 Jonathan Blandford 2000-02-03 18:44:59 UTC
patch has been pushed upstream to the mc maintainers.  They want to apply it in
a different way then that, and will do so later.  We agreed with them not to
apply it currently is.