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 firstname.lastname@example.org and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
email@example.com and include in the body of the message "help".
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.