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;
}
}
댓글 없음:
댓글 쓰기