This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NetBeans IDE Dev 101013; Mac OS X 10.5.8 When using Monospaced-plain-12 the underscore character is only partially rendered when moving cursor down among lines.
The problem is that TextLayout.draw() used for rendering requires ascent to be added to y coordinate. However for certain fonts e.g. Monospaced 12 Plain the ascent is fractional: Font: java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=12] Size2D: 12.0, Line-height=12.0, ascent=9.046875, descent=2.953125, leading=0.0 Char-width=7.0, underlineOffset=0.6666667 FontMetrics (for comparison): fm-line-height=12, fm-ascent=9, fm-descent=3 The rendering system (although generally supporting float measurements) does not handle the situation well and the underscore gets rendered incorrectly roughly one pixel down than it should be. I have added floor-ing of the ascent so that it should render well. http://hg.netbeans.org/jet-main/rev/e82e77b46e47
(In reply to comment #2) > I have added floor-ing of the ascent so that it should render well. ...still have the problem with various Fonts on Ubuntu 10.04. The fix didn't work for me.
Can you be more precise and specify problematic font and describing the steps to reproduce? Also you may run with -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE in netbeans.cfg and mention the output (similar to what I've provided) so that it's clear what's the ascent size etc. Thanks.
(In reply to comment #4) > Can you be more precise and specify problematic font and describing the steps > to reproduce? ok. sorry. fonts I tried out and which do not render underscores at all : DejaVu Sans (All variations) DejaVu Serif (All variations) Dialog Monospaced SansSerif Serif It seems, line height is 1-2px lower than the font-height in these cases. To reproduce; just change the default font for all languages in Tools -> Options -> Fonts & Colors menu. > Also you may run with > -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE this did not help. As I mentioned in my previous comment; I work on Ubuntu 10.04 with the actual dev-build (currently #2497) > ... and mention the output (similar to what I've provided) so that > it's clear what's the ascent size etc. Thanks. sorry, I couldn't understand this step?
tufan did you try on a recent dev build? I have re-tested several fonts (DejaVu Sans, Dialog and Monospaced) in various sizes (10, 12, 14 and 18) on my Ubuntu 10.04 and there was no problem with underscore rendering. If you can still reproduce please specify an exact font and possibly attach a screenshot. Regarding -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE in netbeans.cfg it only outputs an additional information regarding view hierarchy's font usage to the console. It won't alter behavior of the IDE.
Created attachment 103002 [details] screenshot with DejaVu Sans font-size 13
Created attachment 103003 [details] screenshot with DejaVu Sans font-size 12
(In reply to comment #6) > tufan did you try on a recent dev build? yes, I'm currently working with the most recent dev-build. > I have re-tested several fonts (DejaVu Sans, Dialog and Monospaced) in various > sizes (10, 12, 14 and 18) on my Ubuntu 10.04 and there was no problem with > underscore rendering. > If you can still reproduce please specify an exact font and possibly attach a > screenshot. attached 2 screenshots, which illustrate the rendering with DejaVu Sans 12 and 13. If fontsize=14 is choosen, rendering seems to be correct.
I've tested on Ubuntu 10.04 with DejaVu Sans 12 and it seems correct (screenshot attached). However it came to my mind that your particular case could happen if there would be a mixture of several fonts and DejaVu would be non-default font. I've entered issue 192035. Let me fix it first and then we will verify whether it fixes your case or not. In the meantime could you please check whether Tools->Options->Fonts&Colors->Syntax->Default is DejaVu Sans 12? Or could you send me zipped content of your $userdir/config/Editors?
Created attachment 103021 [details] Screenshot of DejaVu Sans 12 with underscores visible
Hi there, I suffer the same problem as tufan on both netbeans 7.0 and netbeans netbeans-dev-201106260600 from nightly/latest. I have also tried both to run with -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE added to bin/netbeans startup script. $ java -version java version "1.6.0_18" OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-4) OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode) OS: Debian GNU/Linux testing/unstable.
pevik, could you please attach your messages.log (when you were running with -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE)? Thanks.
Could you please try to reproduce the problem on a newest dev build from http://bits.netbeans.org/download/trunk/nightly/latest/ (I would like to know whether issue #197534 fixed this problem or not). Thanks.
Created attachment 109527 [details] messages.log for nightly-201107190600 (In reply to comment #13) > pevik, could you please attach your messages.log (when you were running with > -J-Dorg.netbeans.modules.editor.lib2.view.DocumentView.level=FINE)? > Thanks. Attaching log for lastest dev (netbeans-trunk-nightly-201107190600-ml-php-linux.sh). Problem still occurres :(.
Seems to be fixed in devel versions (201109120600, 201109120600) as well as in 7.0. Sound strange, because the only thing I changed was started it once with JRE from Sun/Oracle (1.6.0_26) and since then it's working with OpenJDK (1.6.0_23) as well.