문제

I'm making a program that should be as platform independent as possible. I'm using the Nimbus LAF.

I was wondering, should I be worried about fonts? Is it's default font included in the LAF itself or does it fetch it from the platform?

도움이 되었습니까?

해결책

It's a default non-system font.

If you have a frame, and you add this line after frame.setVisible(true):

System.out.println("Font: "+frame.getFont().getName());

It should print Font: Dialog which is not a system font. So it should be a proprietary cross-platform font.

So, to answer your question:

Should I be worried about fonts?

No, unless:

  1. You use the system look and feel, which uses the system default font
  2. You use another look and feel which uses the system default font
  3. You use a custom font (a custom system font, because if you load a font you saved in the application resources it won't be a problem)

If you are doing none of the three listed above, you should be safe.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top