On Tue, Jun 20, 2006 at 07:41:32PM -0700, douglas felt wrote:
> Have you filed RFE's for the features you had to implement yourself?

Not yet, but I'll try to put something together.

The worst part is that there is no way to work backwards from the
GlyphVectors to the associated range in the AttributedString. If there
was, and custom Attributes affected the division of the string into
GlyphVectors, then you could just check "is the range this GlyphVector
comes from tagged with my custom shadow Attribute?".

As it is, I need to create a completely separate AttributedString, and
overload an existing attribute like FOREGROUND. Then, in the Graphics2D
proxy, I keep track of the current Paint and if it matches the one that
actually means "shadow" I override the color, offset the GlyphVector,
etc. This also means that the line breaking algorithm has to run twice,
for each of the AttributedStrings (there is no way to duplicate a
TextLayout but tell it to use different styles).

For other attributes the hacks are even worse. For example I need to
support superscripting as a percentage of line height, without affecting
the font size (it only acts as a vertical offset). Currently I have to
"tunnel" the amount of superscripting via the alpha channel of the
foreground color :-P

Chris

===========================================================================
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