public static AffineTransform getCharTransform(Map<?, ?> map) { if (map != null) { AttributeValues av = null; if (map instanceof AttributeMap && ((AttributeMap) map).getValues() != null) { av = ((AttributeMap) map).getValues(); } else if (map.get(TextAttribute.TRANSFORM) != null) { av = AttributeValues.fromMap((Map<Attribute, ?>) map); // yuck } if (av != null) { return av.charTransform; } } return null; }