mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Tryin to fix Issue 194 - font crash
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2355 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
5cc75a9860
commit
51551815a4
@ -2128,9 +2128,12 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
|
||||
foreach (var x in FontFamily.Families)
|
||||
{
|
||||
comboBoxSubtitleFont.Items.Add(x.Name);
|
||||
if (string.Compare(x.Name, _subtitleFontName, true) == 0)
|
||||
comboBoxSubtitleFont.SelectedIndex = comboBoxSubtitleFont.Items.Count - 1;
|
||||
if (x.IsStyleAvailable(FontStyle.Regular) || x.IsStyleAvailable(FontStyle.Bold))
|
||||
{
|
||||
comboBoxSubtitleFont.Items.Add(x.Name);
|
||||
if (string.Compare(x.Name, _subtitleFontName, true) == 0)
|
||||
comboBoxSubtitleFont.SelectedIndex = comboBoxSubtitleFont.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
if (comboBoxSubtitleFont.SelectedIndex == -1)
|
||||
comboBoxSubtitleFont.SelectedIndex = 0; // take first font if default font not found (e.g. linux)
|
||||
|
@ -141,9 +141,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
foreach (var x in System.Drawing.FontFamily.Families)
|
||||
{
|
||||
comboBoxSubtitleFont.Items.Add(x.Name);
|
||||
if (string.Compare(x.Name, gs.SubtitleFontName, true) == 0)
|
||||
comboBoxSubtitleFont.SelectedIndex = comboBoxSubtitleFont.Items.Count - 1;
|
||||
if (x.IsStyleAvailable(FontStyle.Regular) && x.IsStyleAvailable(FontStyle.Bold))
|
||||
{
|
||||
comboBoxSubtitleFont.Items.Add(x.Name);
|
||||
if (string.Compare(x.Name, gs.SubtitleFontName, true) == 0)
|
||||
comboBoxSubtitleFont.SelectedIndex = comboBoxSubtitleFont.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
WordListSettings wordListSettings = Configuration.Settings.WordLists;
|
||||
|
Loading…
Reference in New Issue
Block a user