1
votes

The editor defaults to a monospaced font, which looks like Courier New. I want to use something like Consolas instead, but I only see a few fixed options that look like they map to system fonts. Is there a way to choose an installed font to use as the editor's default font?

1

1 Answers

2
votes

I discovered how to choose a font that's not listed in the IDE's font selection menu after messing with configuration files for a while. This was tested on Windows with NetBeans 6.9.1 and MPLAB X 1.95. (Note: NetBeans 7 has a font chooser.)

Generating the Initial Configuration

  1. Open the options dialog (Tools -> Options) and select "fonts and colors"
  2. With the "default" category selected, click the button to the right of the font to change it
  3. Change the font something other than the default (such as "Dialog")
  4. Press ok to save the changes

The configuration file for fonts and colors has been created. You can either follow option 1 or 2 to open the configuration file, then see the last section to change the font. The second option is easier if you don't know where the configuration files are located.

Option 1: Using the Configuration Files in the User Directory

  • Close the IDE
  • Open the fonts and colors configuration file

MPLAB X

/Users/user/AppData/Roaming/.mplab_ide/dev/v1.95/config/Editors/FontsAndColors/NetBeans/org-netbeans-modules-editor-settings-CustomFontsColors-tokenColorings.xml

 

NetBeans

/Users/user/.netbeans/6.9/config/Editors/FontsAndColors/NetBeans/org-netbeans-modules-editor-settings-CustomFontsColors-tokenColorings.xml

  • Change the font as described in "Setting the Desired Font"

Option 2: Using Exported Options

  • Reopen the fonts and colors settings in the options dialog
  • Select "Export"
  • Check the "Fonts and Colors" tree
  • Export options
  • Extract the zip file that was created, then open the configuration file config/Editors/FontsColors/NetBeans/org-netbeans-modules-editor-settings-CustomFontsColors-tokenColorings.xml
  • Change the font as described in the next section
  • Rezip the files, then import the file in the IDE

Setting the Desired Font

Either search for "Dialog" (or the font that was selected earlier) or "name="default"", which is an attribute of the fontcolor element. There should be a nested element that looks like:

<font name="Dialog" size="12"/>

Change "name" to the font that you want to use. The selected font should be set after the IDE restarts.