[C#] 폰트 설치 여부 체크해서 설정 도와주기

CSharp
class FontLibraryClass { public class FontLibrary { private string FontsFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts); private static FontLibrary inst = new FontLibrary(); public PrivateFontCollection privateFont = new PrivateFontCollection(); /// <summary> /// /// </summary> public static FontFamily[] Families { get { return inst.privateFont.Families; } } /// <summary> /// /// </summary> public FontLibrary() { AddFontFromNanumgothic(); } /// <summary> /// 리소스에 포함된 폰트 파일을 로딩 /// </summary> private void AddFontFromMemory() { /* List<byte[]> fonts = new List<byte[]>(); fonts.Add(Properties.Resources.NanumGothic); fonts.Add(Properties.Resources.NanumGothicBold); foreach (byte[] FontData in fonts) { IntPtr fontBuffer = Marshal.AllocCoTaskMem(FontData.Length); Marshal.Copy(FontData, 0, fontBuffer, FontData.Length); privateFont.AddMemoryFont(fontBuffer, FontData.Length); } */ } /// <summary> /// 폰트 파일을 추가함. /// </summary> private void AddFontFromNanumgothic() { privateFont.AddFontFile(FontsFolder + @"\\NANUMGOTHIC.TTF"); } } /// <summary> /// 폰트 존재 여부 체크 /// </summary> public void FontInstallCheck() { bool FontInstallBoolNanum = false; // FontFamily[] fonts =…
Read More