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 596394 - vertical glitches with panel
vertical glitches with panel
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2009-09-26 02:13 UTC by Behdad Esfahbod
Modified: 2018-05-22 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for pango-context.c, pango-gravity.c, pango-item.h, pangocairo-render.c, shape.c (10.33 KB, patch)
2009-10-13 10:47 UTC, Takao Fujiwara
none Details | Review
Patch for basic-fc.c, pango-context.c, pango-gravity.c, pango-item.h, pango-renderer.c, pangocairo-render.c, shape.c (12.30 KB, patch)
2009-10-14 06:09 UTC, Takao Fujiwara
none Details | Review
Patch with new PANGO_GRAVITY_VERTICAL (17.73 KB, patch)
2009-10-26 03:29 UTC, Takao Fujiwara
rejected Details | Review
Example program for the vertical mode. (2.15 KB, text/plain)
2009-10-26 03:33 UTC, Takao Fujiwara
  Details

Description Behdad Esfahbod 2009-09-26 02:13:19 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.
Comment 1 Takanori MATSUURA 2009-09-28 01:48:04 UTC
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>
Comment 2 Jens Petersen 2009-10-06 03:12:37 UTC
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.
Comment 3 Takao Fujiwara 2009-10-06 05:00:56 UTC
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().
Comment 4 Takao Fujiwara 2009-10-06 05:04:00 UTC
Correction:

> but the icons have the east gravity on English locales.

but the icons have the west gravity on English locales.
Comment 5 Takao Fujiwara 2009-10-13 10:47:28 UTC
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.
Comment 6 Takao Fujiwara 2009-10-14 06:09:10 UTC
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.
Comment 7 Behdad Esfahbod 2009-10-22 19:33:20 UTC
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.
Comment 8 Takao Fujiwara 2009-10-26 03:29:04 UTC
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.
Comment 9 Takao Fujiwara 2009-10-26 03:33:06 UTC
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.
Comment 10 GNOME Infrastructure Team 2018-05-22 12:53:12 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/163.