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 171439 - pango_layout_xy_to_index trailing argument wrong if text is only numbers (not strong ltr)
pango_layout_xy_to_index trailing argument wrong if text is only numbers (not...
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.8.x
Other Linux
: Normal normal
: 1.8.2
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2005-03-24 00:59 UTC by Christopher Blizzard
Modified: 2005-07-25 17:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (686 bytes, text/plain)
2005-03-24 01:00 UTC, Christopher Blizzard
  Details
Fix in pango. (826 bytes, patch)
2005-03-28 19:23 UTC, Behdad Esfahbod
none Details | Review

Description Christopher Blizzard 2005-03-24 00:59:25 UTC
Will attach test case.  Symptom is that in a pango-enabled mozilla build if you
click in a text area that only contains numbers after all the text the cursor
will be positioned at the beginning of the string, not the end.  Cause is that
the line direction on number-only text is set to WEAK_LTR not LTR.  The
PangoContext generated by xft is WEAK_LTR by default and that's passed all the
way down to the line layout default direction in pango_layout_check_lines().
Comment 1 Christopher Blizzard 2005-03-24 01:00:45 UTC
Created attachment 39172 [details]
test case

This is a simple test case that demonstrates the problem.  Trailing should be
'1' not '0'.
Comment 2 Christopher Blizzard 2005-03-24 01:03:43 UTC
Oh, if you can think of a work around for this I would appreciate it.  There's a
lot of pango installs out there.  Maybe setting the context direction to LTR
instead of leaving it as WEAK_LTR might work?
Comment 3 Behdad Esfahbod 2005-03-28 19:23:42 UTC
Created attachment 39351 [details] [review]
Fix in pango.

Well, I must confess I'm a bit lost in how things work in pango, since
itemize_state_init throws away the resolved dir got back from
pango_log2vis_get_embedding_levels.  Anyway, attached patch indeed fixes your
problem, and is a valid changed, but to me smells like a much bigger patch is
needed eventually.  Would you please check what happens if the neutral
paragraph is not the only paragraph in the layout, before and after the patch.
Comment 4 Owen Taylor 2005-06-14 22:41:29 UTC
I don't think there is anything big needed.... resolved_dir has to do with
the paragraph-level resolution algorithm that Dov added a release or
two ago.

What I think is needed is that in the two places where layout->resolved_dir
are set ... weak_ltr/weak_rtl should be converted to ltr/rtl. (Neutral
probably also needs to be converted to a real direction; probably the
direction of the layout's context.)
Comment 5 Owen Taylor 2005-07-25 17:33:42 UTC
2005-07-25  Owen Taylor  <otaylor@redhat.com>

        * pango/pango-layout.c (line_set_resolved_dir): Always set
        line->resolved_dir to one of LTR or RTL. (#171439, Reported
        by Chris Blizzard)