PTTextStyleRule Class Reference
| Inherits from | NSObject |
| Declared in | PTTextStyleRule.h |
Overview
@enum TextStyleRuleKey These constants represent text style attribute keys that form the dictionary of rules.
Tasks
backgroundColor
-
backgroundColorThe background color for the shape holding the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
property
foregroundColor
-
foregroundColorThe foreground color of the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
property
bold
-
boldBoolean representing the bold style setting of the text. Default value is No.
property
italic
-
italicBoolean representing the italic style setting of the text. Default value is No.
property
underLine
-
underLineBoolean representing the underline style setting of the text. Default value is No.
property
font
-
fontNSString representing the name of the text font. Value is an NSString holding the family name of font set. (e.g., “Helvetica”)
property
size
-
sizeThe font size expressed as a percentage of the current default font size. Value returned is a non negative CFNumber holding the current percentage of the size of the calculated default font size. A value of 120 indicates 20% larger than the default font size. A value of 80 indicates 80% of the default font size. The value 100 indicates no size difference and is the default.
property
Setting Text Style Rules
-
– setTextStyleRulesDictionary:textSelector:- Creates a new TextStyleRule dictionary.
- @param combinedRules A dictionary of style attributes with TextStyleRuleKey keys and corresponding values. *
- Key Value Expected *
- kTextStyleKey_BackgroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_ForegroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_FontFamilyName NSString holding the family name of an installed font
(e.g., "Helvetica") that is used to render and/or measure text.*
- kTextStyleKey_BoldStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with a bold style.*
- kTextStyleKey_ItalicStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an italic style.*
- kTextStyleKey_UnderlineStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an underline style.*
- kTextStyleKey_RelativeFontSize Value must be a non-negative NSNumber. This is a number holding a
percentage of the size of the calculated default font size. A valueof 120 indicates 20% larger than the default font size. A value of 80indicates 80% of the default font size. The value 100 indicates no sizedifference and is the default.*
@param textSelector A string containing an identifier for the ranges of text to which the style attributes should be applied. Eligible identifiers are determined by the media format and its corresponding text content. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup.
Specify nil if you want the style attributes to apply to all text in the item
Undo Text Style Rule For a Key
-
– deleteTextStyleRuleForKey:Resets text style to default settings for the given key.
Resetting Text Style Rules
-
– resetToDefaultTextStyleSettingsResets text style to default settings. Erases all custom settings set via setTextStyleRulesDictionary method.
Properties
backgroundColor
The background color for the shape holding the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
@property (nonatomic, retain) NSArray *backgroundColorDiscussion
The background color for the shape holding the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
Declared In
PTTextStyleRule.hbold
Boolean representing the bold style setting of the text. Default value is No.
@property (nonatomic, assign) BOOL boldDiscussion
Boolean representing the bold style setting of the text. Default value is No.
Declared In
PTTextStyleRule.hfont
NSString representing the name of the text font. Value is an NSString holding the family name of font set. (e.g., “Helvetica”)
@property (nonatomic, retain) NSString *fontDiscussion
NSString representing the name of the text font. Value is an NSString holding the family name of font set. (e.g., “Helvetica”)
Declared In
PTTextStyleRule.hforegroundColor
The foreground color of the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
@property (nonatomic, retain) NSArray *foregroundColorDiscussion
The foreground color of the text. Value is an NSArray of 4 NSNumbers representing A, R, G, and B fields with values between 0 and 1.0.
Declared In
PTTextStyleRule.hitalic
Boolean representing the italic style setting of the text. Default value is No.
@property (nonatomic, assign) BOOL italicDiscussion
Boolean representing the italic style setting of the text. Default value is No.
Declared In
PTTextStyleRule.hsize
The font size expressed as a percentage of the current default font size. Value returned is a non negative CFNumber holding the current percentage of the size of the calculated default font size. A value of 120 indicates 20% larger than the default font size. A value of 80 indicates 80% of the default font size. The value 100 indicates no size difference and is the default.
@property (nonatomic, retain) NSNumber *sizeDiscussion
The font size expressed as a percentage of the current default font size. Value returned is a non negative CFNumber holding the current percentage of the size of the calculated default font size. A value of 120 indicates 20% larger than the default font size. A value of 80 indicates 80% of the default font size. The value 100 indicates no size difference and is the default.
Declared In
PTTextStyleRule.hInstance Methods
deleteTextStyleRuleForKey:
Resets text style to default settings for the given key.
- (void)deleteTextStyleRuleForKey:(TextStyleRuleKey)textStyleKeyDiscussion
Resets text style to default settings for the given key.
Declared In
PTTextStyleRule.hresetToDefaultTextStyleSettings
Resets text style to default settings. Erases all custom settings set via setTextStyleRulesDictionary method.
- (void)resetToDefaultTextStyleSettingsDiscussion
Resets text style to default settings. Erases all custom settings set via setTextStyleRulesDictionary method.
Declared In
PTTextStyleRule.hsetTextStyleRulesDictionary:textSelector:
- Creates a new TextStyleRule dictionary.
- @param combinedRules A dictionary of style attributes with TextStyleRuleKey keys and corresponding values. *
- Key Value Expected *
- kTextStyleKey_BackgroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_ForegroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_FontFamilyName NSString holding the family name of an installed font
(e.g., "Helvetica") that is used to render and/or measure text.*
- kTextStyleKey_BoldStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with a bold style.*
- kTextStyleKey_ItalicStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an italic style.*
- kTextStyleKey_UnderlineStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an underline style.*
- kTextStyleKey_RelativeFontSize Value must be a non-negative NSNumber. This is a number holding a
percentage of the size of the calculated default font size. A valueof 120 indicates 20% larger than the default font size. A value of 80indicates 80% of the default font size. The value 100 indicates no sizedifference and is the default.*
@param textSelector A string containing an identifier for the ranges of text to which the style attributes should be applied. Eligible identifiers are determined by the media format and its corresponding text content. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup.
Specify nil if you want the style attributes to apply to all text in the item
- (void)setTextStyleRulesDictionary:(NSDictionary *)combinedRules textSelector:(NSString *)textSelectorDiscussion
- Creates a new TextStyleRule dictionary.
- @param combinedRules A dictionary of style attributes with TextStyleRuleKey keys and corresponding values. *
- Key Value Expected *
- kTextStyleKey_BackgroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_ForegroundColorARGB NSArray of 4 NSNumber representing A, R, G, and B fields with values
between 0 and 1.0.*
- kTextStyleKey_FontFamilyName NSString holding the family name of an installed font
(e.g., "Helvetica") that is used to render and/or measure text.*
- kTextStyleKey_BoldStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with a bold style.*
- kTextStyleKey_ItalicStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an italic style.*
- kTextStyleKey_UnderlineStyle BOOL. Default value is NO. If this attribute is YES, the text will be
rendered with an underline style.*
- kTextStyleKey_RelativeFontSize Value must be a non-negative NSNumber. This is a number holding a
percentage of the size of the calculated default font size. A valueof 120 indicates 20% larger than the default font size. A value of 80indicates 80% of the default font size. The value 100 indicates no sizedifference and is the default.*
@param textSelector A string containing an identifier for the ranges of text to which the style attributes should be applied. Eligible identifiers are determined by the media format and its corresponding text content. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup.
Specify nil if you want the style attributes to apply to all text in the item
Declared In
PTTextStyleRule.h