SubtitlesStyle Class

public class SubtitlesStyle : NSObject

The subtitles settings to customize subtitles rendering.

Public

  • Whether this object was initialized from system settings and not modified afterwards.

    If you serialize a style that has systemSettings = true and deserialize it later, you will still get a style with systemSettings = true, that will reflect the system settings at the time of deserialization (which might be different from the ones at the time of original initialization).

    Declaration

    Swift

    public let systemSettings: Bool
  • The font size scaling.

    This is a number holding a percentage of the size of the calculated default font size. A value of 1.2 indicates 20% larger than the default font size. A value of 0.8 indicates 80% of the default font size. The value 1.0 indicates no size difference and is the default.

    Declaration

    Swift

    public var fontSizeScale: Float
  • The primary typeface used for text. Default is MACaptionAppearanceFontStyle.default

    MACaptionAppearanceFontStyle.default will use the font family specified in the subtitle content. Any other value will override the font family with an unspecified font which has matching typeface properties. This setting has no effect if fontFamilyName is explicitly set.

    Declaration

    Swift

    public var typeface: MACaptionAppearanceFontStyle
  • Explicitly specifies which font to use for all subtitles. Default is nil.

    If non-null, explicitly overrides the font family to use If set to null then the typeface property is used instead. If using this setting, you must ensure the font is already installed and available in the system.

    Note

    This should contain a UTF-8 encoded string.

    Declaration

    Swift

    public var fontFamilyName: String?
  • Enable auto flow.

    This is usefull especially when you adjust the font size scaling will ignore all subtitle positioning and text flow defined in the content and simply fit all text together at the bottom-middle of the screen.

    Declaration

    Swift

    public var autoFlowEnabled: Bool
  • Enable ignore span background color

    This is usefull especially when background color is defined in region and also in nested elements (span).

    Declaration

    Swift

    public var ignoreSpanBackgroundColor: Bool
  • The text foreground color.

    This also contains the alpha/opacity component of the color.

    Declaration

    Swift

    public var foregroundColor: UIColor?
  • The text background color. This also contains the alpha/opacity component of the color.

    Declaration

    Swift

    public var backgroundColor: UIColor?
  • The window color. This also contains the alpha/opacity component of the color.

    Declaration

    Swift

    public var windowColor: UIColor?
  • The edge color. This also contains the alpha/opacity component of the color.

    Declaration

    Swift

    public var edgeColor: UIColor?
  • The edge type. Default is undefined.

    Declaration

    Swift

    public var edgeType: MACaptionAppearanceTextEdgeStyle
  • Forceably render all subtitle text with a bold style.

    Declaration

    Swift

    public var forceBoldFont: Bool
  • Forceably render all subtitle text with an italic style.

    Declaration

    Swift

    public var forceItalicFont: Bool