Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to specify font-path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to specify font-path



on 10/15/03 3:51 PM, Greg Guerin <email@hidden> went on and on saying,
in part:

>> I understand that I want to instantiate a Font object, what I'm not clear on
>> is how I specify that:
>>
>> Font thatFont = new Font ("MyFont", Font.PLAIN, 12);
>>
>> should look for "MyFont" in the app's .jar file (or a separate one, I'm not
>> that way), rather than in the system font path.

> AFAIK, Java does not offer that capability. Fonts and font-management are
> platform-dependent.

Well, I knew that font-management, itself, was system-dependant, but I
thought I might be able to tell the Font class to read its data from
app-supplied data, vice the system. Oh well.

[...]
> Or you could distribute a specific PS font (or TT font) file with your
> application, and install it when the user installs the application.

Yeah... That seems more heavy-handed than I'd hoped for, but it may come to
that. Alternately, I could have a separate download and "if you don't like
the way things look, try installing <this font>" on the web page.

Still ugly, but that may be as good as it gets.

> Even with an identical font, however, a font-renderer can use or ignore
> font-rendering hints on different platforms. For example, kerning,
> tracking, fractional-metrics, and anti-aliasing all come into play in how a
> font gets turned into pixels. And only some of those are accessible to
> Java.

Bleh. Given that these aren't REALLY text/words, but just graphical objects
that LOOK like words (i.e., a graphical "the"), I suppose I might be able to
include an image of a font (as an actual image, like a .gif), and pull the
bits I need to render it. Then my "MyFont" class could do "word-length"
operations, etc.

Boy, it just looks like any way I go it's going to be ugly. I hate choosing
between the least ugly of choices... :\

---

And then, moments later...

> What *WAS* I thinking.
> See Font.createFont(). It exists since 1.3.

Ex*ACT*ly what I was looking for. You are my new bestest-friend-ever! <G>

Thanks!

(And why didn't *I* see that? <sigh...>)
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How to specify font-path (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.