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.

Bug 42824 - [JDK1.5] New Project Wizard description part - font size is too big
Summary: [JDK1.5] New Project Wizard description part - font size is too big
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: _ ttran
URL:
Keywords: JDK_SPECIFIC
: 37601 45274 (view as bug list)
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-05-05 10:35 UTC by Marian Mirilovic
Modified: 2006-03-24 10:15 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (214.68 KB, image/png)
2004-05-05 10:35 UTC, Marian Mirilovic
Details
screenshot1 (24.46 KB, image/png)
2004-06-15 15:50 UTC, Milan Kubec
Details
screenshot2 (19.52 KB, image/png)
2004-06-15 15:51 UTC, Milan Kubec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2004-05-05 10:35:13 UTC
[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)
Comment 1 Marian Mirilovic 2004-05-05 10:35:43 UTC
Created attachment 14717 [details]
screenshot
Comment 2 Petr Hrebejk 2004-05-05 10:39:39 UTC
Tim? Any idea?
Comment 3 _ tboudreau 2004-05-05 11:17:12 UTC
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.
Comment 4 Marian Mirilovic 2004-05-05 12:31:02 UTC
> 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 ...
Comment 5 _ tboudreau 2004-05-05 14:05:43 UTC
Note I cannot reproduce this on my workstation.
Comment 6 Marian Mirilovic 2004-05-16 08:22:53 UTC
It isn't GTK specific issues. I can reproduce it only with JDK 1.5 &
default L&F (metal).
Comment 7 _ tboudreau 2004-05-16 10:09:49 UTC
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?
Comment 8 Petr Hrebejk 2004-06-01 14:26:43 UTC
Trung volunteered to do it.
Comment 9 _ ttran 2004-06-04 11:59:58 UTC
fixed by explicitly forcing HTMLEditorKit to use a mini CSS with the
UI font
Comment 10 Milan Kubec 2004-06-15 15:50:00 UTC
[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.
Comment 11 Milan Kubec 2004-06-15 15:50:38 UTC
Created attachment 15707 [details]
screenshot1
Comment 12 Milan Kubec 2004-06-15 15:51:06 UTC
Created attachment 15708 [details]
screenshot2
Comment 13 Marian Mirilovic 2004-06-21 12:57:19 UTC
Milan is right, still reproducible in [nb_dev](200406201800),
[jdk1.5.0](b51)
Comment 14 Miloslav Metelka 2004-07-16 11:21:39 UTC
Please note that this patch causes problems in the editor - issue
45274. IMO it should be either removed or improved.
Comment 15 Miloslav Metelka 2004-07-16 11:24:22 UTC
*** Issue 45274 has been marked as a duplicate of this issue. ***
Comment 16 _ ttran 2004-07-16 16:30:11 UTC
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)
Comment 17 Marian Mirilovic 2004-07-16 16:40:36 UTC
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)
Comment 18 _ ttran 2004-07-16 17:02:30 UTC
which OS it is?  Someone probably has to show me
Comment 19 Marian Mirilovic 2004-07-16 17:05:57 UTC
Linux RH9 / Gnome

ok, come to my office ;)
Comment 20 Milan Kubec 2004-07-19 07:58:39 UTC
Reproducible on my side too. My config is RH 8.0, Gnome. JDK 1.5.0 b58.
Comment 21 Martin Roskanin 2004-07-20 14:13:09 UTC
*** Issue 45274 has been marked as a duplicate of this issue. ***
Comment 22 Martin Roskanin 2004-07-20 14:20:04 UTC
It seems that this patch really causes problems in the editor. Please
see my comment in issue #45274
Comment 23 _ ttran 2004-07-20 21:39:58 UTC
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
Comment 24 Marian Mirilovic 2004-07-20 21:48:35 UTC
Ok, 
Trung provide patch , I'm ready to help you ;)
Comment 25 _ tboudreau 2004-07-22 02:13:07 UTC
*** Issue 37601 has been marked as a duplicate of this issue. ***
Comment 26 Milan Kubec 2004-07-29 13:18:33 UTC
Seems to be fixed when using JDK 1.5.0 b60. Please verify.
Comment 27 Marian Mirilovic 2004-07-29 13:27:36 UTC
Milan is right ;)

Trung , you've prepared the fix, is it still valid ;)
Comment 28 Milan Kubec 2004-07-29 13:51:22 UTC
See #46741, might be related. Seems that problematic font is
travelling around IDE :-)
Comment 29 _ ttran 2004-08-01 21:50:15 UTC
this seems to happens only on JDK 1.5/RedHat 9.  Should be fixed now
Comment 30 Marian Mirilovic 2004-08-02 07:19:56 UTC
verified in [nb_dev](200408011800)
Comment 31 Jesse Glick 2004-08-02 11:52:19 UTC
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.
Comment 32 _ ttran 2004-08-02 12:48:13 UTC
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
Comment 33 Jesse Glick 2004-08-02 13:40:14 UTC
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?
Comment 34 _ ttran 2004-08-02 14:53:07 UTC
#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
Comment 35 Jesse Glick 2004-08-02 16:50:16 UTC
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.
Comment 36 _ ttran 2004-08-02 21:51:05 UTC
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
Comment 37 _ tboudreau 2004-08-02 21:58:25 UTC
FYI, slightly cleaner way to do your patch would be

UIManager.getFont ("controlFont") instead of constructing a component to get the font.
Comment 38 Jesse Glick 2004-08-02 22:12:25 UTC
"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.
Comment 39 _ ttran 2004-08-04 22:27:10 UTC
> 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