FontWeight.Compare(FontWeight, FontWeight) FontWeight.Compare(FontWeight, FontWeight) FontWeight.Compare(FontWeight, FontWeight) FontWeight.Compare(FontWeight, FontWeight) Method

정의

FontWeight의 두 인스턴스를 비교합니다.Compares two instances of 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 FontWeight FontWeight

비교할 첫 번째 FontWeight 개체입니다.The first FontWeight object to compare.

right
FontWeight FontWeight FontWeight FontWeight

비교할 두 번째 FontWeight 개체입니다.The second FontWeight object to compare.

반환

Int32 인스턴스 간의 관계를 나타내는 FontWeight 값입니다.An Int32 value that indicates the relationship between the two instances of FontWeight. 반환 값이 0보다 작으면 leftright보다 작은 것입니다.When the return value is less than zero, left is less than right. 이 값이 0이면 두 피연산자가 같은 것입니다.When this value is zero, it indicates that both operands are equal. 값이 0보다 크면 leftright보다 큰 것입니다.When the value is greater than zero, it indicates that left is greater than right.

예제

다음 코드 예제에서는 Compare 메서드 두 개를 평가 하는 FontWeight 개체입니다.In the following code example, the Compare method is used to evaluate two FontWeight objects.

// 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

설명

밝은 글꼴 두께 보다 많은 글꼴 두께입니다.Lighter font weights are lesser than heavier font weights. 예를 들어, "Light" 또는 "Normal" 글꼴 두께 "UltraBold" 글꼴 두께 보다 작습니다.For example, a "Light" or "Normal" font weight is lesser than an "UltraBold" font weight.

적용 대상