mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
Font readme: Added OpenFontIcons, tweaks, links, removed spaces (#2141)
This commit is contained in:
parent
82873c7ad4
commit
e610afeea3
@ -45,7 +45,8 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
|
|||||||
USING ICONS
|
USING ICONS
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
Using an icon font (such as FontAwesome: http://fontawesome.io) is an easy and practical way to use icons in your ImGui application.
|
Using an icon font (such as FontAwesome: http://fontawesome.io or OpenFontIcons. https://github.com/traverseda/OpenFontIcons)
|
||||||
|
is an easy and practical way to use icons in your Dear ImGui application.
|
||||||
A common pattern is to merge the icon font within your main font, so you can embed icons directly from your strings without
|
A common pattern is to merge the icon font within your main font, so you can embed icons directly from your strings without
|
||||||
having to change fonts back and forth.
|
having to change fonts back and forth.
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
|
|||||||
The pre-C++11 version has the values directly encoded as utf-8:
|
The pre-C++11 version has the values directly encoded as utf-8:
|
||||||
#define ICON_FA_SEARCH "\xEF\x80\x82"
|
#define ICON_FA_SEARCH "\xEF\x80\x82"
|
||||||
|
|
||||||
Example:
|
Example Setup:
|
||||||
|
|
||||||
// Merge icons into default tool font
|
// Merge icons into default tool font
|
||||||
#include "IconsFontAwesome.h"
|
#include "IconsFontAwesome.h"
|
||||||
@ -70,13 +71,13 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
|
|||||||
static const ImWchar icon_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
|
static const ImWchar icon_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
|
||||||
io.Fonts->AddFontFromFileTTF("fonts/fontawesome-webfont.ttf", 13.0f, &config, icon_ranges);
|
io.Fonts->AddFontFromFileTTF("fonts/fontawesome-webfont.ttf", 13.0f, &config, icon_ranges);
|
||||||
|
|
||||||
// Usage, e.g.
|
Example Usage:
|
||||||
ImGui::Button(ICON_FA_SEARCH " Search");
|
|
||||||
// C string _literals_ can be concatenated at compilation time, e.g. "hello" " world"
|
|
||||||
// ICON_FA_SEARCH is defined as a string literal so this is the same as "A" "B" becoming "AB"
|
|
||||||
|
|
||||||
// Usage, e.g.
|
// Usage, e.g.
|
||||||
ImGui::Text("%s among %d items", ICON_FA_SEARCH, count);
|
ImGui::Text("%s among %d items", ICON_FA_SEARCH, count);
|
||||||
|
ImGui::Button(ICON_FA_SEARCH " Search");
|
||||||
|
// C string _literals_ can be concatenated at compilation time, e.g. "hello" " world"
|
||||||
|
// ICON_FA_SEARCH is defined as a string literal so this is the same as "A" "B" becoming "AB"
|
||||||
|
|
||||||
See Links below for other icons fonts and related tools.
|
See Links below for other icons fonts and related tools.
|
||||||
|
|
||||||
@ -210,22 +211,26 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
|
|||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
Roboto-Medium.ttf
|
Roboto-Medium.ttf
|
||||||
|
|
||||||
Apache License 2.0
|
Apache License 2.0
|
||||||
by Christian Robertson
|
by Christian Robertson
|
||||||
https://fonts.google.com/specimen/Roboto
|
https://fonts.google.com/specimen/Roboto
|
||||||
|
|
||||||
Cousine-Regular.ttf
|
Cousine-Regular.ttf
|
||||||
|
|
||||||
by Steve Matteson
|
by Steve Matteson
|
||||||
Digitized data copyright (c) 2010 Google Corporation.
|
Digitized data copyright (c) 2010 Google Corporation.
|
||||||
Licensed under the SIL Open Font License, Version 1.1
|
Licensed under the SIL Open Font License, Version 1.1
|
||||||
https://fonts.google.com/specimen/Cousine
|
https://fonts.google.com/specimen/Cousine
|
||||||
|
|
||||||
DroidSans.ttf
|
DroidSans.ttf
|
||||||
|
|
||||||
Copyright (c) Steve Matteson
|
Copyright (c) Steve Matteson
|
||||||
Apache License, version 2.0
|
Apache License, version 2.0
|
||||||
https://www.fontsquirrel.com/fonts/droid-sans
|
https://www.fontsquirrel.com/fonts/droid-sans
|
||||||
|
|
||||||
ProggyClean.ttf
|
ProggyClean.ttf
|
||||||
|
|
||||||
Copyright (c) 2004, 2005 Tristan Grimmer
|
Copyright (c) 2004, 2005 Tristan Grimmer
|
||||||
MIT License
|
MIT License
|
||||||
recommended loading setting in ImGui: Size = 13.0, DisplayOffset.Y = +1
|
recommended loading setting in ImGui: Size = 13.0, DisplayOffset.Y = +1
|
||||||
@ -243,48 +248,63 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
|
|||||||
|
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
LINKS, OTHER FONTS
|
FONTS LINKS
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
(Icons) Icon fonts
|
ICON FONTS
|
||||||
https://fortawesome.github.io/Font-Awesome/
|
|
||||||
https://github.com/SamBrishes/kenney-icon-font
|
|
||||||
https://design.google.com/icons/
|
|
||||||
You can use https://github.com/juliettef/IconFontCppHeaders for C/C++ header files with name #define to access icon codepoint in source code.
|
|
||||||
|
|
||||||
(Icons) IcoMoon - Custom Icon font builder
|
C/C++ header for icon fonts (#define with code points to use in source code string literals)
|
||||||
|
https://github.com/juliettef/IconFontCppHeaders
|
||||||
|
|
||||||
|
FontAwesome
|
||||||
|
https://fortawesome.github.io/Font-Awesome
|
||||||
|
|
||||||
|
OpenFontIcons
|
||||||
|
https://github.com/traverseda/OpenFontIcons
|
||||||
|
|
||||||
|
Google Icon Fonts
|
||||||
|
https://design.google.com/icons/
|
||||||
|
|
||||||
|
Kenney Icon Font (Game Controller Icons)
|
||||||
|
https://github.com/nicodinh/kenney-icon-font
|
||||||
|
|
||||||
|
IcoMoon - Custom Icon font builder
|
||||||
https://icomoon.io/app
|
https://icomoon.io/app
|
||||||
|
|
||||||
(Pixel perfect) Sweet16, Sweet16 Mono, by Martin Sedlak (Latin + Supplemental + Extended A)
|
REGULAR FONTS
|
||||||
|
|
||||||
|
Google Noto Fonts (worldwide languages)
|
||||||
|
https://www.google.com/get/noto/
|
||||||
|
|
||||||
|
Open Sans Fonts
|
||||||
|
https://fonts.google.com/specimen/Open+Sans
|
||||||
|
|
||||||
|
(Japanese) M+ fonts by Coji Morishita are free
|
||||||
|
http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html
|
||||||
|
|
||||||
|
MONOSPACE FONTS
|
||||||
|
|
||||||
|
(Pixel Perfect) Proggy Fonts, by Tristan Grimmer
|
||||||
|
http://www.proggyfonts.net or http://upperbounds.net
|
||||||
|
|
||||||
|
(Pixel Perfect) Sweet16, Sweet16 Mono, by Martin Sedlak (Latin + Supplemental + Extended A)
|
||||||
https://github.com/kmar/Sweet16Font
|
https://github.com/kmar/Sweet16Font
|
||||||
Also include .inl file to use directly in dear imgui.
|
Also include .inl file to use directly in dear imgui.
|
||||||
|
|
||||||
(Regular) Open Sans Fonts
|
Typefaces for source code beautification
|
||||||
https://fonts.google.com/specimen/Open+Sans
|
|
||||||
|
|
||||||
(Regular) Google Noto Fonts (worldwide languages)
|
|
||||||
https://www.google.com/get/noto/
|
|
||||||
|
|
||||||
(Monospace) Typefaces for source code beautification
|
|
||||||
https://github.com/chrissimpkins/codeface
|
https://github.com/chrissimpkins/codeface
|
||||||
|
|
||||||
(Monospace) Programmation fonts
|
Programmation fonts
|
||||||
http://s9w.github.io/font_compare/
|
http://s9w.github.io/font_compare/
|
||||||
|
|
||||||
(Monospace) Proggy Programming Fonts
|
Inconsolata
|
||||||
http://upperbounds.net
|
|
||||||
|
|
||||||
(Monospace) Inconsolata
|
|
||||||
http://www.levien.com/type/myfonts/inconsolata.html
|
http://www.levien.com/type/myfonts/inconsolata.html
|
||||||
|
|
||||||
(Monospace) Adobe Source Code Pro: Monospaced font family for user interface and coding environments
|
Adobe Source Code Pro: Monospaced font family for user interface and coding environments
|
||||||
https://github.com/adobe-fonts/source-code-pro
|
https://github.com/adobe-fonts/source-code-pro
|
||||||
|
|
||||||
(Monospace) Monospace/Fixed Width Programmer's Fonts
|
Monospace/Fixed Width Programmer's Fonts
|
||||||
http://www.lowing.org/fonts/
|
http://www.lowing.org/fonts/
|
||||||
|
|
||||||
(Japanese) M+ fonts by Coji Morishita are free and include most useful Kanjis you would need.
|
|
||||||
http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html
|
|
||||||
|
|
||||||
Or use Arial Unicode or other Unicode fonts provided with Windows for full characters coverage (not sure of their licensing).
|
Or use Arial Unicode or other Unicode fonts provided with Windows for full characters coverage (not sure of their licensing).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user