- 删除LineAweSome字体图标,经过测试显示效果不理想

This commit is contained in:
Sunny 2022-08-10 22:42:27 +08:00
parent a7e6a65bd3
commit 2f1d1eb945
8 changed files with 21 additions and 114 deletions

View File

@ -63,21 +63,6 @@ namespace Sunny.UI
/// </summary> /// </summary>
public static readonly FontImages FontAwesomeV5Solid; public static readonly FontImages FontAwesomeV5Solid;
/// <summary>
/// FontAwesomeV5Brands
/// </summary>
public static readonly FontImages LineAwesomeBrands;
/// <summary>
/// FontAwesomeV5Regular
/// </summary>
public static readonly FontImages LineAwesomeRegular;
/// <summary>
/// FontAwesomeV5Solid
/// </summary>
public static readonly FontImages LineAwesomeSolid;
//public const int FontAwesomeV4Count = 786; //public const int FontAwesomeV4Count = 786;
//public const int ElegantIconsCount = 360; //public const int ElegantIconsCount = 360;
//public const int FontAwesomeV5RegularCount = 151; //public const int FontAwesomeV5RegularCount = 151;
@ -97,9 +82,6 @@ namespace Sunny.UI
FontAwesomeV5Brands = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-brands-400.ttf")); FontAwesomeV5Brands = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-brands-400.ttf"));
FontAwesomeV5Regular = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-regular-400.ttf")); FontAwesomeV5Regular = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-regular-400.ttf"));
FontAwesomeV5Solid = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-solid-900.ttf")); FontAwesomeV5Solid = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.fa-solid-900.ttf"));
LineAwesomeBrands = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.la-brands-400.ttf"));
LineAwesomeRegular = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.la-regular-400.ttf"));
LineAwesomeSolid = new FontImages(ReadFontFileFromResource("Sunny.UI.Font.la-solid-900.ttf"));
} }
private static byte[] ReadFontFileFromResource(string name) private static byte[] ReadFontFileFromResource(string name)
@ -235,12 +217,6 @@ namespace Sunny.UI
return FontAwesomeV5Regular.GetFont(symbolValue, imageSize); return FontAwesomeV5Regular.GetFont(symbolValue, imageSize);
case UISymbolType.FontAwesomeV5Solid: case UISymbolType.FontAwesomeV5Solid:
return FontAwesomeV5Solid.GetFont(symbolValue, imageSize); return FontAwesomeV5Solid.GetFont(symbolValue, imageSize);
case UISymbolType.LineAwesomeBrands:
return LineAwesomeBrands.GetFont(symbolValue, imageSize);
case UISymbolType.LineAwesomeRegular:
return LineAwesomeRegular.GetFont(symbolValue, imageSize);
case UISymbolType.LineAwesomeSolid:
return LineAwesomeSolid.GetFont(symbolValue, imageSize);
default: default:
if (symbol > 0xF000) if (symbol > 0xF000)
return FontAwesomeV4.GetFont(symbolValue, imageSize); return FontAwesomeV4.GetFont(symbolValue, imageSize);

View File

@ -38,9 +38,6 @@ namespace Sunny.UI
FontAwesomeV4 = 0, FontAwesomeV4 = 0,
FontAwesomeV5Brands = 1, FontAwesomeV5Brands = 1,
FontAwesomeV5Regular = 2, FontAwesomeV5Regular = 2,
FontAwesomeV5Solid = 3, FontAwesomeV5Solid = 3
LineAwesomeBrands = 4,
LineAwesomeRegular = 5,
LineAwesomeSolid = 6
} }
} }

View File

@ -39,9 +39,6 @@ namespace Sunny.UI
private readonly ConcurrentQueue<Label> FontAwesomeV5SolidLabels = new ConcurrentQueue<Label>(); private readonly ConcurrentQueue<Label> FontAwesomeV5SolidLabels = new ConcurrentQueue<Label>();
private readonly ConcurrentQueue<Label> FontAwesomeV5BrandsLabels = new ConcurrentQueue<Label>(); private readonly ConcurrentQueue<Label> FontAwesomeV5BrandsLabels = new ConcurrentQueue<Label>();
private readonly ConcurrentQueue<Label> FontAwesomeV5RegularLabels = new ConcurrentQueue<Label>(); private readonly ConcurrentQueue<Label> FontAwesomeV5RegularLabels = new ConcurrentQueue<Label>();
private readonly ConcurrentQueue<Label> LineAwesomeSolidLabels = new ConcurrentQueue<Label>();
private readonly ConcurrentQueue<Label> LineAwesomeBrandsLabels = new ConcurrentQueue<Label>();
private readonly ConcurrentQueue<Label> LineAwesomeRegularLabels = new ConcurrentQueue<Label>();
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
@ -116,36 +113,6 @@ namespace Sunny.UI
} }
} }
while (!LineAwesomeSolidLabels.IsEmpty)
{
if (LineAwesomeSolidLabels.TryDequeue(out Label lbl))
{
lpV5Solid.Controls.Add(lbl);
SymbolValue symbol = (SymbolValue)lbl.Tag;
toolTip.SetToolTip(lbl, symbol.ToString());
}
}
while (!LineAwesomeRegularLabels.IsEmpty)
{
if (LineAwesomeRegularLabels.TryDequeue(out Label lbl))
{
lpV5Regular.Controls.Add(lbl);
SymbolValue symbol = (SymbolValue)lbl.Tag;
toolTip.SetToolTip(lbl, symbol.ToString());
}
}
while (!LineAwesomeBrandsLabels.IsEmpty)
{
if (LineAwesomeBrandsLabels.TryDequeue(out Label lbl))
{
lpV5Brands.Controls.Add(lbl);
SymbolValue symbol = (SymbolValue)lbl.Tag;
toolTip.SetToolTip(lbl, symbol.ToString());
}
}
timer.Start(); timer.Start();
} }
@ -361,74 +328,46 @@ namespace Sunny.UI
} }
} }
private void bg_DoWork(object sender, DoWorkEventArgs e) private void LoadLabels(Type type, ConcurrentQueue<Label> labels, UISymbolType symbolType)
{ {
var t = typeof(FontAwesomeIcons); foreach (var fieldInfo in type.GetFields())
foreach (var fieldInfo in t.GetFields())
{ {
var obj = fieldInfo.GetRawConstantValue(); var obj = fieldInfo.GetRawConstantValue();
if (obj != null) if (obj is int value)
{ {
int value = obj.ToString().ToInt(); labels.Enqueue(CreateLabel(fieldInfo.Name, value, symbolType));
FontAwesomeV4Labels.Enqueue(CreateLabel(fieldInfo.Name, value, UISymbolType.FontAwesomeV4));
} }
} }
} }
private void bg_DoWork(object sender, DoWorkEventArgs e)
{
//public const int FontAwesomeV4Count = 786;
LoadLabels(typeof(FontAwesomeIcons), FontAwesomeV4Labels, UISymbolType.FontAwesomeV4);
}
private void bg2_DoWork(object sender, DoWorkEventArgs e) private void bg2_DoWork(object sender, DoWorkEventArgs e)
{ {
var t = typeof(FontElegantIcons); //public const int ElegantIconsCount = 360;
foreach (var fieldInfo in t.GetFields()) LoadLabels(typeof(FontElegantIcons), ElegantIconsLabels, UISymbolType.FontAwesomeV4);
{
var obj = fieldInfo.GetRawConstantValue();
if (obj != null)
{
int value = obj.ToString().ToInt();
ElegantIconsLabels.Enqueue(CreateLabel(fieldInfo.Name, value, UISymbolType.FontAwesomeV4));
}
}
} }
private void bg3_DoWork(object sender, DoWorkEventArgs e) private void bg3_DoWork(object sender, DoWorkEventArgs e)
{ {
var t = typeof(FontAweSomeV5Brands); //public const int FontAwesomeV5BrandsCount = 457;
foreach (var fieldInfo in t.GetFields()) LoadLabels(typeof(FontAweSomeV5Brands), FontAwesomeV5BrandsLabels, UISymbolType.FontAwesomeV5Brands);
{
var obj = fieldInfo.GetRawConstantValue();
if (obj != null)
{
int value = obj.ToString().ToInt();
FontAwesomeV5BrandsLabels.Enqueue(CreateLabel(fieldInfo.Name, value, UISymbolType.FontAwesomeV5Brands));
}
}
} }
private void bg4_DoWork(object sender, DoWorkEventArgs e) private void bg4_DoWork(object sender, DoWorkEventArgs e)
{ {
var t = typeof(FontAweSomeV5Regular); //public const int FontAwesomeV5RegularCount = 151;
foreach (var fieldInfo in t.GetFields()) LoadLabels(typeof(FontAweSomeV5Regular), FontAwesomeV5RegularLabels, UISymbolType.FontAwesomeV5Regular);
{
var obj = fieldInfo.GetRawConstantValue();
if (obj != null)
{
int value = obj.ToString().ToInt();
FontAwesomeV5RegularLabels.Enqueue(CreateLabel(fieldInfo.Name, value, UISymbolType.FontAwesomeV5Regular));
}
}
} }
private void bg5_DoWork(object sender, DoWorkEventArgs e) private void bg5_DoWork(object sender, DoWorkEventArgs e)
{ {
var t = typeof(FontAweSomeV5Solid); //public const int FontAwesomeV5SolidCount = 1001;
foreach (var fieldInfo in t.GetFields()) LoadLabels(typeof(FontAweSomeV5Solid), FontAwesomeV5SolidLabels, UISymbolType.FontAwesomeV5Solid);
{
var obj = fieldInfo.GetRawConstantValue();
if (obj != null)
{
int value = obj.ToString().ToInt();
FontAwesomeV5SolidLabels.Enqueue(CreateLabel(fieldInfo.Name, value, UISymbolType.FontAwesomeV5Solid));
}
}
} }
int findCount = 0; int findCount = 0;

View File

@ -16,7 +16,8 @@
* : V3.1 * : V3.1
* : 2020-02-26 * : 2020-02-26
* *
* 2020-02-26: V3.2.2 * 2020-08-09: V3.2.2
* 2020-08-10: V3.2.2
******************************************************************************/ ******************************************************************************/
/****************************************************************************** /******************************************************************************

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -39,9 +39,6 @@
<ItemGroup> <ItemGroup>
<None Remove="Common\FastLZx64.dat" /> <None Remove="Common\FastLZx64.dat" />
<None Remove="Common\FastLZx86.dat" /> <None Remove="Common\FastLZx86.dat" />
<None Remove="Font\la-brands-400.ttf" />
<None Remove="Font\la-regular-400.ttf" />
<None Remove="Font\la-solid-900.ttf" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -63,9 +60,6 @@
<EmbeddedResource Include="Font\fa-regular-400.ttf" /> <EmbeddedResource Include="Font\fa-regular-400.ttf" />
<EmbeddedResource Include="Font\fa-solid-900.ttf" /> <EmbeddedResource Include="Font\fa-solid-900.ttf" />
<EmbeddedResource Include="Font\FontAwesome.ttf" /> <EmbeddedResource Include="Font\FontAwesome.ttf" />
<EmbeddedResource Include="Font\la-brands-400.ttf" />
<EmbeddedResource Include="Font\la-regular-400.ttf" />
<EmbeddedResource Include="Font\la-solid-900.ttf" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'"> <ItemGroup Condition="'$(TargetFramework)' == 'net40'">