fix "Only TrueType fonts are supported. This is not a TrueType font."

This commit is contained in:
Gang Zhuo
2015-09-22 02:01:23 -04:00
parent 41c0c803cd
commit 2ec1340261
+12 -4
View File
@@ -134,11 +134,19 @@ namespace Shadowsocks.View
private void ChangeFontButton_Click(object sender, EventArgs e)
{
FontDialog fd = new FontDialog();
fd.Font = LogMessageTextBox.Font;
if (fd.ShowDialog() == DialogResult.OK)
try
{
LogMessageTextBox.Font = fd.Font;
FontDialog fd = new FontDialog();
fd.Font = LogMessageTextBox.Font;
if (fd.ShowDialog() == DialogResult.OK)
{
LogMessageTextBox.Font = new Font(fd.Font.FontFamily, fd.Font.Size, fd.Font.Style);
}
}
catch (Exception ex)
{
Logging.LogUsefulException(ex);
MessageBox.Show(ex.Message);
}
}