-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (40 loc) · 1.23 KB
/
Program.cs
File metadata and controls
42 lines (40 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Drawing.Text;
using System.Drawing;
using System.Windows.Forms;
namespace ChromaSelect
{
internal static class Program
{
[STAThread]
static void Main()
{
string fontName = "Azonix";
if (IsFontInstalled(fontName))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ChromaSelect());
}
else
{
MessageBox.Show("Please install the Azonix font.\nIn folder with release zip.", "Font Missing!", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
static bool IsFontInstalled(string fontName)
{
using (InstalledFontCollection fontsCollection = new InstalledFontCollection())
{
foreach (FontFamily fontFamily in fontsCollection.Families)
{
if (fontFamily.Name.Equals(fontName, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
}
return false;
}
}
}