简体   繁体   English

如何将编辑器的默认字体更改为系统上安装的字体?

[英]How do I change the editor's default font to a font that's installed on the system?

The editor defaults to a monospaced font, which looks like Courier New. 编辑器默认为等宽字体,类似于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. 我想改用Consolas之类的东西,但是我只看到一些固定的选项,它们看起来像它们映射到系统字体。 Is there a way to choose an installed font to use as the editor's default font? 有没有办法选择已安装的字体用作编辑器的默认字体?

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. 在弄乱配置文件一段时间后,我发现了如何选择一种未在IDE的字体选择菜单中列出的字体。 This was tested on Windows with NetBeans 6.9.1 and MPLAB X 1.95. 这已在Windows上使用NetBeans 6.9.1和MPLAB X 1.95进行了测试。 (Note: NetBeans 7 has a font chooser.) (注意:NetBeans 7具有字体选择器。)

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. 您可以按照选项1或2打开配置文件,然后参阅最后一节以更改字体。 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 选项1:使用用户目录中的配置文件

  • Close the IDE 关闭IDE
  • Open the fonts and colors configuration file 打开字体和颜色配置文件

MPLAB X MPLAB X

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

NetBeans NetBeans的

/Users/ user /.netbeans/6.9/config/Editors/FontsAndColors/NetBeans/org-netbeans-modules-editor-settings-CustomFontsColors-tokenColorings.xml / Users / 用户 /.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 选项2:使用导出的选项

  • 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 解压缩已创建的zip文件,然后打开配置文件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 重新压缩文件,然后在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. 搜索“对话框”(或之前选择的字体)或“名称=“默认”“,这是fontcolor元素的属性。 There should be a nested element that looks like: 应该有一个看起来像这样的嵌套元素:

<font name="Dialog" size="12"/> <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. IDE重新启动后,应设置所选字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM