Java GUI中的日语字体 [英] Japanese fonts in a Java GUI

查看:89
本文介绍了Java GUI中的日语字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以用Java编写可以正确显示日语字体的GUI,而与运行该操作系统的语言设置无关?

Is it possible to write a GUI in Java that would display Japanese fonts correctly regardless of the language settings of the OS it's being run on?

我想编写一个能够执行此操作的程序,但是我不确定如何开始执行此操作.任何建议将是一个巨大的帮助!

I'd like to write a program which is able to do this but I'm not sure how to start going about this. Any advice would be a huge help!

推荐答案

此处的语言设置不是问题.字体是.

The language settings aren't the problem here. Fonts are.

如果开发人员不陷入使用FileReadernew String(byte[])之类的依赖于平台默认编码的陷阱,那么无论系统设置如何,Java都可以处理日语文本.

Java certainly can handle Japanese text, no matter what the system settings are, if the developer doesn't fall into the trap of depending on the platform default encoding by using things like FileReader, or new String(byte[]).

但是要实际显示日语文本,您需要一种具有日语字符的字体,并且该字体不是Java的一部分.视操作系统而定,支持日语的字体可能是默认安装的一部分,或者可能会提示用户根据需要安装它们,或者可能必须手动安装它们.

But to actually display the Japanese text, you need a font that has Japanese characters, and fonts are not part of Java. Depending on the OS, Japanese-capable fonts may be part of the default installation, or the user may be prompted to install them as needed, or they may have to be installed manually.

这篇关于Java GUI中的日语字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆