[ArcObjects]Create IFontDisp

ArcObjects에서 TextSymbol에 사용되는 stdole.IFontDisp를 생성하는 일반적인 코드입니다.

public static class FontFactory
{
    public static stdole.IFontDisp CreateFont(string Name, decimal Size, bool Bold, bool Italic, bool Strikethrough, bool Underline)
    {
        stdole.StdFont stdFont = new stdole.StdFontClass();

        stdFont.Size = Size;
        stdFont.Bold = Bold;
        stdFont.Italic = Italic;
        stdFont.Strikethrough = Strikethrough;
        stdFont.Underline = Underline;

        try
        {
            stdFont.Name = Name;
        }
        catch (Exception Ex)
        {
            stdFont.Name = System.Drawing.SystemFonts.DefaultFont.Name;
            System.Diagnostics.Debug.WriteLine(Ex.Message);
        }

        return (stdole.IFontDisp)stdFont;
    }
}

댓글

이 블로그의 인기 게시물

QGIS에서 한글이 포함된 DXF 파일 불러오기

수치표고자료(DEM)의 개념 및 구축지침