return CSS.FontSize.sizeValueIndex((int)size) + 1;
}
public AttributeSet addAttribute(final AttributeSet old, final Object key,
final Object value) {
Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
if (cssKey == null || cssKey.getConverter() == null) {
if (key == StyleConstants.Underline
|| key == StyleConstants.StrikeThrough) {
return super.addAttribute(old, CSS.Attribute.TEXT_DECORATION,
createTextDecoration(old, key, value));
}
return super.addAttribute(old, key, value);
}
return super.addAttribute(old, cssKey,
value instanceof PropertyValueConverter
? value : cssKey.getConverter().toCSS(value));
}