| Framework | ApplicationServices/CoreText |
| Declared in | CTStringAttributes.h |
This reference document describes the attributes to which Core Text responds when the attributes are placed in a CFAttributedString object.
These constants represent string attribute names.
const CFStringRef kCTFontAttributeName; const CFStringRef kCTKernAttributeName; const CFStringRef kCTLigatureAttributeName; const CFStringRef kCTForegroundColorAttributeName; const CFStringRef kCTParagraphStyleAttributeName; const CFStringRef kCTUnderlineStyleAttributeName; const CFStringRef kCTVerticalFormsAttributeName; const CFStringRef kCTGlyphInfoAttributeName;
kCTFontAttributeNameThe font of the text to which this attribute applies. The value associated with this attribute must be a CTFont object. Default is Helvetica 12.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTKernAttributeNameThe amount to kern the next character. The value associated with this attribute must be a CFNumber float. Default is standard kerning. The kerning attribute indicates how many points the following character should be shifted from its default offset as defined by the current character's font in points: a positive kern indicates a shift farther away from and a negative kern indicates a shift closer to the current character. If this attribute is not present, standard kerning is used. If this attribute is set to 0.0, no kerning is done at all.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTLigatureAttributeNameThe type of ligatures to use. The value associated with this attribute must be a CFNumber object. Default is an integer value of 1. The ligature attribute determines what kinds of ligatures should be used when displaying the string. A value of 0 indicates that only ligatures essential for proper rendering of text should be used. A value of 1 indicates that standard ligatures should be used, and 2 indicates that all available ligatures should be used. Which ligatures are standard depends on the script and possibly the font. Arabic text, for example, requires ligatures for many character sequences but has a rich set of additional ligatures that combine characters. English text has no essential ligatures, and typically has only two standard ligatures, those for "fi" and "fl"—all others are considered more advanced or fancy.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTForegroundColorAttributeNameThe foreground color of the text to which this attribute applies. The value associated with this attribute must be a CGColor object. Default value is black.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTParagraphStyleAttributeNameThe paragraph style of the text to which this attribute applies. A paragraph style object is used to specify things like line alignment, tab rulers, writing direction, and so on. Value must be a CTParagraphStyle object. Default is an empty CTParagraphStyle object. See CTParagraphStyle Reference for more information.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlineStyleAttributeNameThe style of underlining, to be applied at render time, for the text to which this attribute applies. Value must be a CFNumber object. Default is kCTUnderlineStyleNone. Set a value of something other than kCTUnderlineStyleNone to draw an underline. In addition, the constants listed in “CTUnderlineStyleModifiers” can be used to modify the look of the underline. The underline color is determined by the text's foreground color.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTVerticalFormsAttributeNameThe orientation of the glyphs in the text to which this attribute applies. Value must be a CFBoolean object. Default is False. A value of False indicates that horizontal glyph forms are to be used; True indicates that vertical glyph forms are to be used.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTGlyphInfoAttributeNameThe glyph info object to apply to the text associated with this attribute. Value must be a CTGlyphInfo object. The glyph specified by this CTGlyphInfo object is assigned to the entire attribute range, provided that its contents match the specified base string and that the specified glyph is available in the font specified by kCTFontAttributeName. See CTGlyphInfo Reference for more information.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
CTStringAttributes.hUnderline style specifiers.
enum{
kCTUnderlineStyleNone = 0x00,
kCTUnderlineStyleSingle = 0x01,
kCTUnderlineStyleThick = 0x02,
kCTUnderlineStyleDouble = 0x09
};
typedef int32_t CTUnderlineStyle;
kCTUnderlineStyleNoneDo not draw an underline.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlineStyleSingleDraw an underline consisting of a single line.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlineStyleThickDraw an underline consisting of a thick line.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlineStyleDoubleDraw an underline consisting of a double line.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
These underline type specifiers can be applied to the value set with the kCTUnderlineStyleAttributeName attribute to control the underline style Core Text uses when rendering the text to which the attribute applies.
CTStringAttributes.hUnderline style modifiers.
enum{
kCTUnderlinePatternSolid = 0x0000,
kCTUnderlinePatternDot = 0x0100,
kCTUnderlinePatternDash = 0x0200,
kCTUnderlinePatternDashDot = 0x0300,
kCTUnderlinePatternDashDotDot = 0x0400
};
typedef int32_t CTUnderlineStyleModifiers;
kCTUnderlinePatternSolidDraw a solid underline.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlinePatternDotDraw an underline using a pattern of dots.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlinePatternDashDraw an underline using a pattern of dashes.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlinePatternDashDotDraw an underline using a pattern of alternating dashes and dots.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
kCTUnderlinePatternDashDotDotDraw an underline using a pattern of a dash followed by two dots.
Available in Mac OS X v10.5 and later.
Declared in CTStringAttributes.h
Set these bits with the underline style (see “CTUnderlineStyle”) that you set with the kCTUnderlineStyleAttributeName attribute to modify how the underline will be drawn.
CTStringAttributes.h
Last updated: 2007-05-01