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 / GUI / November 2005

Tip: Looking for answers? Try searching our database.

Font File Requirements for Font.createFont?

Thread view: 
Rainer Schwarze - 31 Oct 2005 21:44 GMT
Hi,

I try to use specific symbols which I preferably would like to take from
a TrueType font. So with the wealth of the internet, I took a look at
fontforge and simply speaking: I am not able to produce a TrueType font
which gives me more than little gray dots in Java. The font can be used
well in - say - Winword. But in Java it does not work. (I already know,
that Winword uses some proprietary things to and that Java needs proper
Unicode fonts, so the Winword test is not truly good, but at least I get
one program to correctly display the symbols.)

Well, can anybody give me a hint where I should look for information
regarding "custom fonts" in Java? Is there a tutorial or another article
which I just missed during my last "google/sun sessions"?

For instance I wonder whether I need to include a minimum set of glyphs
so that "Java thinks" it is a usable font, or...?

Thanks in advance.
Best wishes,
Rainer
Signature

Rainer Schwarze (Mr.) -- remove .nospam for email

Roedy Green - 31 Oct 2005 23:38 GMT
On Mon, 31 Oct 2005 21:44:07 +0100, Rainer Schwarze
<rsc.nospam@nospam.q-17.de> wrote, quoted or indirectly quoted someone
who said :

>I am not able to produce a TrueType font
>which gives me more than little gray dots in Java.

With my experiments with FontShower it look to me the fonts that don't
work tend to have custom weird mappings of a fairly small set of
characters onto 8-bit character numbers.

I suspect you need:
1. a unicode font map
2. 16 bit support
3. TrueType/OpenType recent version format.

One way to tackle this would be to look for some sort of fontInfo
utility that tells you facts about a font. Then look at which ones
work and which don't.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Rainer Schwarze - 01 Nov 2005 09:15 GMT
> On Mon, 31 Oct 2005 21:44:07 +0100, Rainer Schwarze
> <rsc.nospam@nospam.q-17.de> wrote, quoted or indirectly quoted someone
[quoted text clipped - 15 lines]
> utility that tells you facts about a font. Then look at which ones
> work and which don't.

Thanks for the info.
I will go in that direction.
However, I would have expected, that choosing "Unicode" and "TrueType"
in the font creation programs which I could try out produces "correct"
settings, but since I am a complete newbie for fonts ... well... (Looks
like thats a topic where the planned amount of work was slightly
underestimated :-) )

Best wishes,
Rainer
Signature

Rainer Schwarze (Mr.) -- remove .nospam for email

Rainer Schwarze - 01 Nov 2005 10:16 GMT
> On Mon, 31 Oct 2005 21:44:07 +0100, Rainer Schwarze
> <rsc.nospam@nospam.q-17.de> wrote, quoted or indirectly quoted someone
> who said :
>
>>I am not able to produce a TrueType font
>>which gives me more than little gray dots in Java.

[snip]
> One way to tackle this would be to look for some sort of fontInfo
> utility that tells you facts about a font. Then look at which ones
> work and which don't.

I found another way to tackle my problem :-)
I should rtfm again. And although knowing the evils of copy&paste, check
that too.

After copying & pasting around a while I simply messed up the part of my
code that provides the actual font size by a call to deriveFont. So all
my fonts appeared with size 1 which perfectly explains the little gray
dots. Sorry for bothering you - my fault. Everything seems to work well now.

Best wishes,
Rainer
Signature

Rainer Schwarze (Mr.) -- remove .nospam for email



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.