After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549729 - Ellipsize set of strings to fit in X space while preserving uniqueness if possible
Ellipsize set of strings to fit in X space while preserving uniqueness if pos...
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2008-08-28 17:10 UTC by Matthew Paul Thomas (mpt)
Modified: 2018-05-22 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Paul Thomas (mpt) 2008-08-28 17:10:36 UTC
There are many cases where a set of strings needs to be ellipsized to fit into graphical interface elements of a consistent size, but it is important that similar strings remain visually distinct.

For example, Web pages in your browser history often have quite similar titles. Sometimes the distinctive part is near the beginning (e.g. "Setting an environment variable for all your apps » as days pass by, by Stuart Langridge"), sometimes it is near the end (e.g. "Rodrigo Moya » Blog Archive » Olympics over"), and sometimes it is near the middle (e.g. "Photos: The ultramobiles of IDF - UMPC-benq image - CNET News"). When these titles are presented in a Web browser's Go/History menu, none of Pango's existing ellipsization options -- PANGO_ELLIPSIZE_UNIQUE_START, PANGO_ELLIPSIZE_MIDDLE, or PANGO_ELLIPSIZE_UNIQUE_END -- will result in unique menu items as often as they could.

Other examples of this problem include:
* Nautilus's icon view <http://blogs.gnome.org/cneumair/2008/08/16/before-after>
* the Name column in Nautilus's list view
* the Subject column in a mail program's message list
* Pidgin's Accounts menu <http://developer.pidgin.im/ticket/6824#comment:3>
* the recent files listed in Totem's "Movie" menu
* a window manager's title bars
* gnome-panel's window list buttons (bug 99604).

For the last example, in bug 99604 comment 7, I devised an algorithm that would produce unique ellipsized names more often than the existing ellipsization options would. The same algorithm could be applied to all these cases, and it is a little tricky to implement, so I suggest it be made available in GTK.

If it was fast enough, the algorithm could even be applied to all GTK menus by default. Most menu items wouldn't change, but very long ones would be ellipsized in a useful way without any programmer effort.
Comment 1 Matthew Paul Thomas (mpt) 2008-08-28 17:12:16 UTC
See also bug 147608.

Thanks to Johan Dahlin for technical advice on this report.
Comment 2 GNOME Infrastructure Team 2018-05-22 12:43:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/140.