FontInfo 클래스

정의

텍스트의 글꼴 속성을 캡슐화합니다. 이 클래스는 상속될 수 없습니다.

public ref class FontInfo sealed
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public sealed class FontInfo
[<System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))>]
type FontInfo = class
Public NotInheritable Class FontInfo
상속
FontInfo
특성

예제

다음 코드 예제에는 속성을 수정 하는 방법을 보여 줍니다.는 FontInfo 개체에 대 한 글꼴 속성을 지정 하는 프로그래밍 방식으로 Label 제어 합니다.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void Page_Load(object sender, EventArgs e)
  {
    // When the page loads, set the myLabel Label control's FontInfo properties.
    // Note that myLabel.Font is a FontInfo object.
    
    myLabel.Font.Bold = true;
    myLabel.Font.Italic = false;
    myLabel.Font.Name = "verdana";
    myLabel.Font.Overline = false;
    myLabel.Font.Size = 10;
    myLabel.Font.Strikeout = false;
    myLabel.Font.Underline = true;
    
    // Write information on the FontInfo object to the myLabel label.
    myLabel.Text = myLabel.Font.ToString();
    
  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>FontInfo Example</title>
</head>
  <body>
    <form id="form1" runat="server">
    <h3>FontInfo Example</h3>
      <asp:Label id="myLabel" 
        runat="server" >
      </asp:Label>
    </form>
  </body>
</html>
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
  
    ' When the page loads, set the myLabel Label control's FontInfo properties.
    ' Note that myLabel.Font is a FontInfo object.
    
    myLabel.Font.Bold = True
    myLabel.Font.Italic = False
    myLabel.Font.Name = "verdana"
    myLabel.Font.Overline = False
    myLabel.Font.Size = 10
    myLabel.Font.Strikeout = False
    myLabel.Font.Underline = True
    
    ' Write information on the FontInfo object to the myLabel label.
    myLabel.Text = myLabel.Font.ToString()
    
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>FontInfo Example</title>
</head>
  <body>
    <form id="form1" runat="server">
    <h3>FontInfo Example</h3>
      <asp:Label id="myLabel" 
        runat="server" >
      </asp:Label>
    </form>
  </body>
</html>

설명

사용 된 FontInfo 텍스트의 글꼴 속성을 캡슐화 하는 클래스입니다. 글꼴 이름과 크기를 지정할 수 있습니다. 글꼴의 스타일을 굵게, 기울임꼴, 윗줄, 취소선 또는 밑줄이 지정할 수 있습니다.

와 같은 글꼴 정보를 필요로 하는 클래스에 대 한 속성에서이 클래스는 일반적으로 사용 합니다 Font 의 속성을 WebControl 클래스입니다.

참고

이 클래스에 public 생성자가 없습니다. 클래스의 새 인스턴스를 직접 만들 수 없습니다.

속성

Bold

글꼴이 굵은 글꼴인지 여부를 나타내는 값을 가져오거나 설정합니다.

Italic

해당 글꼴이 기울임꼴인지 여부를 나타내는 값을 가져오거나 설정합니다.

Name

기본 글꼴 이름을 가져오거나 설정합니다.

Names

순서가 있는 글꼴 이름 배열을 가져오거나 설정합니다.

Overline

해당 글꼴에 윗줄이 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

Size

글꼴 크기를 가져오거나 설정합니다.

Strikeout

해당 글꼴에 취소선이 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

Underline

해당 글꼴에 밑줄이 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

ClearDefaults()

모든 FontInfo 속성을 해제 상태로 다시 설정하고 뷰 상태를 지웁니다.

CopyFrom(FontInfo)

지정된 FontInfo의 글꼴 속성을 이 메서드가 호출된 FontInfo 클래스의 인스턴스에 복제합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MergeWith(FontInfo)

지정된 FontInfo 의 글꼴 속성을 이 메서드를 호출한 FontInfo 클래스의 인스턴스와 결합합니다.

ShouldSerializeNames()

Names 속성을 유지해야 하는지 여부를 결정합니다.

ToString()

FontInfo 클래스의 인스턴스에 대해 글꼴 이름과 크기를 포함하는 문자열을 반환합니다.

적용 대상

추가 정보