GNOME Bugzilla – Bug 596394
vertical glitches with panel
Last modified: 2018-05-22 12:53:12 UTC
Need to think about what the recommended way to set rotated text is. Currently we recommend gravity=auto, but I think that's not quite what we mean. May need a new GravityHint value.
Section 2.3.2.b and 3.2.[3-6] in the document of "Requirements for Japanese Text Layout" may help to understand the vertical layout (at least) in Japanese. http://www.w3.org/TR/jlreq/ In case of clock applet in vertical side bar, we need to consider which side is up and down in the display. This means that vertical clock should be shown as the following in any case the side bar exists at right or left side. (<> means to set rotated 90 degrees clockwise in vertical writing mode) 9 月 24 日 <13:53:34> or 9 月 24 日 午 後 <1:53:34>
I think the gnome-panel case is rather a special and untypical use of vertical text which is rather hard. See also my comments https://bugzilla.redhat.com/show_bug.cgi?id=525371#c16 I guess this bug should track general issues with vertical text not specific to gnome-panel applets.
I'd like to clarify one point. Currently icon is vertical in any orientations. E.g. In the left orientation on panel, the latin script has PANGO_GRAVITY_SOUTH gravity but the icons have the east gravity on English locales. Is it the expected result? If it's expected, the vertical text is better for Japanese. But generally speaking, we want the both horizontal rotated text and the vertical text for Japanese. So probably we may want another API likes gtk_label_set_vertical() besides gtk_label_set_angle().
Correction: > but the icons have the east gravity on English locales. but the icons have the west gravity on English locales.
Created attachment 145341 [details] [review] Patch for pango-context.c, pango-gravity.c, pango-item.h, pangocairo-render.c, shape.c This is an idea to put the vertical string. I tried to put the two digit number with vertical but cairo_show_glyphs() shows one char only. Do you have any ideas about the y_position values? To close the parentheses, the gravity needs to follow the PANGO_LATIN_SCRIPT. I modified width_iter_next() to get the two digit numbers. I think this is still an idea and after this can be implemented, I like to create a new API likes gtk_label_set_vertical() besides gtk_label_set_angle() for CJK horitontal text.
Created attachment 145397 [details] [review] Patch for basic-fc.c, pango-context.c, pango-gravity.c, pango-item.h, pango-renderer.c, pangocairo-render.c, shape.c Revised the patch. I mistook +/- values. I put cairo_glyph_extents() to get the height of vertical numbers. But the space between the vertical digits is too wide with my patch. It might be good to change the font matrix instead of the vertical numbers.
Not sure what the patch attached is about. I discussed this with fantasai, seems like we need more API for this to work properly. I need to go back to the design board and see what's missing.
Created attachment 146238 [details] [review] Patch with new PANGO_GRAVITY_VERTICAL This is the another idea to put the string with vertical mode. attachment 145397 [details] [review] means to always put Japanese strings with vertical mode when the gravity is west or east. But i'd like to separate the features of vertical and rotate. This attachment has a new gravity PANGO_GRAVITY_VERTICAL. It means we call pango_context_set_base_gravity(context, PANGO_GRAVITY_VERTICAL) to put the Japanese strings with vertical and not call gtk_label_set_angle(). Currently panel applets calls pango_context_set_base_gravity(context, PANGO_GRAVITY_AUTO) and if angle is 90 or 270, Japanese text is the rotated vertical mode. But I think it's better to put Japanese strings with horizontal mode on panel. The vertical mode implements: - If alphabet or number has less than or equal to two chars, put the strings in horizontal mode in one cell. - If alphabet or number has greeter than three chars, put the strings with rotated horizontal mode. (it's same ASCII gravity on panel with 90/270 degree) - If brackets are shown, put the char with rotated horizontal mode. - If others(e.g. Japanese Hiragana/Kanakana scripts) are shown, put the strings with vertical mode. (It put one char only per one cell). One cell is constructed by "two columns x one line" which can include two narrow chars or one wide chars. I'm also attaching the example program.
Created attachment 146239 [details] Example program for the vertical mode. The attachment is the example program to show the vertical text on Japanese locale. My attachment 146238 [details] [review] adds PANGO_GRAVITY_VERTICAL gravity for the vertical mode. If we put the strings with the vertical mode, the angle is 0.
-- 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/163.