在Java小程序绘制异国情调的字体 [英] Drawing exotic fonts in a java applet
问题描述
我想提请包含在异国情调的字体,如宋体,Webdings符号(他们被称为装饰: http://en.wikipedia.org/wiki/Dingbat )的Java小程序。当使用Graphics.drawString()我最终的绘制字符串中的每个字符的典型框选。我无法使用Google所找到任何答案,我想这不是共同的东西。
I'd like to draw symbols contained in exotic fonts such as Wingdings, Webdings (they are called dingbats : http://en.wikipedia.org/wiki/Dingbat) in a java applet. When using Graphics.drawString() I end up with the typical 'square symbol' for each character in the drawn string. I could not find any answer by googling and I guess it's not something common.
在过去,我用C#WPF做到了,失败,SVG和HTML做。是否有可能在Java?
In the past I've done it with C# WPF, failed to do it with SVG and HTML. Is it possible in java?
编辑:解决。有一个细微之处。即使你在这样的字体要的符号链接到字符'A'
,它实际上是必要通过\\ uF061
来g.drawString(),而不是一
。否则,你最终与方形标志。
Solved. There was a subtlety. Even though the symbol you want in such a font is linked to character 'a'
, it is in fact necessary to pass "\uF061"
to g.drawString() and not "a"
. Otherwise you end up with the square symbol.
推荐答案
解决。即使在这样的字体所需符号链接到字符'a',它实际上是在必要通过\\ uF061来g.drawString()和不是a。否则,你最终与方形标志。
Solved. Even though the symbol you want in such a font is linked to character 'a', it is in fact necessary to pass "\uF061" to g.drawString() and not "a". Otherwise you end up with the square symbol.
这篇关于在Java小程序绘制异国情调的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!