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 33249 - I18N - Editor should honor -fontsize or UIManager.getFont ("TextField.font") size for initial font size
Summary: I18N - Editor should honor -fontsize or UIManager.getFont ("TextField.font") ...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: I18N
: 33876 (view as bug list)
Depends on:
Blocks: 33246
  Show dependency tree
 
Reported: 2003-04-25 10:07 UTC by _ tboudreau
Modified: 2007-11-05 13:44 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2003-04-25 10:07:18 UTC
If not overridden by the user, the editor font size should
honor the font size specified on the command line or by
the JRE.  This is an issue for non-english locales which
may require a larger default size.
Comment 1 Miloslav Metelka 2003-04-28 09:26:52 UTC
Yes, there should be no problem to make this into 4.0.
Comment 2 Wendy Blatt 2003-05-13 17:32:42 UTC
It is also an issue for terminal emulators and non-default fonts.  Not
all the font mappings are installed, so when I use an XWindow server
for remote sessions, the right font is not always available depending
on my Windows screen resolution. I specify "-fontsize 10" on the
command line but none of the Editors honor it.  I just recently
noticed that the Editors have their own Font size property, so now i
can finally see edited text correctly.   (I don't use this
configuraton on a regular basis... just for remote testing)

It is also inconvenient for non-Java programs where I have to fix the
property for each language editor.  I would hope all editors will
always inherit from the command line when this issue is resolved.  (or
have a global base editor property like Global KeyBindings)

Thanks

Wendy

Comment 3 Ken Frank 2003-05-13 18:07:44 UTC
Marking as P2 since would need
fixing as part of solution for
Chinese localization before 4.0

But since marked with FONTSIZE keywd, it will be waived automatically
for 3.5/nevada.
Comment 4 Ken Frank 2003-05-24 16:45:11 UTC
*** Issue 33876 has been marked as a duplicate of this issue. ***
Comment 5 Miloslav Metelka 2003-06-13 13:57:46 UTC
The fix works well until the particular coloring gets modified in the
tools->options. Until such change the IDE can be restarted several
times with different fontsize parameters and all the colorings will
follow the supplied size.
 In theory I should be able to supply even more advanced fix that
could restore adhering to fontsize parameter after the user modifies
the size of the font in a particular coloring and then changes the
size of the font back so that it matches the fontsize parameter. In
such case that coloring would follow the fontsize parameter again.
However such fix would be much more complex compared to the fix I'm
supplying now and thus more risky.

Fixed in maintrunk:
Checking in libsrc/org/netbeans/editor/SettingsDefaults.java;
/cvs/editor/libsrc/org/netbeans/editor/SettingsDefaults.java,v  <-- 
SettingsDefaults.java
new revision: 1.27; previous revision: 1.26
done

I would like to ask Mato to review the fix. Thanks in advance.
Comment 6 Martin Roskanin 2003-06-13 14:00:46 UTC
I approve the fix
Comment 7 Miloslav Metelka 2003-06-13 16:32:17 UTC
Integrated into [release35]:
/cvs/editor/libsrc/org/netbeans/editor/SettingsDefaults.java,v  <-- 
SettingsDefaults.java
new revision: 1.26.2.1; previous revision: 1.26
Comment 8 Miloslav Metelka 2003-06-18 09:26:07 UTC
As the editor now reflects the UIManager.getFont ("TextField.font")
size for initial font size the default editor font size is now 11
instead of the original 12.
 I'm not sure whether that's an issue but at least someone from UI
team should confirm whether it's OK or not.
 If the original size 12 should be retained I can e.g. use 
(UIManager.getFont("TextField.font").getSize() + 1)
so the original idea (i.e. make the editor font size bigger for
chinese) will still work but the font will be one point bigger.
Or I can do e.g.
 Math.max(UIManager.getFont("TextField.font").getSize(), 12)
so the editor font size will be at least 12 even when IDE is started
with e.g. -fontsize 10.
Comment 9 _ tboudreau 2003-06-18 09:43:24 UTC
Interesting, I noticed something looked different when I 
built the trunk and ran it yesterday, but I couldn't put
my finger on what it was.

I'd say it depends if the increased font size is a way
for the editor to say "look at me, I'm important", it 
should be +1.  If it's just a random artifact, well,
if the user can read 11 point type everywhere else
without a problem, that's probably true of the editor
too (especially since it uses a fixed width font).
Comment 10 Wendy Blatt 2003-07-15 16:31:20 UTC
I specified -fontsize 10, but the Java Editor setting is showing a
fontsize of 12.

Is this the result of the 12 minimum discussion earlier?  or am I not
seeing the fix for some reason or another.  I know there's been some
font related bugs/fixes but I have not been following it.

I am using the released version of 3.5. I was preparing to see how the
new 3.5.1 rc1 compares.



Comment 11 _ tboudreau 2003-07-15 16:42:46 UTC
If you are not using a clean user dir, the change probably won't
be visible, because a font size setting has been read from disk.
AFAIK the patch (assuming Mila did it the way I did the output
window) changes the value the font size is initialized with, if
it has never been explicitly set.  It may be that if the system
option has been observed, the observed size is stored to disk.
Comment 12 Wendy Blatt 2003-07-15 18:14:52 UTC
not only was it a clean user dir, I said NB had never been installed
on this system before.

Is there a file on disk I could look for?  I searched *.xml for font
and came up empty.

This is occurring on VMS.  I will try it on Windows.
Comment 13 Wendy Blatt 2003-07-15 18:58:30 UTC
It is the same on Windows.  Java Editor is using font size of 12
rather than -fontsize value.  I also tried -fontsize 14 in case the
minimum of 12 algorithm had been applied.  The font size was still 12
in that case too.

I also noticed that, besides editors and Javahelp,  most but not all
parts of the UI adhere to -fontsize.  Perhaps the piece being used for
this fix is one of the few parts that do not use -fontsize either, or
maybe its a timing thing... or ...



Comment 14 Miloslav Metelka 2003-07-16 08:54:47 UTC
I have checked NetBeansIDE-release351-200307152351.zip build on
Redhat8 and the fix works OK there. Petre, could you please test the
fix on Windows too.
 I'm wondering what could become wrong here. Wendy, are you using just
the plain build or are you adding any additional modules?
Comment 15 Wendy Blatt 2003-07-16 14:28:28 UTC
I am using NetBeansIDE-release35.zip.  I wanted to see it "fixed" in
3.5 (as reported here) before I tried to see what happened in 3.5.1. 
fresh download, fresh user dir, no extra modules.  
Comment 16 Miloslav Metelka 2004-01-22 11:08:58 UTC
Wendy, I think that this was only backported into S1S 5 ML and NB3.5.1
not into the original 3.5. If it's still necessary to use original 3.5
then I would consider to copy the editor module jars from 3.5.1 to 3.5.

I have tested it in the current trunk and it should work OK.
So I'm closing this as fixed. Please reopen if necessary.
Comment 17 mtsuruta 2004-01-23 02:41:32 UTC
I have verified this issue using en and ja locale for editor font
size, not font size for non-Java programs and terminal emulators.
Changed fontsize 12 to 14 and compaired editor's appearance on
following modules.
The editor font size is properly resized by -fontsize option.

me - build:200401181900 on w2k/sol9(locale ja/en) - OK
nb trunk - build:200401151900 on w2k/sol9(locale ja/en) - OK