TextElement.FontSize 속성

정의

요소의 콘텐츠에 대한 글꼴 크기를 가져오거나 설정합니다.

public:
 property double FontSize { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.FontSizeConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None)]
public double FontSize { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FontSizeConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None)>]
member this.FontSize : double with get, set
Public Property FontSize As Double

속성 값

0.001보다 크고 35791보다 작거나 같은 디바이스 독립적 픽셀에서 사용할 원하는 글꼴 크기입니다. 기본값은 현재 시스템 설정과 MessageFontSize 값에 따라 달라집니다.

특성

예외

FontSize는 35791보다 크거나 0.001보다 작거나 같은 값으로 설정됩니다.

예제

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

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

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

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

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

XAML 특성 사용

<object FontSize="double"/>  
- or -  
<object FontSize="qualifiedDouble"/>  

XAML 값

double
Double

문자열 표현 된 Double 보다는 작습니다 0.0 보다 크거나 같은 값 PositiveInfinity합니다. 값을 정규화 되지 않은 디바이스 독립적 픽셀 단위로 측정 됩니다. 문자열 소수점이 하를 명시적으로 포함 되지 해야 합니다.

qualifiedDouble
위에서 설명한 대로 double 값, 다음 단위 지정자 px중 하나( , , in, cmpt)

px (기본값)은 디바이스 독립적 단위(단위당 1/96인치)입니다.

in 인치; 1에서 96px = =

cm 센티미터; 1cm==(96/2.54) px

pt 포인트; 1pt==(96/72) px

종속성 속성 정보

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

적용 대상