IconFontCppHeaders

字体下载 2025-08-13

通过GitHub赞助商或Patreon支持IconFontCppHeaders的开发

IconFontCppHeaders

https://gith*u*b.c*om/juliettef/iconfontcppheaders

C和C ++标题,C#和Python课程,Rust Files和Go for Icon Fonts Awesome Awesome,Awesome,Google材料设计,象形文字材料设计图标,Kenney Game Icons,Fontaudio,Codicons,Codicons和Lucide。

一组用于使用C,C ++,C#,Python,Rust和GO的标题文件和类,以及用于创建文件的Python Generator。

每个标头包含一个字体的定义,每个图标代码点定义为ICON_* ,以及最小最大最大16位代码点,用于字体加载目的。最小值不包括ASCII字符代码点。最大16位用于与仅支持16位代码点的库一起使用,例如Dear Imgui。

此外,Python脚本可用于将TTF字体文件转换为C和C ++标头。每个TTF图标字体文件都将转换为包含单个字节数组的C和C ++标头文件。要启用转换,请使用ttf2headerC = True运行Generate IconFontCppHeaders .py脚本。

图标字体

字体很棒[FA]

  • fontawesome.com
  • github.com/fortawesome/font-awesome

字体很棒4

  • github.com/fortawesome/font-awesome/tree/4.x
  • 图标
  • fontawesome-webfont.ttf

字体真棒5免费

  • github.com/fortawesome/font-awesome/tree/5.x
  • 图标
  • FA-Brands-400.ttf
  • fa-regular-400.ttf
  • FA-Solid-900.ttf

字体真棒5 Pro

  • 付费产品,请参阅有关生成标头文件的注释

字体很棒6免费

  • github.com/fortawesome/font-awesome/tree/6.x
  • 图标
  • FA-Brands-400.ttf
  • fa-regular-400.ttf
  • FA-Solid-900.ttf

字体很棒6 Pro

  • 商业产品,不支持,但一代应该与FA5 Pro相似,或者参见 @Jakerieger的叉子

叉子很棒[fk]

  • forkaweso.me/fork-awesome
  • github.com/forkawesome/fork-awesome
  • 图标
  • forkawesome-webfont.ttf

Google材料设计图标[MD]和材料符号[MS]

  • fonts.google.com/icons
  • github.com/google/material-design-icons

材料设计图标[MD]

  • fonts.google.com/icon.icon.set = material+icos
  • codepoints
  • 材料regular.ttf

材料符号[MS]

  • fonts.google.com/icon.icon.set = material+symbols
  • codepoints
  • MitedleyMbolsOutLined [FILL,GRAD,OPSZ,WGHT] .TTF
  • Interialsymbolsonded [Fill,Grad,Opsz,wght] .ttf
  • MitedleyMbolsSharp [Fill,Grad,Opsz,wght] .ttf

象像仪材料设计图标[MDI]

  • Putragrammers.com/library/mdi
  • github.com/templarian/materialldesign-webfont
  • MaterialDesignicons.css
  • Materialdesignicons-webfont.ttf

肯尼游戏图标和扩展[ki]

  • kenney.nl/assets/game-icons和kenney.nl/assets/game-icons-expansion
  • github.com/nicodinh/kenney-icon-font
  • 肯尼·伊克斯(Kenney-Icons.css)
  • Kenney-Icon-font.ttf

fontaudio [FAD]

  • github.com/fefanto/fontaudio
  • fontaudio.css
  • fontaudio.ttf

代码子[CI]

  • microsoft.github.io/vscode-codicons/dist/codicon
  • github.com/microsoft/vscode-codicons
  • Codicon.css
  • Codicon.ttf

Lucide [LC]

  • lucide.dev
  • github.com/lucide-icons/lucide
  • lucide.css
  • lucide.ttf

离子

  • 截至2020年4月29日,不受支持。请参阅第16期。

关于字体真棒5和6的注释

CodePoints分组

字体Awesome 5和6将不同样式的图标分为不同的字体文件,并具有相同的codepoint,用于常规实心样式,以及针对品牌的不同代码。我们已经将品牌放入一个单独的标题文件中。

生成Pro标头文件(字体很棒5)

从fontawesome.com下载字体Awesome Pro Web软件包。要生成标头,请在运行脚本之前将icons.yml放在与Generate IconFontCppHeaders .py目录中。文件icons.yml不在..fontawesome-pro-nnn-webmetadataicons.yml中,其中nnn是版本号。

图标文件:

  • ..fontawesome-pro-nnn-webmetadataicons.yml
  • ..fontawesome-pro-nnn-webwebfontsfa-brands-400.ttf
  • ..fontawesome-pro-nnn-webwebfontsfa-light-300.ttf
  • ..fontawesome-pro-nnn-webwebfontsfa-regular-400.ttf
  • ..fontawesome-pro-nnn-webwebfontsfa-solid-900.ttf

示例代码

以亲爱的imgui为例UI库:

AddFontDefault(); float baseFontSize = 13.0f; // 13.0f is the size of the default font. Change to the font size you use. float iconFontSize = baseFontSize * 2.0f / 3.0f; // FontAwesome fonts need to have their sizes reduced by 2.0f/3.0f in order to align correctly // merge in icons from Font Awesome static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_16_FA, 0 }; ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; icons_config.GlyphMinAdvanceX = iconFontSize; io.Fonts->AddFontFromFileTTF( FONT_ICON_FILE_NAME_FAS, iconFontSize, &icons_config, icons_ranges ); // use FONT_ICON_FILE_NAME_FAR if you want regular instead of solid // in an imgui window somewhere... ImGui::Text( ICON_FA_PAINT_BRUSH " Paint" ); // use string literal concatenation // outputs a paint brush icon and 'Paint' as a string.">
# include " IconsFontAwesome5.h "

ImGuiIO& io = ImGui::GetIO();
io.Fonts-> AddFontDefault ();
float baseFontSize = 13 . 0f ; // 13.0f is the size of the default font. Change to the font size you use.
float iconFontSize = baseFontSize * 2 . 0f / 3 . 0f ; // FontAwesome fonts need to have their sizes reduced by 2.0f/3.0f in order to align correctly

// merge in icons from Font Awesome
static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_16_FA, 0 };
ImFontConfig icons_config; 
icons_config.MergeMode = true ; 
icons_config.PixelSnapH = true ; 
icons_config.GlyphMinAdvanceX = iconFontSize;
io.Fonts-> AddFontFromFileTTF ( FONT_ICON_FILE_NAME_FAS, iconFontSize, &icons_config, icons_ranges );
// use FONT_ICON_FILE_NAME_FAR if you want regular instead of solid

// in an imgui window somewhere...
ImGui::Text ( ICON_FA_PAINT_BRUSH "  Paint " ); // use string literal concatenation
// outputs a paint brush icon and 'Paint' as a string. 

使用字体图标标题文件的项目

雅芳

Voxel编辑器和具有可编辑环境的6度自由FPS游戏。 Voxel编辑器的UI使用Dear Imgui和字体很棒的图标字体。
www.avoyd.com

BGFX

跨平台渲染库
bkaradzic.github.io/bgfx/overview
github.com/bkaradzic/bgfx

Glchaos.p

实时3D奇怪的吸引力侦察员
www.michelemorrone.eu/glchaosp
github.com/brutpitt/glchaos.p

iplug2

跨平台C ++音频插件框架
iplug2.github.io
github.com/iplug2/iplug2

Lumix引擎

3D C ++开源游戏引擎
github.com/nem0/lumixengine

Tracy Profiler

实时,纳秒分辨率,游戏和其他应用程序的远程遥测框架介面仪。
bitbucket.org/wolfpld/tracy

Visual 6502混音

晶体管级别6502硬件模拟
floooh.github.io/visual6502Remix
github.com/floooh/v6502r

游戏

  • 阿凡达:潘多拉的边界
  • 雅芳
  • 奇妙男孩:龙的陷阱

相关工具

Imguifontstudio

创建字体子集
github.com/aiekick/imguifontstudio

贡献

感谢到目前为止为IconFontCppHeaders做出贡献的每个人。为了使事情变得更容易,请记住以下内容:

  • 我定期更新存储库。如果您急需更新并且无法亲自运行发电机,请提出一个问题,指定您需要更新的图标集。
    • 不要提交PRS以更新定义(发电机的输出)。
  • 在提交PR之前,请提出一个描述您建议的问题或增强功能的问题。如果您有能力,请提出实施。
  • 如果您使用IconFontCppHeaders ,并希望您的项目在此页面上出现,请提出问题或给我发送电子邮件至juliette@enkisoftware.com。

学分

开发-Juliette foucaut -@juliettef
要求-Doug Binks- @DougBinks
无语言实施和重构-Leonard Ritter -@paniq
建议为TTF文件名添加定义 - Sean Barrett- @Nothings
初始字体真棒5实现 - codecat- @codecat
建议添加叉子很棒的建议-Julien Deswaef- @xuv
建议添加离子 - omar cornut- @ocornut
C#语言实施-Rokas Kupstys- @@rokups
添加材料设计图标的建议-Gustav Madeso- @madeso
Fontaudio实施-Oli Larkin -@olilarkin
最初的TTF到C和C ++标头转换实现-Charles Mailly- @Caerind
Python语言实施 - hang yu- @yhyu13
进行语言实施-Matt Pharr -@mpp
代码子实施-Robert Ryan- @rtryan98
生锈语言实施-Gaeel Bradshaw -Rodriguez- @bradshaw
图形图材料设计图标实现 - 鲍比·安格洛夫(Bobby Anguelov) - @bobbyangueelov
Lucide Icons实施-Lucide贡献者 - @lucide -icons

下载源码

通过命令行克隆项目:

git clone https://github.com/juliettef/IconFontCppHeaders.git