On Mon, 27 Oct 2003, Tom Phelps wrote:

> The method
> GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamily
> Names() seems relatively slow.  Does Java rely on the native OS to
> supply this information, or does Java iterate over the font files and
> open each to extract the family and font name (which are different than
> the filename).

Since 1.4 java uses own rasterizer and do not rely on OS to process font
files.

> If Java is in control of obtaining this information itself by opening
> font files, one way to speed it up is to cache in a simple text file
> the file names, the file mod times and the extracted font and family
> names.  Once this information is computed, only new and changed font
> files would need to be opened and parsed.

Well, caching probably will speed it up but
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()
is not supposed to be used often. And if font is gonna to be used it will be
parsed in any case - so caching only font/family names will not help at all.

-igor

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to