Attribute key for the transform of a font. Values are
instances of TransformAttribute
. The
default value is TransformAttribute.IDENTITY
.
The TransformAttribute
class defines the
constant IDENTITY
.
This corresponds to the transform passed to
Font.deriveFont(AffineTransform)
. Since that
transform is mutable and TextAttribute
values must
not be, the TransformAttribute
wrapper class is
used.
The primary intent is to support scaling and skewing, though other effects are possible.
Some transforms will cause the baseline to be rotated and/or shifted. The text and the baseline are transformed together so that the text follows the new baseline. For example, with text on a horizontal baseline, the new baseline follows the direction of the unit x vector passed through the transform. Text metrics are measured against this new baseline. So, for example, with other things being equal, text rendered with a rotated TRANSFORM and an unrotated TRANSFORM will measure as having the same ascent, descent, and advance.
In styled text, the baselines for each such run are aligned
one after the other to potentially create a non-linear baseline
for the entire run of text. For more information, see TextLayout.getLayoutPath
.
TransformAttribute, java.awt.geom.AffineTransform
Diagram: CharacterIterator