示例#1
0
 /// <summary>
 /// 获取字体
 /// </summary>
 /// <param name="symbol">字符</param>
 /// <param name="imageSize">大小</param>
 /// <returns>字体</returns>
 public static Font GetFont(int symbol, int imageSize)
 {
     if (symbol > 0xF000)
     {
         return(AwesomeFont.GetFont(symbol, imageSize));
     }
     else
     {
         return(ElegantFont.GetFont(symbol, imageSize));
     }
 }
示例#2
0
        /// <summary>
        /// 获取字体
        /// </summary>
        /// <param name="symbol">字符</param>
        /// <param name="imageSize">大小</param>
        /// <returns>字体</returns>
        public static Font GetFont(int symbol, int imageSize)
        {
            var symbolType  = GetSymbolType(symbol);
            var symbolValue = GetSymbolValue(symbol);

            switch (symbolType)
            {
            case UISymbolType.FontAwesomeV4:
                if (symbol > 0xF000)
                {
                    return(FontAwesomeV4.GetFont(symbolValue, imageSize));
                }
                else
                {
                    return(ElegantIcons.GetFont(symbolValue, imageSize));
                }

            case UISymbolType.FontAwesomeV5Brands:
                return(FontAwesomeV5Brands.GetFont(symbolValue, imageSize));

            case UISymbolType.FontAwesomeV5Regular:
                return(FontAwesomeV5Regular.GetFont(symbolValue, imageSize));

            case UISymbolType.FontAwesomeV5Solid:
                return(FontAwesomeV5Solid.GetFont(symbolValue, imageSize));

            default:
                if (symbol > 0xF000)
                {
                    return(FontAwesomeV4.GetFont(symbolValue, imageSize));
                }
                else
                {
                    return(ElegantIcons.GetFont(symbolValue, imageSize));
                }
            }
        }