apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.67k stars 855 forks source link

Netbeans Font Chooser support for variable fonts #7636

Open caldy2000 opened 3 months ago

caldy2000 commented 3 months ago

Description

Case

this is my first time use of NetBeans, i want to change the font of edior, screenshot is: image

the default category maybe can change most font settings, the 'inherited' word maybe indicates that.

And i have installed a font names 'source code pro', downloaded from google font. It is a variable font, such as source code pro extralight, source code pro regular, source code pro bold. Font detail from windows settings as: image-2

I found that Netbeans seems like it cant recognize other source code pro fonts, it can only see the first of them ordered by some rules, in my case , it is source code pro extralight, maybe sort by Windows internal feature or something ,i don't know much about this.

i tried to export configuration to a zip file, and replace the file content contains source code pro extralight to source code pro regular, and re-zip directories what extracted before, import it back, and Netbeans report invalid zip file ***, maybe the font i expect couldn't work or re-zip has errors?

Compare to Eclipse font chooser

image

Suggest

If it possible, Netbeans could support font which is a variable font, the font list could list them all, or the font style could do the same thing.

I guess there is another solution for making font that i want to use works, that is uninstall other source code pro font, leave the one i prefer, maybe netbeans could see it.

Use case/motivation

Related issues

No response

Are you willing to submit a pull request?

No

mbien commented 3 months ago

hi @caldy2000. I happen to use the same font and it works fine for me. It is one of the default fonts of manjaro linux, so I didn't have to install anything.

image

neilcsmith-net commented 3 months ago

@mbien at a guess you're using the static vs variable font variant? I'm curious what the AWT support is like for these.

mbien commented 3 months ago

@neilcsmith-net "Source Code Pro" is a font made for code, it is a monospaced font like all IDE fonts. image

https://fonts.google.com/specimen/Source+Code+Pro?preview.text=public%20void%20main(String...%20args)%20%7B%7D

neilcsmith-net commented 3 months ago

@mbien I'm aware what it is! :stuck_out_tongue_winking_eye: Have you downloaded the zip from there? You'll find static fonts (separate files for each weight) and a variable font (all weight variants in a single file). I'm not sure we support the latter?

eg. https://fonts.google.com/knowledge/introducing_type/introducing_variable_fonts

mbien commented 3 months ago

It must be the non-variable version of the font then.

i haven't downloaded anything, it was preinstalled out of the box, the package is called "adobe-source-code-pro-fonts":

https://github.com/adobe-fonts/source-code-pro

tree /usr/share/fonts/adobe-source-code-pro/
/usr/share/fonts/adobe-source-code-pro/
├── fonts.dir
├── fonts.scale
├── SourceCodePro-BlackIt.otf
├── SourceCodePro-Black.otf
├── SourceCodePro-BoldIt.otf
├── SourceCodePro-Bold.otf
├── SourceCodePro-ExtraLightIt.otf
├── SourceCodePro-ExtraLight.otf
├── SourceCodePro-It.otf
├── SourceCodePro-LightIt.otf
├── SourceCodePro-Light.otf
├── SourceCodePro-MediumIt.otf
├── SourceCodePro-Medium.otf
├── SourceCodePro-Regular.otf
├── SourceCodePro-SemiboldIt.otf
├── SourceCodePro-Semibold.otf
├── SourceCodeVF-Italic.otf
└── SourceCodeVF-Upright.otf
neilcsmith-net commented 3 months ago

From what I can tell, this is an AWT limitation. There's an open issue for IntelliJ for variable fonts too. Pending JDK support, I think you'll have to install the static font variant(s) you want instead @caldy2000

caldy2000 commented 3 months ago

Hello, @neilcsmith-net @mbien , this is my new try:

  1. clear source code from Windows
  2. install static font file one by one, i choosed 'regular' and 'medium', restart Netbeans

    i can see there lists source code pro and source code pro medium, actually, i installed

    • scp regular
    • scp bold
    • scp italic
    • scp medium

    these four

  3. it works as @neilcsmith-net says, and looks similar to @mbien

I know how to use it now, thanks for your @mbien @neilcsmith-net help.Have a nice day!