简体   繁体   English

如何更改 netbeans 平台中的默认字体?

[英]How to change default font in netbeans platform?

I'd like to know how to change the default font used in netbeans platform.我想知道如何更改 netbeans 平台中使用的默认字体。 I'm not asking for changing the font in the Netbeans IDE but in the platform , then all my derived applications would use this default font.我不是要求在Netbeans IDE 中更改字体,而是在平台中更改字体,然后我所有的派生应用程序都将使用此默认字体。

A netbeans application is a group of Jcomponent so i could easily set the font of each of those components but there is still things like notifications that i can't access directly to change the font, so i think the best would be to change the font by default. netbeans 应用程序是一组Jcomponent,因此我可以轻松设置每个组件的字体,但仍然存在诸如通知之类的内容,我无法直接访问以更改字体,因此我认为最好的方法是更改​​字体默认情况下。 Programmaticaly or any other way... maybe editing one the jar?以编程方式或任何其他方式......也许编辑一个罐子?

type and size of Font are diferrent by platform and used Look and Feel , there are these possibilities Font类型和大小因platform和使用的Look and Feel ,有这些可能性

and/or with和/或与

or要么

have look at UImanager default by @camickr看看@camickr 默认的 UImanager

If you are looking to change the 'editor' fonts in platform applications , (i do use some of NB editors in my platform application), here is the way.如果您想更改平台应用程序中“编辑器”字体(我确实在我的平台应用程序中使用了一些 NB 编辑器),这里是方法。

create a file org-netbeans-modules-editor-settings-CustomFontsColors.xml with the following contents,使用以下内容创建一个文件org-netbeans-modules-editor-settings-CustomFontsColors.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN" "http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">
<fontscolors>
    <fontcolor bgColor="white" foreColor="black" name="default">
        <font name="Noto Serif CJK JP" size="15"/>
    </fontcolor>
</fontscolors>

and in your layer.xml file,在你的 layer.xml 文件中,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
     <folder name="Editors">
        <folder name="NetBeans">
            <folder name="Defaults">
                <file name="defaultColoring.xml" url="org-netbeans-modules-editor-settings-CustomFontsColors.xml"/>
            </folder>
        </folder>
     </folder>
</filesystem>

That's all.就这样。

PS: You can also check the source here PS:你也可以在这里查看源码

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

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