Skip to content
v2.277.0

Experimental

@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CaptionFontStyleProps Struct ​

Font and positioning settings for a rendered caption output (burn-in or DVB-Sub).

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as medialive_alpha from '@aws-cdk/aws-medialive-alpha';

declare const captionAlignment: medialive_alpha.CaptionAlignment;
declare const captionBackgroundColor: medialive_alpha.CaptionBackgroundColor;
declare const captionFontColor: medialive_alpha.CaptionFontColor;
declare const captionFontSize: medialive_alpha.CaptionFontSize;
declare const captionOutlineColor: medialive_alpha.CaptionOutlineColor;
declare const captionShadowColor: medialive_alpha.CaptionShadowColor;
declare const captionTeletextGridControl: medialive_alpha.CaptionTeletextGridControl;
declare const fileLocation: medialive_alpha.FileLocation;
const captionFontStyleProps: medialive_alpha.CaptionFontStyleProps = {
  alignment: captionAlignment,
  backgroundColor: captionBackgroundColor,
  backgroundOpacity: 123,
  font: fileLocation,
  fontColor: captionFontColor,
  fontOpacity: 123,
  fontResolution: 123,
  fontSize: captionFontSize,
  outlineColor: captionOutlineColor,
  outlineSize: 123,
  shadowColor: captionShadowColor,
  shadowOpacity: 123,
  shadowXOffset: 123,
  shadowYOffset: 123,
  subtitleRows: 'subtitleRows',
  teletextGridControl: captionTeletextGridControl,
  xPosition: 123,
  yPosition: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_medialive_alpha as medialive_alpha

# caption_alignment: medialive_alpha.CaptionAlignment
# caption_background_color: medialive_alpha.CaptionBackgroundColor
# caption_font_color: medialive_alpha.CaptionFontColor
# caption_font_size: medialive_alpha.CaptionFontSize
# caption_outline_color: medialive_alpha.CaptionOutlineColor
# caption_shadow_color: medialive_alpha.CaptionShadowColor
# caption_teletext_grid_control: medialive_alpha.CaptionTeletextGridControl
# file_location: medialive_alpha.FileLocation

caption_font_style_props = medialive_alpha.CaptionFontStyleProps(
    alignment=caption_alignment,
    background_color=caption_background_color,
    background_opacity=123,
    font=file_location,
    font_color=caption_font_color,
    font_opacity=123,
    font_resolution=123,
    font_size=caption_font_size,
    outline_color=caption_outline_color,
    outline_size=123,
    shadow_color=caption_shadow_color,
    shadow_opacity=123,
    shadow_x_offset=123,
    shadow_y_offset=123,
    subtitle_rows="subtitleRows",
    teletext_grid_control=caption_teletext_grid_control,
    x_position=123,
    y_position=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.medialive.alpha.*;

CaptionAlignment captionAlignment;
CaptionBackgroundColor captionBackgroundColor;
CaptionFontColor captionFontColor;
CaptionFontSize captionFontSize;
CaptionOutlineColor captionOutlineColor;
CaptionShadowColor captionShadowColor;
CaptionTeletextGridControl captionTeletextGridControl;
FileLocation fileLocation;

CaptionFontStyleProps captionFontStyleProps = CaptionFontStyleProps.builder()
        .alignment(captionAlignment)
        .backgroundColor(captionBackgroundColor)
        .backgroundOpacity(123)
        .font(fileLocation)
        .fontColor(captionFontColor)
        .fontOpacity(123)
        .fontResolution(123)
        .fontSize(captionFontSize)
        .outlineColor(captionOutlineColor)
        .outlineSize(123)
        .shadowColor(captionShadowColor)
        .shadowOpacity(123)
        .shadowXOffset(123)
        .shadowYOffset(123)
        .subtitleRows("subtitleRows")
        .teletextGridControl(captionTeletextGridControl)
        .xPosition(123)
        .yPosition(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.MediaLive.Alpha;

CaptionAlignment captionAlignment;
CaptionBackgroundColor captionBackgroundColor;
CaptionFontColor captionFontColor;
CaptionFontSize captionFontSize;
CaptionOutlineColor captionOutlineColor;
CaptionShadowColor captionShadowColor;
CaptionTeletextGridControl captionTeletextGridControl;
FileLocation fileLocation;

var captionFontStyleProps = new CaptionFontStyleProps {
    Alignment = captionAlignment,
    BackgroundColor = captionBackgroundColor,
    BackgroundOpacity = 123,
    Font = fileLocation,
    FontColor = captionFontColor,
    FontOpacity = 123,
    FontResolution = 123,
    FontSize = captionFontSize,
    OutlineColor = captionOutlineColor,
    OutlineSize = 123,
    ShadowColor = captionShadowColor,
    ShadowOpacity = 123,
    ShadowXOffset = 123,
    ShadowYOffset = 123,
    SubtitleRows = "subtitleRows",
    TeletextGridControl = captionTeletextGridControl,
    XPosition = 123,
    YPosition = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import medialive_alpha "github.com/aws/aws-cdk-go/awsmedialivealpha"

var captionAlignment CaptionAlignment
var captionBackgroundColor CaptionBackgroundColor
var captionFontColor CaptionFontColor
var captionFontSize CaptionFontSize
var captionOutlineColor CaptionOutlineColor
var captionShadowColor CaptionShadowColor
var captionTeletextGridControl CaptionTeletextGridControl
var fileLocation FileLocation

captionFontStyleProps := &CaptionFontStyleProps{
	Alignment: captionAlignment,
	BackgroundColor: captionBackgroundColor,
	BackgroundOpacity: jsii.Number(123),
	Font: fileLocation,
	FontColor: captionFontColor,
	FontOpacity: jsii.Number(123),
	FontResolution: jsii.Number(123),
	FontSize: captionFontSize,
	OutlineColor: captionOutlineColor,
	OutlineSize: jsii.Number(123),
	ShadowColor: captionShadowColor,
	ShadowOpacity: jsii.Number(123),
	ShadowXOffset: jsii.Number(123),
	ShadowYOffset: jsii.Number(123),
	SubtitleRows: jsii.String("subtitleRows"),
	TeletextGridControl: captionTeletextGridControl,
	XPosition: jsii.Number(123),
	YPosition: jsii.Number(123),
}

Properties ​

alignmentoptionalCaptionAlignmentalignmentoptionalCaptionAlignmentalignmentoptionalCaptionAlignmentAlignmentoptionalCaptionAlignmentAlignmentoptionalCaptionAlignment= CaptionAlignment.CENTERED#
Caption alignment.

With explicit x/y positions, the font is justified relative to them.

backgroundColoroptionalCaptionBackgroundColorbackground_coloroptionalCaptionBackgroundColorbackgroundColoroptionalCaptionBackgroundColorBackgroundColoroptionalCaptionBackgroundColorBackgroundColoroptionalCaptionBackgroundColor#
The color of the rectangle behind the captions.

Default: service default

backgroundOpacityoptionalnumberbackground_opacityoptionalint | floatbackgroundOpacityoptionalNumberBackgroundOpacityoptionaldoubleBackgroundOpacityoptional*float64#
The opacity of the background rectangle (0 transparent .. 255 opaque).

Default: service default

fontoptionalFileLocationfontoptionalFileLocationfontoptionalFileLocationFontoptionalFileLocationFontoptionalFileLocation#
An external font file (.ttf or .tte) used for burn-in. Provide a `FileLocation` referencing an S3 bucket (`FileLocation.fromBucket`, which auto-grants read access) or a URL (`FileLocation.url`).

Default: service default font

fontColoroptionalCaptionFontColorfont_coloroptionalCaptionFontColorfontColoroptionalCaptionFontColorFontColoroptionalCaptionFontColorFontColoroptionalCaptionFontColor= CaptionFontColor.WHITE#
The color of the burned-in captions.
fontOpacityoptionalnumberfont_opacityoptionalint | floatfontOpacityoptionalNumberFontOpacityoptionaldoubleFontOpacityoptional*float64= 255#
The opacity of the burned-in captions (0 transparent .. 255 opaque).
fontResolutionoptionalnumberfont_resolutionoptionalint | floatfontResolutionoptionalNumberFontResolutionoptionaldoubleFontResolutionoptional*float64= 96#
The font resolution in DPI.
fontSizeoptionalCaptionFontSizefont_sizeoptionalCaptionFontSizefontSizeoptionalCaptionFontSizeFontSizeoptionalCaptionFontSizeFontSizeoptionalCaptionFontSize= CaptionFontSize.AUTO#
Font size — `CaptionFontSize.AUTO` to scale with the output, or `CaptionFontSize.of(points)` for an exact size in points.
outlineColoroptionalCaptionOutlineColoroutline_coloroptionalCaptionOutlineColoroutlineColoroptionalCaptionOutlineColorOutlineColoroptionalCaptionOutlineColorOutlineColoroptionalCaptionOutlineColor= CaptionOutlineColor.BLACK#
The font outline color.
outlineSizeoptionalnumberoutline_sizeoptionalint | floatoutlineSizeoptionalNumberOutlineSizeoptionaldoubleOutlineSizeoptional*float64= 2#
The font outline size in pixels.
shadowColoroptionalCaptionShadowColorshadow_coloroptionalCaptionShadowColorshadowColoroptionalCaptionShadowColorShadowColoroptionalCaptionShadowColorShadowColoroptionalCaptionShadowColor= CaptionShadowColor.NONE#
The color of the shadow cast by the captions.
shadowOpacityoptionalnumbershadow_opacityoptionalint | floatshadowOpacityoptionalNumberShadowOpacityoptionaldoubleShadowOpacityoptional*float64= 0#
The opacity of the shadow (0 transparent .. 255 opaque).
shadowXOffsetoptionalnumbershadow_x_offsetoptionalint | floatshadowXOffsetoptionalNumberShadowXOffsetoptionaldoubleShadowXOffsetoptional*float64#
The horizontal offset of the shadow in pixels (negative shifts left).

Default: service default

shadowYOffsetoptionalnumbershadow_y_offsetoptionalint | floatshadowYOffsetoptionalNumberShadowYOffsetoptionaldoubleShadowYOffsetoptional*float64#
The vertical offset of the shadow in pixels (negative shifts up).

Default: service default

subtitleRowsoptionalstringsubtitle_rowsoptionalstrsubtitleRowsoptionalStringSubtitleRowsoptionalstringSubtitleRowsoptional*string#
For Teletext input, the number of lines for the captions bitmap.

Default: service default

teletextGridControloptionalCaptionTeletextGridControlteletext_grid_controloptionalCaptionTeletextGridControlteletextGridControloptionalCaptionTeletextGridControlTeletextGridControloptionalCaptionTeletextGridControlTeletextGridControloptionalCaptionTeletextGridControl= CaptionTeletextGridControl.FIXED#
Whether a fixed grid is used to generate the subtitle bitmap (Teletext input).
xPositionoptionalnumberx_positionoptionalint | floatxPositionoptionalNumberXPositionoptionaldoubleXPositionoptional*float64#
The horizontal position of the captions in pixels from the left.

Default: determined by alignment

yPositionoptionalnumbery_positionoptionalint | floatyPositionoptionalNumberYPositionoptionaldoubleYPositionoptional*float64#
The vertical position of the captions in pixels from the top.

Default: positioned towards the bottom