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 324621 - strange characters appear before and after quoted strings
strange characters appear before and after quoted strings
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.11.x
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2005-12-20 15:46 UTC by Karol Bryd
Modified: 2005-12-26 07:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
eclipse editor screenshot (99.32 KB, image/png)
2005-12-20 15:48 UTC, Karol Bryd
  Details
testcase source code (1.50 KB, text/x-csrc)
2005-12-20 15:48 UTC, Karol Bryd
  Details
screenshot of zwibbles.c output (5.87 KB, image/png)
2005-12-20 15:49 UTC, Karol Bryd
  Details
Distinguishes between zero-width and unknown glyphs (778 bytes, patch)
2005-12-25 08:43 UTC, Michael Hofmann
none Details | Review
basic_engine_shape doesn't call pango_fc_font_get_unknown_glyph anymore (1.04 KB, patch)
2005-12-25 18:16 UTC, Michael Hofmann
none Details | Review

Description Karol Bryd 2005-12-20 15:46:52 UTC
Please describe the problem:
This bug was originally reported as an Eclipse bug, however it turned out that
it might be a result of recent work in the Pango library.

The bug shows up in the Eclipse Java Editor, whenever you open and close
quoted string strange characters show up before and after the string. This
doesn't happen when the string is a comment. Take a look at the attached
screenshots.

Billy Bigs has created a testcase which shows these strange characters, 
the testcase source code is also attached.

Here is the link to the bug description in the Eclipse's bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=121481



Steps to reproduce:
1. run the attached testcase
2. ..or run the Eclipse and enter some quoted strings in the editor



Actual results:
strange characters shows up before and after the quoted string

Expected results:
the characters should not be visible

Does this happen every time?
yes

Other information:
Comment 1 Karol Bryd 2005-12-20 15:48:08 UTC
Created attachment 56208 [details]
eclipse editor screenshot
Comment 2 Karol Bryd 2005-12-20 15:48:51 UTC
Created attachment 56209 [details]
testcase source code
Comment 3 Karol Bryd 2005-12-20 15:49:12 UTC
Created attachment 56210 [details]
screenshot of zwibbles.c output
Comment 4 Matthias Clasen 2005-12-20 15:58:23 UTC
what characters does the editor insert before and after the quotes ?
Comment 5 Matthias Clasen 2005-12-20 15:59:33 UTC
oh, the last screenshot shows it, thanks
Comment 6 Karol Bryd 2005-12-21 21:59:19 UTC
Downgrading to libpango 1.10 removes the characters, so for now I'll just use 1.10
Comment 7 Sebastien Bacher 2005-12-24 13:33:23 UTC
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/pango1.0/+bug/6094
Comment 8 Michael Hofmann 2005-12-25 08:43:28 UTC
Created attachment 56383 [details] [review]
Distinguishes between zero-width and unknown glyphs

For zero-width glyphs, pango_cairo_fc_font_real_get_unknown_glyph returns 0. These are ignored by pango_cairo_renderer_draw_glyphs.
Comment 9 Michael Hofmann 2005-12-25 09:02:17 UTC
Maybe the patch gives problems for Cairo/Win32 or Cairo/ATSUI if they return zero glyphs that need to have a certain width.
Comment 10 Owen Taylor 2005-12-25 17:01:56 UTC
The shaper shouldn't call get_unknown_glyph() on a zero width char.
Comment 11 Michael Hofmann 2005-12-25 18:16:46 UTC
Created attachment 56388 [details] [review]
basic_engine_shape doesn't call pango_fc_font_get_unknown_glyph anymore

Ok, maybe this one: applies the processing of zero-width characters from fallback_shape to basic_engine_shape in modules/basic/basic-fc.c.
Comment 12 Michael Hofmann 2005-12-25 22:53:05 UTC
Seems like it is not even necessary to call pango_ot_buffer_add_glyph for the zero-width case...
Comment 13 Michael Hofmann 2005-12-25 23:04:08 UTC
...or maybe it is required (after a couple of eclipse crashes)
Comment 14 Behdad Esfahbod 2005-12-26 07:13:08 UTC
Humm, nice to see that Eclipse actually inserts these characters at these positions...  Any pointers to what is inserted where?

Anyway, fixed the bug in HEAD, please test:



2005-12-26  Behdad Esfahbod  <behdad@gnome.org>

        * modules/arabic/arabic-fc.c,
        * modules/basic/basic-fc.c,
        * modules/hebrew/hebrew-fc.c,
        * modules/syriac/syriac-fc.c: Use pango_is_zero_width() to not draw
        zero-width characters in the OpenType shapers.  (Fixes bug #324621)