TextElement.FontStyle 속성

정의

요소의 콘텐츠에 대한 글꼴 스타일을 가져오거나 설정합니다.

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

속성 값

FontStyle

원하는 글꼴 스타일입니다. 기본값은 MessageFontStyle 값에 따라 결정됩니다.

예제

다음 예제에서는 설정 하는 방법을 보여 줍니다 합니다 FontStyle 특성을 사용 하 여 Paragraph 를 예제 요소로 합니다.

<Paragraph
  FontFamily="Century Gothic, Courier New"  
  FontSize="16pt"
  FontStretch="UltraExpanded"
  FontStyle="Italic"
  FontWeight="DemiBold"
>
  <Run>
    This text will use the Century Gothic font (if available), with fallback to Courier New.  It 
    will render with a font size of 16 points in ultra-expanded demi-bold italic.
  </Run>
</Paragraph>

다음 그림 앞의 예제에서는 렌더링 되는 방법을 보여 줍니다.

스크린샷: 텍스트 속성이 설정된 텍스트

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

Run run = new Run(
    "This text will use the Century Gothic font (if available), with fallback to Courier New."
    + "It will render with a font size of 16 pixels in ultra-expanded demi-bold italic.");
Paragraph par = new Paragraph(run);

par.FontFamily = new FontFamily("Century Gothic, Courier New");
par.FontSize = 16;
par.FontStretch = FontStretches.UltraExpanded;
par.FontStyle = FontStyles.Italic;
par.FontWeight = FontWeights.DemiBold;
Dim run As New Run("This text will use the Century Gothic font (if available), with fallback to Courier New." & "It will render with a font size of 16 pixels in ultra-expanded demi-bold italic.")
Dim par As New Paragraph(run)

With par
    .FontFamily = New FontFamily("Century Gothic, Courier New")
    .FontSize = 16
    .FontStretch = FontStretches.UltraExpanded
    .FontStyle = FontStyles.Italic
    .FontWeight = FontWeights.DemiBold
End With

설명

이 종속성 속성에는 사용 된 연결 된 속성에도 합니다. XAML에서 사용법은 <object TextElement.FontStyle="value".../>개체 가 개체 요소(일반적으로 흐름 요소)TextElement이며 은 클래스의 문자열 형식 속성 이름 FontStyles 중 하나입니다. 코드에서 연결 된 속성에서 지원 되는 GetFontStyleSetFontStyle 메서드. 연결 된 속성 아니므로 일반적인 수 있는 대부분의 요소에는 TextElement 연결 되지 않은 이와 유사한 지원 FontStyle 속성을.

종속성 속성 정보

식별자 필드 FontStyleProperty
메타 데이터 속성 설정 true AffectsMeasure, AffectsRender, Inherits

적용 대상