Unicode font implementation

S

Steve

Hi,

Previously I was trying to read a unicode file (with Arabic/Farsi
characters) and display the characters in a mobile device (I was
developing the application in J2ME).

I discovered (thanks to this forum) that the device must support the
font or else the text cannot be displayed.

I am now interested in another expirement (something someone hinted some
time ago). Creating my own bitmap font implementation and using that to
display characters (by drawing them using graphic methods). However, I
am completely clueless as to where to start. I know this is not a Font
forum but if anyone could help me with some direction as to where I
should start. How does one create bitmap fonts in Java and how do I
translate unicode characters to bitmap implementations.

Any example or code would be much, much, much appreciated. Also, what is
the best way of encoding a file with Farsi/Arabic text? I don't want
people to be able to unjar my .jar file and simply read of text easily
from the files.

Please, any help would be much appreciated.

regards,
Steve
 
R

Roedy Green

How does one create bitmap fonts in Java and how do I
translate unicode characters to bitmap implementations.

Java does not have platform independent bitmap fonts. The best you
could hope for is to create a font for a particular OS, and see if you
could get Java to use it.

if you look at http://mindprod.com/applets/fontshowerawt.html

You will see all the fonts Java supports on your desktop PC. You will
notice there are no bitmap or vector fonts listed. This does not bode
well for your quest.

Further a bit map font is about 64K. This is quite a luxury in terms
of RAM use.

You might start at http://mindprod.com/jgloss/font.html
and chase links to font creating tools. Perhaps one lets you create
the font in a bit map format or convert a TTF into a bit map.

You can read about how you used to add fonts to desktop java. Perhaps
the scheme for JME is similar if it is allowed at all.

Worse comes to worse, you tile little bit map images.

Another approach is to look for a phone that has firmware with a
suitable font already burned in.
 
C

Chris Uppal

Steve said:
How does one create bitmap fonts in Java and how do I
translate unicode characters to bitmap implementations.

I don't know about bitmaps, but the Unicode website:

http://www.unicode.org/

has full details of how to go from Unicode character sequences to something
that will make sense on-screen to a native reader. Be warned that it is /not/
simple.

-- chris
 
T

Thomas Fritsch

Steve said:
Previously I was trying to read a unicode file (with Arabic/Farsi
characters) and display the characters in a mobile device (I was
developing the application in J2ME).

I discovered (thanks to this forum) that the device must support the
font or else the text cannot be displayed.

I am now interested in another expirement (something someone hinted some
time ago). Creating my own bitmap font implementation and using that to
display characters (by drawing them using graphic methods). However, I
am completely clueless as to where to start. I know this is not a Font
forum but if anyone could help me with some direction as to where I
should start. How does one create bitmap fonts in Java ...
AFAIK Java has no concept of bitmap fonts. The only font types supported
are TrueType and (since Java1.5) Type1. See
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html#createFont(int, java.io.InputStream)>
Furthermore: Class java.awt.Font by itself is totally
platform-independent, as can be seen from its source. It delegates all
the work to class sun.awt.font.NativeFontWrapper. Hence I'm quite sure
there is no way to extend it for support of bitmap fonts.
... and how do I
translate unicode characters to bitmap implementations.
I personally would opt for searching/creating a TrueType-font supporting
the Farsi/Arabic characters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top