Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#151 option disable "jVi works best with fixed size fonts" dialog

Minor
closed-fixed
Ernie Rael
NetBeans (62)
5
2013-08-13
2011-09-29
Mark B
No

jvi 1.4.3
NB 7.0.1
JDK 1.6.0_24 64-bit
Windows 7 64-bit

I just updated to jVi 1.4.3, and this just started happening.

When I click an editor window for a given file type for the first time I get the following dialog:

================================================
jVi works best with fixed size fonts.

Font size for Language: 'Java (text-java)'

The following specify a variable size font:
Default/'
==========================================

But the "Default" font set for "All Languages" is "Monospaced 12".

Discussion

  • Happens to me to.
    If you need any info, just let me know.

    Rick

     
  • Ernie Rael
    Ernie Rael
    2011-10-03

    Rick,
    Are you also on Windows 7? 64 bit?

    I'm still on XP.

    You might try changing the allLang defualt to something else, save, set it back to 12, save. See if that makes a difference.

    If either of you could turn on
    Tools > Options > jViConfig > Debug > debug fong issues
    and attach the info (or the whole messages file after you see the dialog) It should have stuff like the following (text/x-java in your case):

    FONTS: CHECKING FOR 'HTML (text/html)' ep QuietEditorPane@e3aaa doc NbEditorDocument@9c4e83
    === Font Tracking Init: text/html
    AllLanguages default
    default java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=12]
    background:java.awt.Color[r=255,g=255,b=255]
    foreground:java.awt.Color[r=0,g=0,b=0]
    family:Monospaced
    size:12
    bold:false
    italic:false
    name:default
    display name:Default
    ......
    Component font:
    default 12 (fm=7x17)

    I wonder if the NetBeans bug I filed
    Bug 200650 - Wrong font size shown for
    Default font in Tools>Options>Fonts&Colors
    could be related. It doesn't seem like it, but...
    Bug 200650 is fixed for nb 7.1.

    Looking at the code, it considers a font fixed if either the font metrics says it is fixed or if all the elements in
    int[] widths = fm.getWidths();
    are the same width (0 width elements are ignored).

     
  • Mark B
    Mark B
    2011-10-03

     
    Attachments
  • Mark B
    Mark B
    2011-10-03

    I use NB at home on Win Vista as well, and I have the same problem.

    I can confirm that when I change to another font and back to monospaced 12 I get the dialog both times. I did finally find a font that worked but I can't remember now which one it was.

    messages file should be attached.

     
  • Mark B
    Mark B
    2011-10-03

    I looked inside the messages file a bit and see it seems to be looking for Monospaced 13 (not 12.) I swear the NB UI says it's set to Monospaced 12.

     
  • Mark B
    Mark B
    2011-10-03

    Consolas 14 works great!

     
  • Ernie Rael
    Ernie Rael
    2011-10-03

    My guess is that there is an issue with the font metrics information for the default font; things don't look right. And since you see 12 and debug info is displaying 13, looks like the NetBeans bug:
    Bug 200650 - Wrong font size shown for Default font in Tools>Options>Fonts&Colors
    is in play. BTW, Bug 200650 is fixed for nb 7.1.

    I'll add some further debug info, sound like there is no hurry. Is that right?

     
  • Mark B
    Mark B
    2011-10-03

    No hurry at all.

     
  • Ernie Rael
    Ernie Rael
    2011-10-04

    Details from duplicate #3418411 by rhk ( rherschke )

    After upgrade to 1.4.3 in Netbeans 7.0.1 I always get the warning, that the font is not a fixed-width-font every time.

    I've choose all kinds of fonts, but get the error with each of them.

    Even if I've choose the Monospaced - Font (which should be fixed width on every system), this warning appears.

    ...and I'm missing the option to completely disable this warning.

     
  • Ernie Rael
    Ernie Rael
    2011-10-04

    > Even if I've choose the Monospaced - Font (which should be fixed
    > width on every system), this warning appears.

    jVi checks the actual size of the font by examining fontmetrics' charwidth array. The "size" property can be misleading. In NetBeans you can specify different fonts for different syntactic elements; if they are all Monospaced with the same "size", that is not sufficient to indiate that they all render to the same width:height, AFAICT.

    I'm planning to add some additional debug logging.

    > ...and I'm missing the option to completely disable this warning.

    Yeah, guess that needs to go in; fortunately all you need is an <ESC> to dismiss the dialog. I'll do a 1.4.4 soon with the option; but I'm going out of town for a couple of weeks, so not that soon. If the option is checked then the warning will only appear in the IO window without the dialog.

     
  • Ernie Rael
    Ernie Rael
    2011-10-07

    • summary: jVi works best with fixed size fonts --> option disable "jVi works best with fixed size fonts" dialog
     
  • Ernie Rael
    Ernie Rael
    2011-10-07

    Mark provided some addition debug info. It shows why those fonts fail the
    check. It's not complete font metric information, but it looks like the
    "special", non-ascii, characters have funny widths.

    I'm going to change the bug title to ask for an option

    This shows the issue.

    12 (fm=0x0, nWidth 256, '\@' 7, '\A' 13)
    java.awt.Font[family=Monospaced,name=Monospaced,style=bold,size=12]

    12 (fm=0x0, nWidth 256, '\@' 6, ' ' 7)
    java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=12]

    One thing is that plain and bold don't of the same font, don't seem to have the same widths.

    Notice the first one, Monospaced-bold, has '\@' 7, '\A' 13, which says
    Character integer-val width
    Ctrl-@ 0 7
    Ctrl-A 1 13

    The second, Monospaced-plain, has '\@' 7, '\A' 13, which says
    Character integer-val width
    Ctrl-@ 0 6
    ' ' <space> 32 13

    The first problems occur with the "special characters", those with values less than 32, which are non-printing ascii characters, but some fonts use them for other things.

    I'm only printing the first mismatch, for the plain font, the first 32 characters (non-printing) have width '6', so something gets printing. In typical font, they are of width zero and jVi ignores them for the purpose of this calculation.

    For the bold font, first character, zero, is width 7 and the 2nd character, 1, is width 13.

    That explains why this font fails.

     
  • Ernie Rael
    Ernie Rael
    2011-10-07

    My disection of the results is not right, the conclusion is the same, should be

    bold 12 (fm=0x0, nWidth 256, '\@' 7, '\A' 13)
    plain 12 (fm=0x0, nWidth 256, '\@' 6, ' ' 7)

    === bold
    Ctrl-@ --- 7
    Ctrl-A --- 13

    === plain
    Ctrl-@ --- 6
    <space> --- 7

     
  • Hi Ernie,

    I'm using Windows 7 64 bit indeed.
    I'm also using NB 7.1 (beta), so the fix (200650) isn't helping.

    I've tried changing the font (sever times) and setting it back to 12, but that didn't help.
    I'm using Bitstream Vera Sans Mono 10. As suggested below Consolas does work b.t.w.

    I've tried enabling the font debugging, but it didn't log anything...

    Hope this info is useful.
    Rick

     
  • Ernie Rael
    Ernie Rael
    2011-10-13

    What I've seen so far from debug info is that some fonts have weird width characters in the 0-31 integer range (width 0 is ignored). So they're not fixed size font. I might modify jVi to ignore the chars 0-31, but then I'd feel compelled to give a warning since they can be input using Ctrl-V, so you'd still have the Font Nag problem and the option does make sense.

    Here's what I'm thinking now
    - consider two ranges of widths, one for chars 32-0xff
    (the space char to the typical end of the width table)
    the other range for the first 32 chars 0-31.
    - The first 32 chars won't trigger the font error (they can trigger a warning),
    the second 32 will trigger the error.
    - Won't be able to disable the error, doesn't seem serious since an
    escape gets rid of it and it only happens once per filetype.

     
  • This happens to me on Mac OS X 10.6.8.
    I have tried several font selections and get the same result.

     
  • Ernie Rael
    Ernie Rael
    2011-12-04

    jVi 1.4.5.rc2, now available, has two options
    Font Check ignore special chars (default: true)
    Font Check disable problem dialog (default: false)

    The special chars are considered to be in the range of u0000 - u001f. The typical range that is checked is u0000 - u00ff. The goal is that you should be able to run with the defaults and not see the dialog, even with those fonts that have some different width special characters.

    I need your help to verify that the range jVi uses for special characters is mostly correct. Maybe the characters in the range u007f - u009f should also be considered special.

    Even if the dialog is disabled, the results go into the "jVi Output" tab. I can't reproduce the special chars problem; you can check to see if jVi is detecting special chars correctly.

    If you are using a "fixed" size font, and you see message 2, please report that along with debug info.

    MESSAGE 1 header
    If the problem is with SPECIAL CHARACTERS ONLY you will see something like

    Potential font size problem for Language: xxx
    The following have different width special chars:

    MESSAGE 2 header
    General problems will be

    Font size problem for Language: xxx
    The following specify a variable size font:

     
  • Ernie Rael
    Ernie Rael
    2011-12-04

    • assigned_to: nobody --> err
    • status: open --> open-fixed
     
  • Ernie Rael
    Ernie Rael
    2013-08-13

    • status: open-fixed --> closed-fixed