FontFamily.GetLineSpacing(FontStyle) 메서드

정의

지정된 스타일의 FontFamily에 대한 줄 간격을 디자인 단위로 반환합니다. 줄 간격은 텍스트에 있는 연속된 두 줄 사이의 세로 거리입니다.

public:
 int GetLineSpacing(System::Drawing::FontStyle style);
public int GetLineSpacing (System.Drawing.FontStyle style);
member this.GetLineSpacing : System.Drawing.FontStyle -> int
Public Function GetLineSpacing (style As FontStyle) As Integer

매개 변수

style
FontStyle

적용할 FontStyle입니다.

반환

텍스트의 연속된 두 줄 사이의 거리를 반환합니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • FontFamily을 만듭니다.

  • 글꼴 패밀리의 줄 간격을 가져옵니다.

  • 화면에 줄 간격 값을 텍스트로 그립니다.

public:
   void GetLineSpacing_Example( PaintEventArgs^ e )
   {
      // Create a FontFamily object.
      FontFamily^ myFontFamily = gcnew FontFamily( "Arial" );

      // Get the line spacing for myFontFamily.
      int lineSpacing = myFontFamily->GetLineSpacing( FontStyle::Regular );

      // Draw the value of lineSpacing to the screen as a string.
      e->Graphics->DrawString( String::Format( "lineSpacing = {0}", lineSpacing ),
            gcnew System::Drawing::Font( myFontFamily,16 ), Brushes::Black, PointF(0,0) );
   }
public void GetLineSpacing_Example(PaintEventArgs e)
{
    // Create a FontFamily object.
    FontFamily myFontFamily = new FontFamily("Arial");
             
    // Get the line spacing for myFontFamily.
    int lineSpacing = myFontFamily.GetLineSpacing(FontStyle.Regular);
             
    // Draw the value of lineSpacing to the screen as a string.
    e.Graphics.DrawString(
        "lineSpacing = " + lineSpacing.ToString(),
        new Font(myFontFamily, 16),
        Brushes.Black,
        new PointF(0, 0));
}
Public Sub GetLineSpacing_Example(ByVal e As PaintEventArgs)

    ' Create a FontFamily object.
    Dim myFontFamily As New FontFamily("Arial")

    ' Get the line spacing for myFontFamily.
    Dim lineSpacing As Integer = _
    myFontFamily.GetLineSpacing(FontStyle.Regular)

    ' Draw the value of lineSpacing to the screen as a string.
    e.Graphics.DrawString("lineSpacing = " & lineSpacing.ToString(), _
    New Font(myFontFamily, 16), Brushes.Black, New PointF(0, 0))
End Sub

적용 대상

추가 정보