Community
Participate
Working Groups
See attachment with test program. 1.- There is a mismatch between actual painting with gc.drawString() and the gc.stringExtent() info returned, for e.g., chars '\u0001' - \u0006'. The extent returned is larger than the actual extent painted. This makes it impossible e.g., to match a mouse-click's x offset in the window to the correct index inside the displayed text string. 2.- These characters seem to be filtered out somehow by StyledText's rendering: they have a width of 0 pixels on the display?! Consequently, StyledText seems to manage fine to correlate an x offset to the correct text. How is it solved in StyledText (i.e., what is this workaround)?? I believe is better to not show them at all (like StyledText appears to do), than cheese out the screen... 3.- What is the full set of these characters?
Created attachment 4376 [details] Test program.
This bug is reported against 2.0.2. In Eclipse 2.1, all the strings in the example have a length of 400 pixels. I will attach a picture of what it looks like. I believe this looks correct. It depends on the font used whether it has a glyph for the character and how that glyph appears (question mark, empty rectangle, black rectangle etc). Are you calling the glyph used for the characters '\u0001' - \u0006' "cheese"?
Created attachment 4380 [details] example run on Eclipse 2.1.
>>> Are you calling the glyph used for the characters '\u0001' - \u0006' "cheese"? No, cheese is caused by other display operations I do (selections, selected background painting, etc.), in which I rely on the information returned by stringExtent(), but which is not in sync with the actual stuff displayed.
Created attachment 4381 [details] GC#stringExtent() in R2.0.2
Your R2.1 image looks good, I'll give it a try. I've attached what displays in R2.0.2, for the record.
I still get the bad results (as in my previous attachment) for font "Courier" 10, on XP Home edition (version 5.1 SP1). With "Courier New" 10 the output is different (I'll attach), but just as bad. TextEditor (and consequently JDT's JavaEditor, etc.) is still nicely 'filtering' these characters / glyphs out from its own display.
Created attachment 4390 [details] StringExtent() out to lunch Will also try R2.1 on Windows 2000 next week...
The R2.1 I'm using is build I20030326-win32.
Tried with the Eclipse R2.1 official release, Windows 2000 (v5.0 SP3): I get the same bad results (with both the "Courier" and the "Courier New" fonts)...
Chrix to investigate and advise.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.