TextElement.FontWeight 속성

정의

요소 내용의 최상위 글꼴 두께를 가져오거나 설정합니다.

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

속성 값

FontWeight

원하는 글꼴 두께입니다. 기본값은 MessageFontWeight 값에 따라 결정됩니다.

예제

다음 예제에서는 설정 하는 방법을 보여 줍니다 합니다 FontWeight 특성을 사용 하 여 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>

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

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

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

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.FontWeight="value".../>개체 가 개체 요소(일반적으로 흐름 요소)TextElement이며 은 열거형의 FontWeight 문자열 형식 값 중 하나입니다. 코드에서 연결 된 속성에서 지원 되는 GetFontWeightSetFontWeight 메서드. 연결 된 속성 아니므로 일반적인 수 있는 대부분의 요소에는 TextElement 연결 되지 않은 이와 유사한 지원 FontWeight 속성을.

종속성 속성 정보

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

적용 대상