<!--
{
  "documentType" : "article",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/cmtextmarkup",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CMTextMarkup"
}
-->

# CMTextMarkup

Attributes that specify text markup in legible media.

## Discussion

Core Media supports legible media streams like subtitles and closed captions. In some cases, apps may need to specify style information to control rendering. In other cases, the framework indicates the text and styling to apply.

## Topics

### Fonts

[`kCMTextMarkupAttribute_FontFamilyName`](/documentation/CoreMedia/kCMTextMarkupAttribute_FontFamilyName)

A name of a font family.

[`kCMTextMarkupAttribute_GenericFontFamilyName`](/documentation/CoreMedia/kCMTextMarkupAttribute_GenericFontFamilyName)

A generic font family name identifier.

[`kCMTextMarkupAttribute_BaseFontSizePercentageRelativeToVideoHeight`](/documentation/CoreMedia/kCMTextMarkupAttribute_BaseFontSizePercentageRelativeToVideoHeight)

A base font size as a percentage of the video height.

[`kCMTextMarkupAttribute_RelativeFontSize`](/documentation/CoreMedia/kCMTextMarkupAttribute_RelativeFontSize)

A font size as a percentage of the current default font size.

### Styles

[`kCMTextMarkupAttribute_BoldStyle`](/documentation/CoreMedia/kCMTextMarkupAttribute_BoldStyle)

A bold font style.

[`kCMTextMarkupAttribute_ItalicStyle`](/documentation/CoreMedia/kCMTextMarkupAttribute_ItalicStyle)

An italic font style.

[`kCMTextMarkupAttribute_UnderlineStyle`](/documentation/CoreMedia/kCMTextMarkupAttribute_UnderlineStyle)

An underline font style.

[`kCMTextMarkupAttribute_CharacterEdgeStyle`](/documentation/CoreMedia/kCMTextMarkupAttribute_CharacterEdgeStyle)

A style for character edges.

### Colors

[`kCMTextMarkupAttribute_ForegroundColorARGB`](/documentation/CoreMedia/kCMTextMarkupAttribute_ForegroundColorARGB)

A foreground color for the text.

[`kCMTextMarkupAttribute_BackgroundColorARGB`](/documentation/CoreMedia/kCMTextMarkupAttribute_BackgroundColorARGB)

A background color for the text.

[`kCMTextMarkupAttribute_CharacterBackgroundColorARGB`](/documentation/CoreMedia/kCMTextMarkupAttribute_CharacterBackgroundColorARGB)

A background color for individual text characters.

### Layout

[`kCMTextMarkupAttribute_VerticalLayout`](/documentation/CoreMedia/kCMTextMarkupAttribute_VerticalLayout)

The vertical layout of a text block.

[`kCMTextMarkupAttribute_Alignment`](/documentation/CoreMedia/kCMTextMarkupAttribute_Alignment)

The text alignment in the writing direction of the first line of text.

[`kCMTextMarkupAttribute_TextPositionPercentageRelativeToWritingDirection`](/documentation/CoreMedia/kCMTextMarkupAttribute_TextPositionPercentageRelativeToWritingDirection)

The placement of the block of text as a percentage in the writing direction.

[`kCMTextMarkupAttribute_OrthogonalLinePositionPercentageRelativeToWritingDirection`](/documentation/CoreMedia/kCMTextMarkupAttribute_OrthogonalLinePositionPercentageRelativeToWritingDirection)

The placement of the first line in a block of text as a percentage in the direction orthogonal to the writing direction.

[`kCMTextMarkupAttribute_WritingDirectionSizePercentage`](/documentation/CoreMedia/kCMTextMarkupAttribute_WritingDirectionSizePercentage)

The width or height as a percentage of the bounding box that contains the text.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)