GNOME Bugzilla – Bug 324621
strange characters appear before and after quoted strings
Last modified: 2005-12-26 07:13:08 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:
Created attachment 56208 [details] eclipse editor screenshot
Created attachment 56209 [details] testcase source code
Created attachment 56210 [details] screenshot of zwibbles.c output
what characters does the editor insert before and after the quotes ?
oh, the last screenshot shows it, thanks
Downgrading to libpango 1.10 removes the characters, so for now I'll just use 1.10
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/pango1.0/+bug/6094
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.
Maybe the patch gives problems for Cairo/Win32 or Cairo/ATSUI if they return zero glyphs that need to have a certain width.
The shaper shouldn't call get_unknown_glyph() on a zero width char.
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.
Seems like it is not even necessary to call pango_ot_buffer_add_glyph for the zero-width case...
...or maybe it is required (after a couple of eclipse crashes)
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)