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.
[JDK1.5.0](b49), RH9 , Gnome Steps to reproduce: - run IDE with -J-DuseGtk=true - push from main menu File | New Project -> text in the description area is too big (see attached screenshot)
Created attachment 14717 [details] screenshot
Tim? Any idea?
1. Make sure Marian wasn't also testing with -fontsize when he took the screen shot (Marian?) - it cannot be supported on GTK L&F 2. May need to explicitly set the font - GTK makes far more assumptions about doing its own thing with fonts and borders than traditional look and feels, and treats null values as an invitation to do what it wants (must use EmptyBorder not null for borders; probably we can't assume the parent font will be picked up either). But if we're really not doing anything unusual, it's a JDK bug.
> 1. Make sure Marian wasn't also testing with -fontsize when he took the screen shot (Marian?) - it cannot be supported on GTK L&F I've tested without fontsize switch. > But if we're really not doing anything unusual, it's a JDK bug. I think we are doing something unusual, it works fine in File | New File ...
Note I cannot reproduce this on my workstation.
It isn't GTK specific issues. I can reproduce it only with JDK 1.5 & default L&F (metal).
Now *that's* weird. I would suspect some haywire html or something such is the cause. I have this vague feeling Trung did something to it lately, but I'm not sure. Does any other HTML (help window, etc.) have funny font sizes on your system?
Trung volunteered to do it.
fixed by explicitly forcing HTMLEditorKit to use a mini CSS with the UI font
[custom build 20040615, JDK 1.5.0 b54, Swing Metal L&F, Linux RH] Seems to be still there. See screenshots. Help HTML is perfectly OK.
Created attachment 15707 [details] screenshot1
Created attachment 15708 [details] screenshot2
Milan is right, still reproducible in [nb_dev](200406201800), [jdk1.5.0](b51)
Please note that this patch causes problems in the editor - issue 45274. IMO it should be either removed or improved.
*** Issue 45274 has been marked as a duplicate of this issue. ***
I think issue 45274 is unrelated. See my comment there. Milan, Marian: can you describe the exact step you get the bigger font size? It happens only once or everytime? I can reproduce it at all on my machine (today's build, jdk 1.5.0 b58, linux)
It's still 100% reproducible on [nb_dev](200407151800) + [jdk1.5.0](beta3 b58) New File dialog (File | New File...) New Project dialog (File | New Project ...) BUT it isn't reproducible in Module Installation panel in Setup Wizard (font in the description part has set correct size)
which OS it is? Someone probably has to show me
Linux RH9 / Gnome ok, come to my office ;)
Reproducible on my side too. My config is RH 8.0, Gnome. JDK 1.5.0 b58.
It seems that this patch really causes problems in the editor. Please see my comment in issue #45274
I see. Nonetheless the real trouble is AWT is using a completely different font than what the style sheet specifies and it seems this happens only on some machines with RH 8 and 9. Fedora Core seems working fine. Will put in some debug message to investigate further
Ok, Trung provide patch , I'm ready to help you ;)
*** Issue 37601 has been marked as a duplicate of this issue. ***
Seems to be fixed when using JDK 1.5.0 b60. Please verify.
Milan is right ;) Trung , you've prepared the fix, is it still valid ;)
See #46741, might be related. Seems that problematic font is travelling around IDE :-)
this seems to happens only on JDK 1.5/RedHat 9. Should be fixed now
verified in [nb_dev](200408011800)
This fix looks dangerous to me. There used to be a JDK bug (filed by me? maybe) that HTML text used the wrong base font; this was marked fixed in JDK 1.4.something, and in fact it was. So what is the origin of this problem? Some regression in the JDK? Where is it filed? Will we keep this ugly workaround stuck in our code indefinitely after it is fixed? What might it break that we are not aware of? Note: I have observed the too-big font on my Fedora Core 2 machine, in popup Javadoc (not in the new project description). 040730 custom, b60, Ocean.
there are at least two issues 1) we don't like the default Swing CSS 2) Swing uses a bad font on JDK 1.5 / RedHat. My fix is more about (1) than (2). The really correct impl would subclass HTMLEditorKits, override {set,get}StyleSheet to cancel the sharing of stylesheet by all kits, and supply our own CSS. My hack is not complete, thus the XXX in the code. Need to be improved as soon as time/resource permits
So are #1 and #2 filed then? And if the CSS is shared across all kit instances, why don't we set our preferred CSS in a global place, like core/swing/plaf?
#1 was filed in IZ long ago. #2 is this bug > And if the CSS is shared across all kit instances, why don't we set > our preferred CSS in a global place, like core/swing/plaf? startup time regression if we do it eagerly. Need API if we want to do it lazily, on demand
No, I was asking whether the style problems are filed in BugTraq, so that they will be fixed and we will be able to remove the workaround later.
but this is *not* a bug in JDK. The Swing default CSS specifies "body {font-size: 14px}" this is not a bug. We only don't want this default for a few specific use cases where we want the font to match the UI font as much as possible
FYI, slightly cleaner way to do your patch would be UIManager.getFont ("controlFont") instead of constructing a component to get the font.
"The Swing default CSS specifies "body {font-size: 14px}" this is not a bug." - sure sounds like a bug to me, if your font for the component is different! Unless you use font-modifying HTML tags, it should display the same as plain text. In fact I think this is exactly the JDK bug I filed. Can't remember what number, now. I thought it had been fixed in 1.4.
> UIManager.getFont ("controlFont") works on GTK? to Jesse's last comment: I haven't studied what Swing HTML renderer is doing but the default stylesheet really sets <body> font size to 14px. I suspect that if you use "<html>My <b>bold</b> label" then the code path is different than displaying real html doc