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 614343 - titlebar's border get displaced in Indic locale, when titlebar in ascii text
titlebar's border get displaced in Indic locale, when titlebar in ascii text
Status: RESOLVED FIXED
Product: gnome-themes
Classification: Deprecated
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Themes Maintainers
GNOME Themes Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-30 10:26 UTC by Takao Fujiwara
Modified: 2010-05-18 02:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case "test.py" (209 bytes, application/octet-stream)
2010-03-30 10:26 UTC, Takao Fujiwara
  Details
Problem screen shot (4.07 KB, image/png)
2010-03-30 10:27 UTC, Takao Fujiwara
  Details
Patch for gnome-themes Clearlooks/metacity-theme-1.xml (25.79 KB, patch)
2010-03-30 10:44 UTC, Takao Fujiwara
none Details | Review

Description Takao Fujiwara 2010-03-30 10:26:13 UTC
Created attachment 157460 [details]
Test case "test.py"

If metacity run with Clearlooks theme, application title bar get displaced with an Indic font which has the long ascent and descent.

To reproduce:
1. Install "Lohit Kannada" font and the font config in /etc/fonts/conf.d
https://fedorahosted.org/releases/l/o/lohit/lohit-kannada-ttf-2.4.5.tar.gz
http://svn.fedorahosted.org/svn/lohit/trunk/kannada/66-lohit-kannada.conf
https://fedorahosted.org/lohit/

The Sans default font is "Lohit Kannada".
Probably DejaVu also could be configured.

# fc-match sans:lang=kn
Lohit-Kannada.ttf: "Lohit Kannada" "Regular"

2. Run the attached test.py on kn_IN.utf8
(If you don't have kn_IN.utf8, probably you could customize 66-lohit-kannada.conf above.)

Then metacity title bar get displaced with Clearlooks theme.
Some other themes doesn't have this problem.

I'm also attaching the screen shot and the suggested fix.
Comment 1 Takao Fujiwara 2010-03-30 10:27:24 UTC
Created attachment 157462 [details]
Problem screen shot

I marked the problem with red pen.
Comment 2 Takao Fujiwara 2010-03-30 10:44:12 UTC
Created attachment 157464 [details] [review]
Patch for gnome-themes Clearlooks/metacity-theme-1.xml

The Clearlooks theme sets the height of the metacity title bar is 'title_height + 6'

The title_height value is calculated by pango_layout_get_pixel_extents() in metacity meta_frame_style_draw_with_style().

meta_frame_style_draw_with_style ()
{
    pango_layout_get_pixel_extents (title_layout,
                                    NULL, &extents);

  draw_info.title_layout_height = title_layout ? extents.height : 0;
}


But the top_height value is calculated by text_height + title_border.top + title_border.bottom.

meta_frame_layout_get_borders ()
{
  buttons_height = layout->button_height +
    layout->button_border.top + layout->button_border.bottom;
  title_height = text_height +
    layout->title_vertical_pad +
    layout->title_border.top + layout->title_border.bottom;

  if (top_height)
    {
      *top_height = MAX (buttons_height, title_height);
    }
}

title_border.top and title_border.bottom is extracted by Clearlook metacity-theme-1.xml:
        <border name="title_border" left="2" right="2" top="4" bottom="3"/>


The text_height value is calculated by pango_context_get_metrics().

meta_pango_font_desc_get_text_height ()
{
  lang = pango_context_get_language (context);
  metrics = pango_context_get_metrics (context, font_desc, lang);

  retval = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
                         pango_font_metrics_get_descent (metrics));

}

So I think using top_height make sense to draw the title bar and this suggestion can resolve this problem.
metacity fill_env() doesn't use info->fgeom->bottom_titlebar_edge so my suggestion is to use "top_height - 2".

Probably I think the higher metacity title bar value is better than narrowing the title height.

I'm attaching the patch.
Comment 3 Matthias Clasen 2010-04-06 13:19:06 UTC
the patch doesn't apply at all.
Comment 4 Takao Fujiwara 2010-04-08 20:45:28 UTC
Could you review the patch?


(In reply to comment #3)
> the patch doesn't apply at all.

The problem was fixed when we talked off line.
Comment 5 Takao Fujiwara 2010-04-20 14:06:53 UTC
Is it ok to commit the patch?
Comment 6 Matthias Clasen 2010-05-16 00:25:07 UTC
Please do.
Comment 7 Takao Fujiwara 2010-05-18 02:10:31 UTC
Talked @gnome-art.
Committed the patch.