mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-06 15:56:13 +02:00
- Removed font mono space check.
This commit is contained in:
@@ -667,41 +667,18 @@ namespace DesktopMagic
|
|||||||
char[] chars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
char[] chars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
||||||
foreach (FontFamily ff in Fonts.SystemFontFamilies)
|
foreach (FontFamily ff in Fonts.SystemFontFamilies)
|
||||||
{
|
{
|
||||||
double charWidth = -1;
|
ComboBoxItem comboBoxItem = new()
|
||||||
bool monospace = true;
|
|
||||||
|
|
||||||
textBlock.FontFamily = ff;
|
|
||||||
|
|
||||||
foreach (char c in chars)
|
|
||||||
{
|
{
|
||||||
textBlock.Text = "";
|
FontFamily = ff,
|
||||||
|
Content = ff.ToString()
|
||||||
|
};
|
||||||
|
_ = fontComboBox.Items.Add(comboBoxItem);
|
||||||
|
|
||||||
textBlock.Text += c.ToString();
|
if (ff.ToString() == GlobalFont)
|
||||||
|
|
||||||
textBlock.UpdateLayout();
|
|
||||||
|
|
||||||
if (charWidth != textBlock.ActualWidth && charWidth != -1)
|
|
||||||
{
|
|
||||||
monospace = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
charWidth = textBlock.ActualWidth;
|
|
||||||
}
|
|
||||||
if (monospace)
|
|
||||||
{
|
{
|
||||||
ComboBoxItem comboBoxItem = new()
|
fontComboBox.SelectedIndex = index;
|
||||||
{
|
|
||||||
FontFamily = ff,
|
|
||||||
Content = ff.ToString()
|
|
||||||
};
|
|
||||||
_ = fontComboBox.Items.Add(comboBoxItem);
|
|
||||||
|
|
||||||
if (ff.ToString() == GlobalFont)
|
|
||||||
{
|
|
||||||
fontComboBox.SelectedIndex = index;
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
|
index++;
|
||||||
}
|
}
|
||||||
if (fontComboBox.SelectedIndex == -1)
|
if (fontComboBox.SelectedIndex == -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user