Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Unicode font implementation

Thread view: 
Steve - 12 Oct 2005 03:42 GMT
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
Roedy Green - 12 Oct 2005 09:27 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Chris Uppal - 12 Oct 2005 10:06 GMT
> 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
Thomas Fritsch - 12 Oct 2005 15:52 GMT
Steve schrieb:
> Previously I was trying to read a unicode file (with Arabic/Farsi
> characters) and display the characters in a mobile device (I was
[quoted text clipped - 9 lines]
> 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,%20jav
a.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.

> 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.

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.