첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

728x90
반응형
728x170
using System;
using System.Drawing;
using System.Drawing.Text;

InstalledFontCollection collection = new InstalledFontCollection();

for(int i = 0; i < collection.Families.Length; i++)
{
    FontFamily fontFamily = collection.Families[i];

    string fontName = fontFamily.GetName(0);

    Console.WriteLine(fontName);

    FontStyle fs = FontStyle.Regular;
        
    if(fontFamily.IsStyleAvailable(FontStyle.Bold))
    {
        fs |= FontStyle.Bold;
    }
        
    if(fontFamily.IsStyleAvailable(FontStyle.Italic))
    {
        fs |= FontStyle.Italic;
    }
        
    if(fontFamily.IsStyleAvailable(FontStyle.Strikeout))
    {
        fs |= FontStyle.Strikeout;
    }
        
    if(fontFamily.IsStyleAvailable(FontStyle.Underline))
    {
        fs |= FontStyle.Underline;
    }
        
    Console.WriteLine(fontName + " : Regular," + fs.ToString());
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요