Java是否可以使用PCF字体? [英] Does Java work with PCF fonts?

查看:258
本文介绍了Java是否可以使用PCF字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让IBM jre在Linux机器上使用默认的X11安装中的PCF字体。特别是adobe-helvetica字体。我已经玩弄修改jre / lib文件夹中的fontconfig.properties,但不管我做什么Java接缝使用一些其他的字体。我想有一些算法,即使在配置中指定的字体不能使用的情况下,java VM也会尝试将java逻辑字体链接到系统中的实际物理字体。在Windows上,它是非常简单的,但在Linux上,我无法使用除TrueType字体之外的任何东西。

有人在Linux上配置IBM jre的字体经验吗?

解决方案

PCFFont包 a>似乎提供了使用来自Java的PCF字体的能力。不幸的是,我认为它是通过一个不扩展java.awt.Font类的自定义PCFFont类来实现的,所以我认为它的用处可能是有限的。但是,它可能会给出一些指针来实现编写可以处理PCF字体的Font的自定义子类的实现细节。查找源代码并不明显,代码确切的类是这里



我想说作者似乎有点困惑,因为他谈到了将TrueType字体转换为PCF,所以你可以在库中使用它们,而且Java本身已经支持TrueType字体。但是他似乎是来自Sun的工程师,所以也许他比我想象的更多。另外,这可能只是过时了(Java有没有支持过TrueType?)。

I am trying to make IBM jre to use PCF fonts from default X11 installation on my linux box. In particular adobe-helvetica font. I have toyed to modify fontconfig.properties in jre/lib folder but no matter what I do Java seams to use some other fonts. I guess there is some algorithm how java VM tries to link java logical fonts to actual physical fonts in the system even in case when font specified in config could not be used. On Windows it is pretty straight forward, but on Linux I was unable to make it work with anything except TrueType fonts.
Anybody have experience with configuring fonts on IBM jre on Linux?

解决方案

The PCFFont package seems to provide the ability to use PCF fonts from Java. Unfortunately I think it does so with a custom PCFFont class which does not extend the java.awt.Font class, so I would say its usefulness is probably limited. However, it might give some pointers to implementation details for writing a custom subclass of Font which can handle PCF fonts. Finding the source code isn't immediately obvious; code for that exact class is here.

I would say the author seems a little confused, because he talks about converting TrueType fonts to PCF so you can use them with his library, and Java already supports TrueType fonts natively. But he appears to be an engineer from Sun, so maybe he knew more than I think; also, this could just be very out of date (was there ever a time when Java didn't support TrueType?).

这篇关于Java是否可以使用PCF字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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