FontWeight.Compare(FontWeight, FontWeight) 메서드

정의

FontWeight의 두 인스턴스를 비교합니다.

public:
 static int Compare(System::Windows::FontWeight left, System::Windows::FontWeight right);
public static int Compare (System.Windows.FontWeight left, System.Windows.FontWeight right);
static member Compare : System.Windows.FontWeight * System.Windows.FontWeight -> int
Public Shared Function Compare (left As FontWeight, right As FontWeight) As Integer

매개 변수

left
FontWeight

비교할 첫 번째 FontWeight 개체입니다.

right
FontWeight

비교할 두 번째 FontWeight 개체입니다.

반환

Int32

Int32 인스턴스 간의 관계를 나타내는 FontWeight 값입니다. 반환 값이 0보다 작으면 leftright보다 작은 것입니다. 이 값이 0이면 두 피연산자가 같은 것입니다. 값이 0보다 크면 leftright보다 큰 것입니다.

예제

다음 코드 예제에서는 Compare 메서드 두 개를 평가 하는 FontWeight 개체입니다.

// Return the typefaces for the selected font family name and font values.
Typeface typeface1 = new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);
Typeface typeface2 = new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.UltraBold, FontStretches.Normal);

if (FontWeight.Compare(typeface1.Weight, typeface2.Weight) < 0)
{
    // Code execution follows this path because
    // the FontWeight of typeface1 (Normal) is less than of typeface2 (UltraBold).
}
' Return the typefaces for the selected font family name and font values.
Dim typeface1 As New Typeface(New FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal)
Dim typeface2 As New Typeface(New FontFamily("Arial"), FontStyles.Normal, FontWeights.UltraBold, FontStretches.Normal)

If FontWeight.Compare(typeface1.Weight, typeface2.Weight) < 0 Then
    ' Code execution follows this path because
    ' the FontWeight of typeface1 (Normal) is less than of typeface2 (UltraBold).
End If

설명

밝은 글꼴 두께 보다 많은 글꼴 두께입니다. 예를 들어, "Light" 또는 "Normal" 글꼴 두께 "UltraBold" 글꼴 두께 보다 작습니다.

적용 대상