GNOME Bugzilla – Bug 614343
titlebar's border get displaced in Indic locale, when titlebar in ascii text
Last modified: 2010-05-18 02:10:31 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.
Created attachment 157462 [details] Problem screen shot I marked the problem with red pen.
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.
the patch doesn't apply at all.
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.
Is it ok to commit the patch?
Please do.
Talked @gnome-art. Committed the patch.