Browse Source

* UFontImage: MaterialIcons字体图标调大3个像素

pull/95/head
Sunny 2 years ago
parent
commit
49cda26702
  1. 3
      SunnyUI/Font/UFontImageHelper.cs
  2. 9
      SunnyUI/Font/UFontImages.cs

3
SunnyUI/Font/UFontImageHelper.cs

@ -23,6 +23,7 @@
* 2021-06-15: V3.3.5 FontAwesomeV6的字体图标
* 2023-05-16: V3.3.6 DrawFontImage函数
* 2022-05-17: V3.3.7
* 2023-10-25: V3.5.1 MaterialIcons字体图标调大3个像素
******************************************************************************/
using System.Collections.Generic;
@ -197,7 +198,7 @@ namespace Sunny.UI
case UISymbolType.FontAwesomeV6Solid:
return Fonts[UISymbolType.FontAwesomeV6Solid].GetFont(symbolValue, imageSize);
case UISymbolType.MaterialIcons:
return Fonts[UISymbolType.MaterialIcons].GetFont(symbolValue, imageSize);
return Fonts[UISymbolType.MaterialIcons].GetFont(symbolValue, imageSize, 3);
default:
return null;
}

9
SunnyUI/Font/UFontImages.cs

@ -89,10 +89,15 @@ namespace Sunny.UI
/// <param name="iconText">图标</param>
/// <param name="imageSize">图标大小</param>
/// <returns>字体</returns>
public Font GetFont(int iconText, int imageSize)
public Font GetFont(int iconText, int imageSize, int offset = 0)
{
int item = GetFontSize(iconText, imageSize);
return Fonts.ContainsKey(item) ? Fonts[item] : null;
if (Fonts.ContainsKey(item + offset))
return Fonts[item + offset];
else if (Fonts.ContainsKey(item))
return Fonts[item];
else
return null;
}
/// <summary>

Loading…
Cancel
Save