classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

extended peers


From: graydon hoare
Subject: extended peers
Date: 10 Sep 2003 01:36:53 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

hi,

I would like to attach some extra methods to a singleton object of
some sort -- something like Toolkit or GraphicsEnvironment, or a
classpath-specific subclass of these -- to produce peer or peer-like
(native-assisted subclass) objects for use in java2d. in particular:

   - a factory method for producing a "peer" font (or some native
     state, whether or not you call it a peer) using the constructor
     parameters of the java2d "new font model": attribute maps, face
     and family name. as I've already posted, I have a pango-backed
     GdkFont object which does this, but alas you can currently only
     construct it by name. calling new Font(...) doesn't do it.

   - some methods for obtaining precise feedback from the path
     rasterizer, such as hit detection or stroke conversion. 

I know the java designers have currently decided that these things
ought to all be done in "pure java" -- though they appear to be
changing their minds yet again and moving over to hardware openGL --
but I feel it is currently quite restrictive that, for example, we can
have any sort of native-backed Graphics2D we like, on a
toolkit-by-toolkit basis, but we must have only one class in all of
classpath which is built when you ask for a new Font(...).

it would be much nicer if Font's constructor called a factory method
to build an optional peer for the Font. of course, if null is returned
then we can expect the Font to either work in pure java or fail -- as
it currently does -- on certain operations. but the presence of a
peer-like reference and a static factory somewhere would permit
switching around the *entire* java2d vocabulary (paths, images, fonts,
etc), not just the Graphics2D class.

I think these sort of changes will help manage the increasing variety
of java2d implementations we are seeing. do they sound acceptable?

-graydon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]