다음을 통해 공유


TextBlock.FontStretch 속성

정의

에 대한 TextBlock최상위 글꼴 늘이기 특성을 가져오거나 설정합니다.

public:
 property System::Windows::FontStretch FontStretch { System::Windows::FontStretch get(); void set(System::Windows::FontStretch value); };
public System.Windows.FontStretch FontStretch { get; set; }
member this.FontStretch : System.Windows.FontStretch with get, set
Public Property FontStretch As FontStretch

속성 값

사용할 원하는 글꼴 확장 특성을 지정하는 클래스의 FontStretch 멤버입니다. 기본값은 Normal입니다.

예제

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

<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

설명

자식 요소에 대한 모든 FontStretch 설정은 이 최상위 설정을 재정의합니다.

이 종속성 속성에는 연결된 속성 사용도 있습니다. XAML에서는 개체가 <object TextBlock.FontStretch="value".../>개체 요소(일반적으로 흐름 요소)에 포함되고 TextBlock은 클래스의 문자열 형식 속성 이름 FontStretch 중 하나입니다. 코드에서 연결된 속성 사용은 다음에서 지원 GetFontStretch 됩니다 SetFontStretch. 연결된 속성 사용은 일반적이지 않습니다. 대부분의 요소에 포함할 수 있는 요소는 렌더링에 TextBlock 사용되는 유사하지 않은 FontStretch 속성을 TextBlock 지원하기 때문입니다.

종속성 속성 정보

Item 가치
식별자 필드 FontStretchProperty
메타데이터 속성이 다음으로 설정됩니다. true AffectsMeasure, , AffectsRenderInherits

적용 대상