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 200650 - Wrong font size shown for Default font in Tools>Options>Fonts&Colors
Summary: Wrong font size shown for Default font in Tools>Options>Fonts&Colors
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks: 179047
  Show dependency tree
 
Reported: 2011-08-03 18:01 UTC by err
Modified: 2011-08-10 21:29 UTC (History)
1 user (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 err 2011-08-03 18:01:32 UTC
There's a bug between the editor's default font size and the Options Dialog; in o.n.m.editor.settings.storage.fontscolors.CompositeFCS.getHardcodedDefaultColoring

    defaultFontSize < 13 ? 13 : defaultFontSize

and in o.n.m.options.colors.SyntaxColoringPanel.getDefaultFontSize 

    if (s < 12) s = 12;

The simplest fix is to change the "12" to "13" to match the real font in use.

To see the problem:
- Starting with a clean userdir
- bring up the Fonts&Colors dialog,
  Language: All Languages
  Category: Default
Observe "Font: Monospaced 12"
But the current font is actually Monospaced 13

- press the "..." box on Font: Mono-12, and then click OK.
Observe the change in the font size in the Preview
now it is really Mono-12, it was Mono-13

There are other anomalies because of this discrepancy.
Comment 1 Miloslav Metelka 2011-08-04 07:34:22 UTC
We were examining the code in settings related to it yesterday and we will attempt to have just one source of the default coloring fallback (so we will attempt to eliminate the hardcoded defaults from SyntaxColoringPanel).

Also the DEFAULT_COLORING should only be returned by FontColorSettings.getFontColors() and not by getTokenFontColors() (currently gFC() delegates retrieval of DEFAULT_COLORING to gTFC() which means that having a token or token category named "default" can lead to a strange behavior). We will fix that as well.
Comment 2 err 2011-08-04 11:06:03 UTC
(In reply to comment #1)
> ... have just one source of the default coloring fallback ...

> Also the DEFAULT_COLORING should only be returned by
> FontColorSettings.getFontColors() and not by getTokenFontColors() ...

Doing "the right thing"!

(mentioning bug 200450 with some discussion about these topics)
Comment 3 Milutin Kristofic 2011-08-08 12:50:53 UTC
Here are changes mentioned by Mila: http://hg.netbeans.org/jet-main/rev/6b807db39c97
Comment 4 Milutin Kristofic 2011-08-09 09:55:27 UTC
Here is fix for regression bug - default was in highlighting panel not syntax panel. Also the default font size is at least 13 in clean build.  http://hg.netbeans.org/jet-main/rev/34c5dac5c3cd
Comment 5 Quality Engineering 2011-08-10 21:29:35 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/34c5dac5c3cd
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: Fixed regresion bug for #200650 . The default font size is at least 13 with clean build. Default in again in syntax panel in Font & Colors.