-2
winforms에서 사용하기 위해 비표준 글꼴 (예 : Ubuntu)을 C# 프로젝트로 가져올 수 있습니까?WinForms에 사용자 정의 글꼴 (Ubuntu) 추가
winforms에서 사용하기 위해 비표준 글꼴 (예 : Ubuntu)을 C# 프로젝트로 가져올 수 있습니까?WinForms에 사용자 정의 글꼴 (Ubuntu) 추가
먼저 글꼴을 찾고 다운로드하십시오 (예 : http://font.ubuntu.com/ 또는 http://www.dafont.com/). 닷넷에서 쉽게 사용할 수 있습니다.
샘플 윈폼 응용 프로그램 :
Font CreateFont(string fontFile,float size,FontStyle style)
{
using (var pfc = new PrivateFontCollection())
{
pfc.AddFontFile(fontFile);
using (var fontFamily = new FontFamily(pfc.Families[0].Name, pfc))
{
return new Font(fontFamily, size, style);
}
}
}
someControl.Font = CreateFont("UbuntuMono-R.ttf", 20, FontStyle.Regular);