Tooltip text not vertically centered

Bug #697791 reported by appi2012 on 2011-01-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Low
Mirco Müller
unity (Ubuntu)
Low
Unassigned

Bug Description

The text on the tooltips on the launchers is not really centered vertically. It seemed too high, and that bothered me. As you can see from the attached picture, there the tooltip is of a height in which it is impossible to center the text: there are 8 pixels between the bottom of the text to the edge of the tooltip, and 7 on the top.

This is a small issue, but can easily be fixed by making the text 1px taller or by increasing the tooltip size by 1 px (this might disrupt the pointer)

Related branches

Didier Roche (didrocks) wrote :

Thanks for your bug report and help to make ubuntu better.
Not sure it's really a bitesize bugs as it may involve shaders, but still ask on #ayatana for help if you want to catch this.

tags: added: bitesize
Changed in unity:
status: New → Triaged
importance: Undecided → Low
Changed in unity (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Mirco Müller (macslow) wrote :

It should be a wrong padding-value and simple to fix.

Changed in unity:
status: Triaged → Confirmed
assignee: nobody → Mirco Müller (macslow)
milestone: none → 3.4
Mirco Müller (macslow) on 2011-01-06
Changed in unity:
status: Confirmed → In Progress
Paul Sladen (sladen) wrote :

Retesting on Unity-compiz (3.2.8-0ubuntu1) I don't see this. I see 8 pixels above/below the Latin baseline and cap-height, giving 5 pixels below the descender tails and 6 pixels above the ascenders.

Mirco Müller (macslow) on 2011-01-06
Changed in unity:
status: In Progress → Fix Committed
Paul Sladen (sladen) wrote :

macslow: I remain unconvinced that the fix is as appropriate or simple as perceived; where's another screenshot taken with a much larger-sized font settings (32pt, still 96dpi). In this case the baseline has 12 pixels below and 14 pixels above the cap-height, which 4 pixels below the descenders and 11 above the ascenders.

It's far more likely that the error (in indeed this is any) is being introduced from hinting or rounding, and if so shifting it at the drawing stage with a heavy one-pixel hammer may not actually solve things across the board.

Mirco Müller (macslow) wrote :

See the attached screenshot for the appearance of the fixed text-position in the tooltip.

Mirco Müller (macslow) wrote :

Here's another example with decenders.

Didier Roche (didrocks) on 2011-01-14
Changed in unity:
status: Fix Committed → Fix Released
milestone: 3.4 → 3.2.12
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 3.2.12-0ubuntu1

---------------
unity (3.2.12-0ubuntu1) natty; urgency=low

  * New upstream release.
   - Window border doesn't get restored (LP: #691812)
   - When a menu is triggered from Alt+key, app name stays visible on panel
     (LP: #691765)
   - show the launcher on <Super> KeyPress, this will be needed when the
     shortcut will be implemented if we are in intellihide mode
   - Make sure an underscore is correctly placed under the corresponding
     accelerator-key. (LP: #683427)
   - Adding a dummy --replace option for compatibility reason (LP: #692569)
   - Compiz crashed with SIGSEGV in CompWindow::id() (LP: #694945)
   - Tooltip text not vertically centered (LP: #697791)
   - Maximizing a window horizontally or vertically removes the title bar
     (LP: #696780)
   - Mousewheel support for indicators (LP: #681428)
   - Avoid Quicklists being positioned so that they are partially offscreen at
     the bottom screen-edge. (LP: #691114)
   - Migrate awn, docky and cairo-dock dock launchers (LP: #692967)
   - Include manpages, and make them translatable. (LP: #684896)
   - Automaximize windows in Unity with some rules like blacklisting some
     applications, initial window size.
     It fixes also some bugs, like maximized window on first map not
     undecorated (LP: #667009, #669716, #693779, #691741)
   - Update libunity to conform to latest GIO VAPI breakage (LP: #679964)
   - Initial unity-atk module implementation (LP: #701680)
   - Panel autohide when on Quicklist (LP: #683261)
  * debian/control:
    - unity breaks on older bamf version (dbus protocol changed)
    - needs latest and greatest from dee
    - add libatk1.0-dev build-dep
  * CMakeList:
    - distro-patch to avoid building tests right now as building them is failing
      with the current vala/gir stack. THIS NEED TO BE REMOVED.
  * debian/rules:
    - don't --fail-missing as we don't want to install the vapi yet. The gir
      package will come next week.
  * debian/unity-common.install:
    - install the manpages
  * debian/libunity3.symbols:
    - updated
 -- Didier Roche <email address hidden> Fri, 14 Jan 2011 20:47:25 +0100

Changed in unity (Ubuntu):
status: Triaged → Fix Released
Mirco Müller (macslow) wrote :

We need to reopen this bug, as on some people's systems the fix for this does lead to clipped text. See the attached screenshot.

Changed in unity:
status: Fix Released → Confirmed
Changed in unity (Ubuntu):
status: Fix Released → Confirmed
Jay Taoko (jaytaoko) wrote :

The way the pixel count is done is not accurate. The original submitter of the bug is counting the pixels starting from the upper part of the tooltip that looks darker and counts down to the upper pixel of the text. The same thing is done below in revert. However, this is not the real extent of the text. We use Pango to render the text and retrieve a texture with Cairo. The background of the tooltip is rendered with cairo and then processed through a filtering algorithm to produce the smooth soft shadow. So the real outline of the texture returned by Pango/Cairo is not visible in the tooltip and counting pixels like it is done above is not accurate.
We place the text texture inside the tooltip is like this: vertically, the text texture is in the center inside the tooltip rectangle. Invariably, there is going to be at most one pixel off depending on the height of the text texture and the height of the tooltip. Theses heights can be even or odd. Added to that, Pango rendering is affected by the hinting and other factors.
The fix that was done for this bug as been reverted as it causes an even more serious problem.
Looking at the tooltip, I don't see an issue with the rendering of the text but the nature of the method we use can cause an offset of 1 pixel. We could improve on that but we need more inputs for an appropriate solution.

Neil J. Patel (njpatel) on 2011-01-18
Changed in unity:
status: Confirmed → Fix Released
Changed in unity (Ubuntu):
status: Confirmed → Fix Released
avaddon (alexandr-domrachev) wrote :

When using small font, this misalignment is TOO noticeable. Looks ugly.

@avaddon: are you using a complete updated system?

avaddon (alexandr-domrachev) wrote :

Yes

Because it yet affects some people, I'm reopening this bug.

Well, I'm not reopening it because I can't. But it must be reopened.

Omer Akram (om26er) wrote :

opening a new bug report would be more appropriate.

On Fri, Feb 4, 2011 at 6:34 PM, Marco Biscaro <email address hidden>wrote:

> Well, I'm not reopening it because I can't. But it must be reopened.
>
> --
> You received this bug notification because you are subscribed to unity
> in ubuntu.
> https://bugs.launchpad.net/bugs/697791
>
> Title:
> Tooltip text not vertically centered
>
> Status in Unity:
> Fix Released
> Status in “unity” package in Ubuntu:
> Fix Released
>
> Bug description:
> The text on the tooltips on the launchers is not really centered
> vertically. It seemed too high, and that bothered me. As you can see
> from the attached picture, there the tooltip is of a height in which
> it is impossible to center the text: there are 8 pixels between the
> bottom of the text to the edge of the tooltip, and 7 on the top.
>
> This is a small issue, but can easily be fixed by making the text 1px
> taller or by increasing the tooltip size by 1 px (this might disrupt
> the pointer)
>
>
>

avaddon (alexandr-domrachev) wrote :

Ok, I'll make a new bug report then.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers