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 434212 - Right and center alignment stumbles on trailing spaces
Right and center alignment stumbles on trailing spaces
Status: RESOLVED DUPLICATE of bug 355789
Product: pango
Classification: Platform
Component: general
1.16.x
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2007-04-28 20:56 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2007-05-01 02:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Broken center alignment (4.25 KB, image/png)
2007-04-28 21:04 UTC, Mathias Hasselmann (IRC: tbf)
  Details
Broken right alignment (3.66 KB, image/png)
2007-04-28 21:08 UTC, Mathias Hasselmann (IRC: tbf)
  Details
[pango-view] Add option for testing text alignment. (704 bytes, patch)
2007-04-28 21:15 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
[pango-view] Add option for testing text alignment. (2.57 KB, patch)
2007-04-28 21:18 UTC, Mathias Hasselmann (IRC: tbf)
needs-work Details | Review

Description Mathias Hasselmann (IRC: tbf) 2007-04-28 20:56:10 UTC
Please describe the problem:
Right and center alignment failes because Pango forgets to strip trailing spaces on line breaking text. This seems to be a regression introduced some time after Pango 1.10. Don't know the exact version, when the regression happend.

Steps to reproduce:
1. Apply the first patch
2. Create hello.txt with the content "Hello World."
3. Run "pango-view -w 60 --alignment=center" and "pango-view -w 60 --alignment=right".


Actual results:
Lines ending with spaces are not aligned properly as their trailing spaces push them to the left.

Expected results:
Last letters of right aligned text to be positioned in line and centered text to really be centered.

Does this happen every time?
Yes.

Other information:
Comment 1 Mathias Hasselmann (IRC: tbf) 2007-04-28 21:04:16 UTC
Created attachment 87200 [details]
Broken center alignment

On the left side the gap is 6 pixels, on the right it are 11 pixels...
Comment 2 Mathias Hasselmann (IRC: tbf) 2007-04-28 21:08:10 UTC
Created attachment 87201 [details]
Broken right alignment

For glyphs like dots the current behaviour even could make some kind of sense, but if the result becomes non-discutable, when the last glyph is a letter.
Comment 3 Mathias Hasselmann (IRC: tbf) 2007-04-28 21:15:53 UTC
Created attachment 87203 [details] [review]
[pango-view] Add option for testing text alignment.

Let's start with supporting alignment testing in pango-view.
Comment 4 Mathias Hasselmann (IRC: tbf) 2007-04-28 21:18:11 UTC
Created attachment 87204 [details] [review]
[pango-view] Add option for testing text alignment.

Gah, I am too stupid to use git-update-index.
Comment 5 Behdad Esfahbod 2007-05-01 02:04:08 UTC
Please rename that to --align.  Also, this is a dupe of bug 355789.  I'm dupping.  Please reattach your patch there after renaming.  Thanks. (and yes, I envy you having a pango git checkout.)

*** This bug has been marked as a duplicate of 355789 ***