在WPF中使用FontAwesome图标字体

原文: 在WPF中使用FontAwesome图标字体

版权声明:原创内容转载必须注明出处,否则追究相关责任。 https://blog.csdn.net/qq_36663276/article/details/79937136
  1. 前往FontAwesome官网下载字体库。点击前往
    解压后在fonts目录下找到ttf格式的字体。
    这里写图片描述
  2. 将其直接拖动到WPF项目中(不创建文件夹也可以)
    这里写图片描述
  3. 在Window中创建一个Label
    这里写图片描述
<Label FontFamily="/Resources/fonts/#fontawesome" Content=""></Label>
  1. 打开https://fontawesome.com/cheatsheet
    选择你想要的图标并复制(注意是复制图标不是复制代码)
    这里写图片描述
    粘贴到Content中,显示为一个问号字符,不用管它
    这里写图片描述
    直接运行程序就可以咯
    这里写图片描述
    字体文件已经嵌入程序中,不需要手动设置
    这里写图片描述

猜你喜欢

转载自www.cnblogs.com/lonelyxmas/p/10785244.html