Carbon


ATSUSetAttributes

Header: ATSUnicode.h Carbon status: Supported

Sets style run attribute values in a style object.

OSStatus ATSUSetAttributes (
    ATSUStyle iStyle, 
    ItemCount iAttributeCount, 
    ATSUAttributeTag iTag[], 
    ByteCount iValueSize[], 
    ATSUAttributeValuePtr iValue[]
);
Parameter descriptions
iStyle

A reference to a valid style object whose attributes you want to set. You cannot pass NULL for this parameter.

iAttributeCount

The number of attributes you want to set. This value should correspond to the number of elements in the iTag and iValueSize arrays.

iTag

An array of attribute tags. Each element in the array must contain a valid tag that corresponds to the style run attribute value you wish to set. See “Style Run Attribute Tag Constants” for a description of the Apple-defined style run attribute tag constants. If you pass a text layout attribute tag constant or an ATSUI-reserved tag constant in this parameter, ATSUSetAttributes returns the result code kATSUInvalidAttributeTagErr. You cannot pass NULL for this parameter.

iValueSize

An array of attribute value sizes. Each element in the array must contain the size (in bytes) of the corresponding style run attribute value being set. If you pass a size that is less than required, ATSUSetAttributes returns the result code kATSUInvalidAttributeSizeErr, and the function sets no style run attributes. If, after having checked all the given sizes and found them acceptable, ATSUSetAttributes sets style run attributes. You cannot pass NULL for this parameter.

iValue

An array of attribute value pointers. Each pointer in the array must reference an attribute value corresponding to a tag in the iTag array. The value referenced by the pointer must be legal for that tag. If you pass an invalid or undefined value, ATSUSetAttributes returns the result code kATSUInvalidAttributeValueErr. You cannot pass NULL for this parameter.

function result

A result code. If there is a function error, ATSUSetAttributes will not set any attributes in the style object. The result code kATSUNoFontCmapAvailableErr indicates that no 'CMAP' table can be accessed or synthesized for the font. You might get this result code when you try to set the font attribute identified by the tag constant kATSUFontTag. The result code kATSUNoFontScalerAvailableErr indicates that there is no font scaler available for the font.

DISCUSSION

The ATSUSetAttributes function enables you to set multipe style run attribute values in a style object. Any unset style run attributes are assigned the default values described in “Style Run Attribute Tag Constants”.

ATSUSetAttributes may allocate memory in your application heap, unless you designate a different heap by calling the function ATSUCreateMemorySetting.

VERSION NOTES

Available beginning with ATSUI 1.0.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.5 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)