TextBlock.Typography 속성

정의

이 요소의 콘텐츠에 현재 적용되는 입력 체계 변형을 가져옵니다.

public:
 property System::Windows::Documents::Typography ^ Typography { System::Windows::Documents::Typography ^ get(); };
public System.Windows.Documents.Typography Typography { get; }
member this.Typography : System.Windows.Documents.Typography
Public ReadOnly Property Typography As Typography

속성 값

Typography

현재 유효한 입력 체계 변형을 지정하는 Typography 개체입니다. 기본 입력 체계 값 목록은 Typography를 참조하십시오.

예제

다음 예제에서는 설정 하는 방법을 보여 줍니다 합니다 Typography 특성을 TextBlock 요소입니다.

<TextBlock 
  Name="textBlock"
  
  Background="AntiqueWhite" 
  Foreground="Navy" 
  
  FontFamily="Century Gothic"
  FontSize="12"
  FontStretch="UltraExpanded"
  FontStyle="Italic"
  FontWeight="UltraBold"
  
  LineHeight="Auto"
  Padding="5,10,5,10"
  TextAlignment="Center"
  TextWrapping="Wrap"
  
  Typography.NumeralStyle="OldStyle"
  Typography.SlashedZero="True"
>
  <Run Background="LightGreen">Text run 1.</Run>
  <LineBreak/><Run Background="LightBlue">Text run 2.</Run>
  <LineBreak/><Run Background="LightYellow">Text run 3.</Run>
</TextBlock>

다음 예제에서는 설정 하는 방법의 Typography 속성 프로그래밍 방식으로 합니다.

TextBlock textBlock = new TextBlock(new Run("A bit of text content..."));

textBlock.Background              = Brushes.AntiqueWhite;
textBlock.Foreground              = Brushes.Navy;

textBlock.FontFamily              = new FontFamily("Century Gothic");
textBlock.FontSize                = 12;
textBlock.FontStretch             = FontStretches.UltraExpanded;
textBlock.FontStyle               = FontStyles.Italic;
textBlock.FontWeight              = FontWeights.UltraBold;

textBlock.LineHeight              = Double.NaN;
textBlock.Padding                 = new Thickness(5, 10, 5, 10);
textBlock.TextAlignment           = TextAlignment.Center;
textBlock.TextWrapping            = TextWrapping.Wrap;

textBlock.Typography.NumeralStyle = FontNumeralStyle.OldStyle;
textBlock.Typography.SlashedZero  = true;
Dim textBlock As New TextBlock(New Run("A bit of text content..."))

textBlock.Background = Brushes.AntiqueWhite
textBlock.Foreground = Brushes.Navy

textBlock.FontFamily = New FontFamily("Century Gothic")
textBlock.FontSize = 12
textBlock.FontStretch = FontStretches.UltraExpanded
textBlock.FontStyle = FontStyles.Italic
textBlock.FontWeight = FontWeights.UltraBold

textBlock.LineHeight = Double.NaN
textBlock.Padding = New Thickness(5, 10, 5, 10)
textBlock.TextAlignment = TextAlignment.Center
textBlock.TextWrapping = TextWrapping.Wrap

textBlock.Typography.NumeralStyle = FontNumeralStyle.OldStyle
textBlock.Typography.SlashedZero = True

설명

Typography 속성은 OpenType 글꼴에만 적용됩니다. 입력 체계 변형을 variant를 지원 하지 않는 글꼴에서 효과가 없습니다. 이 항목에 대 한 자세한 내용은 참조 하세요. WPF의 입력 체계합니다.

적용 대상

추가 정보