Fonts Mac OS java

R

Roedy Green

So my question is how to make this font working?

see http://mindprod.com/jgloss/opentype.html
and follow the link to the spec on font formats.

For general Mac use, you would want a Mac font map, but for Java use a
Unicode one, same as for use on Windows. That tends to indicate lack
of an encoding vector is not the problem.

I would like to find a utility to display the font meta-information.

I have written two to display installed fonts. See
http://mindprod.com/applets/fontshower.html
http://mindprod.com/applets/fontshowerawt.html
 
J

janek

Hi,

I have a following problem.I need to use external ttf font in java on
Mac Computer.I have installed it on system using fontbook.Installed font
is visible to standard mac applications word,textedit etc. but when I
run java program the font is being replaced by some other font.On
another PC machine with windows XP font is proper.

I.ve done some research through google and I think it is about logical
and physical font mappings, but there is no font.properties file on Mac.
The reason is maybe also that I have java SDK on ma windows PC and only
JRE on Mac, but I don't want to force my client to install SDK.
I also found in some documents that MAC don't use font.properties file.
The documents I've read were very vague and maybe obsolete (2000).

So my question is how to make this font working?

Thanks for help in advance.
 
J

janek

Roedy said:

Thx, but not solution for my problem.As I mentioned the font I want to
use is visible for java (also in Combobox on your applet) but it doesn't
look like it should look.

When I switch to my desired font in combobox on your applet the font
looks the same as the previous one in the list (No change). When I
switch to any other font 'visual alpahbet presentation' changes.

So I ask the question once more "How to make this font look the same as
in normal applications(word,textedit etc.) in java applications ?"
 
R

Roedy Green

Thx, but not solution for my problem.As I mentioned the font I want to
use is visible for java (also in Combobox on your applet) but it doesn't
look like it should look.

When I switch to my desired font in combobox on your applet the font
looks the same as the previous one in the list (No change). When I
switch to any other font 'visual alpahbet presentation' changes.

So I ask the question once more "How to make this font look the same as
in normal applications(word,textedit etc.) in java applications ?"

"look different" is not much a clue. Perhaps what you are referring
to is anti-aliasing. Have you played with anti-aliasing on the two
Applets I gave you to see if they make the font appear the way you
expect?

Perhaps you are not successfully setting the font. Try dumping the
font name with System.out.println( component.getFont() ). Perhaps you
are not getting it because you spelling it with a tiny error.
 
J

janek

"look different" is not much a clue. Perhaps what you are referring
to is anti-aliasing. Have you played with anti-aliasing on the two
Applets I gave you to see if they make the font appear the way you
expect?

Font I want to use is Orator10EU and what I get is Optima.
Every child can see a difference.
Perhaps you are not successfully setting the font. Try dumping the
font name with System.out.println( component.getFont() ). Perhaps you
are not getting it because you spelling it with a tiny error.

I don't have to set this font. As I wrote also in your applet and any
java application (ex. ireport) when I choose my font(orator) it looks
like optima.So it is JVM issue, not my application.
 
R

Roedy Green

Font I want to use is Orator10EU and what I get is Optima.
Every child can see a difference.

Yet when you go into control panel fonts they appear just fine?

I would try uninstalling both fonts, and reinstalling just one to see
what happens.

Also look for any other fonts that might be being confused for these
two.

You may have a corrupt font cache or font install.
 
J

janek

Thx for your assistance. The problem is more complex and relates many
font on Mac Os. It's about name convention on Mac Os.Some font during
loading (from system or with createFont() from file ) are getting
additional suffix to font name realating to font attributes, so my font
is 'orator15U-Normal' on MAC but it is 'orator15U Normal' on windows PC.
I checked it twice, when I change its name (in my code ) to
'orator15U-Normal' font is displayed properly.

But if i change my code to set 'orator15U Normal' it won't work on win
PC (I checked it). I haven't found a solution yet.
 
S

steve

Thx for your assistance. The problem is more complex and relates many
font on Mac Os. It's about name convention on Mac Os.Some font during
loading (from system or with createFont() from file ) are getting
additional suffix to font name realating to font attributes, so my font
is 'orator15U-Normal' on MAC but it is 'orator15U Normal' on windows PC.
I checked it twice, when I change its name (in my code ) to
'orator15U-Normal' font is displayed properly.

But if i change my code to set 'orator15U Normal' it won't work on win
PC (I checked it). I haven't found a solution yet.

then check what platform you are running on and change the name of the font
depending on that.
 
J

janek

steve said:
then check what platform you are running on and change the name of the font
depending on that.

How ? As far I know ,I cannot 'globaly register' font on different
method createFont(..) registers font but it uses ttf platform specific
name and deriveFont(..) allows you to change this name but it return
only local Font object which is not visible to
GraphicsEnvironment.getLocalGraphicsEnviroment().getAllFonts() method.
There is no way to register this local Font.

But I cannot use this local Font, becausue third-party software I use
in my project needs to get this font from global fonts.

I posted new message to the group some days ago about this case,but no
answer yet. So I doubt it is possible at all. So java is platform
portable on condition that you prepare different version for each
platform :).
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top