Skip to main content

[JAVA2D] Using GlyphVectors

1 reply [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Doug Felt @ Sun


Peter B. West wrote:
> I have a related question about the font applying to these operations
> which I will post later, but I may I assume that setting the FONT
> attribute in the attributes map will be treated as described in the
> documentation on that attribute?
I'm not sure if Phil answered this part of your questions. All text
layout and rendering operations treat the attributes as described in the
TextAttribute docs (where the docs are correct :-)

In regards to FONT, setting a FONT attribute completely overrides
certain other 'core' attributes in the map. In Java 5, Font can only
hold a subset of the attributes (FAMILY, WEIGHT, WIDTH, POSTURE, SIZE,
TRANSFORM, and SUPERSCRIPT). All of these override these attributes if
they are also specified in the Map that contains the FONT attribute. In
Java 6, Font can hold all the defined attributes, and new attributes are
added for TRACKING and LIGATURES. To maintain compatibility, the
override behavior of the FONT attribute is restricted to the same
original attributes (plus the new TRACKING attribute).

Basically, if you specify a FONT in any of the APIs that permit it (in
AttributedString, in a Map used to create a TextLayout, in
Font.deriveFont or getFont) that font will get used. By providing a
FONT you are overriding our default selection of a font based on the
attributes and text.


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