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

  •   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

foregroundColor

  •   foregroundColor

    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

bold

  •   bold

    Boolean representing the bold style setting of the text. Default value is No.

    property

italic

  •   italic

    Boolean representing the italic style setting of the text. Default value is No.

    property

underLine

  •   underLine

    Boolean representing the underline style setting of the text. Default value is No.

    property

font

  •   font

    NSString representing the name of the text font. Value is an NSString holding the family name of font set. (e.g., “Helvetica”)

    property

size

  •   size

    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

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 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.
      

      *

    • @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.
    • Keys: kTextStyleKey_BackgroundColorARGB (Default), kTextStyleKey_ForegroundColorARGB, kTextStyleKey_FontFamilyName, kTextStyleKey_BoldStyle, kTextStyleKey_ItalicStyle, kTextStyleKey_UnderlineStyle, kTextStyleKey_RelativeFontSize

Resetting Text Style Rules

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 *backgroundColor

Discussion

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.h

bold

Boolean representing the bold style setting of the text. Default value is No.

@property (nonatomic, assign) BOOL bold

Discussion

Boolean representing the bold style setting of the text. Default value is No.

Declared In

PTTextStyleRule.h

font

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 *font

Discussion

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.h

foregroundColor

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 *foregroundColor

Discussion

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.h

italic

Boolean representing the italic style setting of the text. Default value is No.

@property (nonatomic, assign) BOOL italic

Discussion

Boolean representing the italic style setting of the text. Default value is No.

Declared In

PTTextStyleRule.h

size

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 *size

Discussion

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.h

underLine

Boolean representing the underline style setting of the text. Default value is No.

@property (nonatomic, assign) BOOL underLine

Discussion

Boolean representing the underline style setting of the text. Default value is No.

Declared In

PTTextStyleRule.h

Instance Methods

deleteTextStyleRuleForKey:

  • Resets text style to default settings for the given key.
  • Keys: kTextStyleKey_BackgroundColorARGB (Default), kTextStyleKey_ForegroundColorARGB, kTextStyleKey_FontFamilyName, kTextStyleKey_BoldStyle, kTextStyleKey_ItalicStyle, kTextStyleKey_UnderlineStyle, kTextStyleKey_RelativeFontSize
- (void)deleteTextStyleRuleForKey:(TextStyleRuleKey)textStyleKey

Discussion

  • Resets text style to default settings for the given key.
  • Keys: kTextStyleKey_BackgroundColorARGB (Default), kTextStyleKey_ForegroundColorARGB, kTextStyleKey_FontFamilyName, kTextStyleKey_BoldStyle, kTextStyleKey_ItalicStyle, kTextStyleKey_UnderlineStyle, kTextStyleKey_RelativeFontSize

Declared In

PTTextStyleRule.h

resetToDefaultTextStyleSettings

Resets text style to default settings. Erases all custom settings set via setTextStyleRulesDictionary method.

- (void)resetToDefaultTextStyleSettings

Discussion

Resets text style to default settings. Erases all custom settings set via setTextStyleRulesDictionary method.

Declared In

PTTextStyleRule.h

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 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.
    

    *

  • @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 *)textSelector

Discussion

  • 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 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.
    

    *

  • @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