Skip to content
madrobby edited this page Sep 13, 2010 · 2 revisions

Welcome to the textorize wiki!

Text attributes that could be supported in the future:

APPKIT_EXTERN NSString *NSFontAttributeName; // NSFont, default Helvetica 12
APPKIT_EXTERN NSString *NSParagraphStyleAttributeName; // NSParagraphStyle, default defaultParagraphStyle
APPKIT_EXTERN NSString *NSForegroundColorAttributeName; // NSColor, default blackColor
APPKIT_EXTERN NSString *NSUnderlineStyleAttributeName; // NSNumber containing integer, default 0: no underline
APPKIT_EXTERN NSString *NSSuperscriptAttributeName; // NSNumber containing integer, default 0
APPKIT_EXTERN NSString *NSBackgroundColorAttributeName; // NSColor, default nil: no background
APPKIT_EXTERN NSString *NSAttachmentAttributeName; // NSTextAttachment, default nil
APPKIT_EXTERN NSString *NSLigatureAttributeName; // NSNumber containing integer, default 1: default ligatures, 0: no ligatures, 2: all ligatures
APPKIT_EXTERN NSString *NSBaselineOffsetAttributeName; // NSNumber containing floating point value, in points; offset from baseline, default 0
APPKIT_EXTERN NSString *NSKernAttributeName; // NSNumber containing floating point value, in points; amount to modify default kerning, if 0, kerning off
APPKIT_EXTERN NSString *NSLinkAttributeName; // NSURL (preferred) or NSString

APPKIT_EXTERN NSString *NSStrokeWidthAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSNumber containing floating point value, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0)
APPKIT_EXTERN NSString *NSStrokeColorAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSString *NSUnderlineColorAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSString *NSStrikethroughStyleAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSNumber containing integer, default 0: no strikethrough
APPKIT_EXTERN NSString *NSStrikethroughColorAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSString *NSShadowAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSShadow, default nil: no shadow
APPKIT_EXTERN NSString *NSObliquenessAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSNumber containing floating point value; skew to be applied to glyphs, default 0: no skew
APPKIT_EXTERN NSString *NSExpansionAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSNumber containing floating point value; log of expansion factor to be applied to glyphs, default 0: no expansion
APPKIT_EXTERN NSString *NSCursorAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSCursor, default IBeamCursor
APPKIT_EXTERN NSString *NSToolTipAttributeName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // NSString, default nil: no tooltip

/* An NSNumber containing an integer value. The value is interpreted as Apple Type Services kCharacterShapeType selector + 1. Default is 0 (disabled), 1 is kTraditionalCharactersSelector and so on. Refer to <ATS/SFNTLayoutTypes.h>
*/
APPKIT_EXTERN NSString *NSCharacterShapeAttributeName;

/* An NSGlyphInfo object. This provides a means to override the standard glyph generation. NSLayoutManager will assign the glyph specified by this glyph info 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 NSFontAttributeName.
*/
APPKIT_EXTERN NSString *NSGlyphInfoAttributeName AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; // NSGlyphInfo specifying glyph for the associated attribute range

/* An NSArray of NSNumbers. This provides a means to override the default bidi algorithm, equivalent to the use of bidi control characters LRE, RLE, LRO, or RLO paired with PDF, as a higher-level attribute. This is the NSAttributedString equivalent of HTML’s dir attribute and/or BDO element. The array represents nested embeddings or overrides, in order from outermost to innermost. The values of the NSNumbers should be 0, 1, 2, or 3, for LRE, RLE, LRO, or RLO respectively; these should be regarded as NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft plus NSTextWritingDirectionEmbedding or NSTextWritingDirectionOverride.
*/
APPKIT_EXTERN NSString *NSWritingDirectionAttributeName AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; // NSArray of NSNumbers, whose values should be NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft plus NSTextWritingDirectionEmbedding or NSTextWritingDirectionOverride

/* Clause segment index NSNumber (intValue). This attribute is used in marked text indicating clause segments.
*/
APPKIT_EXTERN NSString *NSMarkedClauseSegmentAttributeName AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;

/* This defines currently supported values for NSUnderlineStyleAttributeName and NSStrikethroughStyleAttributeName, as of Mac OS X version 10.3. The style, pattern, and optionally by-word mask are or’d together to produce the value. The previous constants are still supported, but deprecated (except for NSUnderlineByWordMask); including NSUnderlineStrikethroughMask in the underline style will still produce a strikethrough, but that is deprecated in favor of setting NSStrikethroughStyleAttributeName using the values described here.
*/
enum {
NSUnderlineStyleNone = 0×00,
NSUnderlineStyleSingle = 0×01,
NSUnderlineStyleThick = 0×02,
NSUnderlineStyleDouble = 0×09
};

enum {
NSUnderlinePatternSolid = 0×0000,
NSUnderlinePatternDot = 0×0100,
NSUnderlinePatternDash = 0×0200,
NSUnderlinePatternDashDot = 0×0300,
NSUnderlinePatternDashDotDot = 0×0400
};

APPKIT_EXTERN NSUInteger NSUnderlineByWordMask;

/* NSSpellingStateAttributeName is used and recognized only as a temporary attribute (see NSLayoutManager.h). It indicates that spelling and/or grammar indicators should be shown for the specified characters.
*/
APPKIT_EXTERN NSString *NSSpellingStateAttributeName AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; // int, default 0: no spelling or grammar indicator

Clone this wiki locally