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 323173 - Add layout of mixed direction text for vertical layout
Add layout of mixed direction text for vertical layout
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 99523
 
 
Reported: 2005-12-04 02:49 UTC by Maciej Katafiasz
Modified: 2007-01-16 00:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Gravity resolution logic for foreign scripts inlining (9.33 KB, patch)
2006-08-21 07:10 UTC, Maciej Katafiasz
none Details | Review
Cleaned up patch to implement per-item gravity resolution (10.77 KB, patch)
2006-08-21 13:07 UTC, Maciej Katafiasz
none Details | Review
Script directions table (3.93 KB, text/x-csrc)
2006-10-07 15:05 UTC, Maciej Katafiasz
  Details

Description Maciej Katafiasz 2005-12-04 02:49:03 UTC
Splitting bug 99523.

Phase two is adding proper support for more interesting layout, as per Unicode's
tn22. We should be able to correctly layout vertical text, containig mix-ins of
Latin, Arabic, etc., as well as different directionality vertical (Mongolian
with Japanese).

To do that, we need:

1) bug 323172
2) expand bidi algorithm from UAX#9 to cover vertical case (details in tn22).
Will also need adding hints on preferred rotation for natively horizontal text.
3) probably some more hacking to make lines flow work in case of Mongolian
meeting some other vertical script
Comment 1 Behdad Esfahbod 2006-08-21 03:18:04 UTC
I decided to go by not changing the bidi algorithm directly, but patching its result by changing resolved levels afterwards.  The main complexion of this approach is to correctly update line direction, but I think we can handle that too.

I've made per-item gravity work already.  All remaining is to correctly assign gravity to items based on context gravity, script, and gravity hints.
Comment 2 Maciej Katafiasz 2006-08-21 07:10:40 UTC
Created attachment 71275 [details] [review]
Gravity resolution logic for foreign scripts inlining

This is the core logic only, stripped of everything else, so I don't expect it to compile.
Comment 3 Maciej Katafiasz 2006-08-21 13:07:02 UTC
Created attachment 71301 [details] [review]
Cleaned up patch to implement per-item gravity resolution

A cleaned up version, with all comments implemented, should be good to commit
Comment 4 Behdad Esfahbod 2006-08-21 16:09:08 UTC
Thanks mathrick.  Please attach the data table.
Comment 6 Behdad Esfahbod 2006-09-03 05:48:42 UTC
From Ed Trager:

Here's a fragment of Japanese text:

... 衆参両院に特別委員会を設置し、2006年度予算案成立後の月末以降に ...

In tate nake yoko layout,  the section with the year would look like:

  .
  .
  .
  設
  置
  し
  、
2006
  年
  度
  予
  算
  .
  .
  .

As far as I am aware, this is most often used, as shown here, for
printing years.  I would suppose that 2- or 3-digit numbers could also
be layed out this way.  It is probably obvious that the "2006" is
composed of regular width, not full-width characters since one
certainly doesn't want to use up to much space.  Maybe they use a
narrow font for the digits, I don't know.  I'm definitely not a
Japanese expert: we would need to talk to a native Japanese or
Japanese expert to understand how common this is in modern printed
Japanese media compared to the vertical layout option shown on your
blog or compared to simply turning "2006" on its side.
Comment 7 fantasai 2006-09-27 05:11:24 UTC
The effect in Ed's example should require markup. In HTML+CSS, it would be handled by putting an element around the date and turning it into an inline-block; from the paragraph's point of view, that date would be only a box, just like an image.
Comment 8 Behdad Esfahbod 2006-10-02 20:14:17 UTC
(In reply to comment #7)
> The effect in Ed's example should require markup. In HTML+CSS, it would be
> handled by putting an element around the date and turning it into an
> inline-block; from the paragraph's point of view, that date would be only a
> box, just like an image.

Ok, perfect.

Comment 9 Maciej Katafiasz 2006-10-07 15:05:22 UTC
Created attachment 74215 [details]
Script directions table

Looks like I forgot the table. Here it is.
Comment 10 Behdad Esfahbod 2007-01-16 00:25:27 UTC
2007-01-15  Behdad Esfahbod  <behdad@gnome.org>

        Bug 323173 – Add layout of mixed direction text for vertical layout

        * pango/pango-gravity.h:
        * pango/pango-gravity.c:
        Moved gravity stuff here.  New public API:

                PangoGravityHint
                pango_gravity_get_for_matrix()
                pango_gravity_get_for_script()

        * pango/pango-context.h:
        * pango/pango-context.c (pango_context_init),
        (update_resolved_gravity), (itemize_state_update_for_new_run):
        Support gravity hint.  New public API:

                pango_context_set_gravity_hint()
                pango_context_get_gravity_hint()

        * pango/pango-utils.c:
        * pango/pango-matrix.c:
        * pango/pango-matrix.h:
        * pango/pango-types.h:
        Moved gravity and matrix stuff into its own header.  pango-types.h
        includes both pango-matrix.h and pango-gravity.h

        * pango/pango.h:
        Include new headers.

        * pango/pango.def:
        * pango/Makefile.am:
        Update.

        * docs/pango-docs.sgml:
        * docs/pango-sections.txt:
        * docs/tmpl/glyphs.sgml:
        * docs/tmpl/main.sgml:
        * docs/tmpl/vertical.sgml:
        Add a section for Vertical Text.

        * examples/renderdemo.c (do_output), (parse_gravity_hint),
        (parse_options):
        Support gravity hint.

        * examples/test-mixed.txt:
        New test, mixed Latin, Arabic, Chinese text.