#font #svg #macro #api-bindings #text

nerd_font

Enumerated contents of the JetBrainsMono Nerd Font

6 releases

0.2.8 Feb 7, 2025
0.2.7 Feb 7, 2025
0.2.6 Feb 5, 2025
0.2.5 Feb 4, 2025
0.2.4 Feb 4, 2025

#208 in GUI

Download history 422/week @ 2025-02-04 7/week @ 2025-02-11

429 downloads per month

MIT license

1.5MB
128 lines

JetbrainsMono Nerd Font

Crates.io Build Status docs.rs License

This crate provides an enum of all the glyphs in the JetbrainsMono Nerd Font.
Additionally, it provides a way to load the font, and QOL features for using the font in iced.

In addition - you can hover over the icons in your IDE to see a preview of the icon!

See https://www.nerdfonts.com/ for more information

I am not affiliated with Nerd Fonts, nor do I have any rights to the JetbrainsMono Nerd Font.
This crate is published with a copy of the font, and its license, as allowed by the license.

See NerdFont or categories for the list of available icons, including their names, codepoints and a preview image.


The individual glyphs are in seperate enums inside of the categories module:

use nerd_font::categories;

let _ = categories::Dev::Android;
let _ = categories::Fa::ArrowLeft;

There is also an enum encapsulating all the glyphs, NerdFont, which can be converted to and from the individual enums:

use nerd_font::{NerdFont, categories::Dev};
let _: NerdFont = Dev::Android.into();

Each glyph contains the following information:

  • Unicode codepoint: e.g. Dev::Android as u32
  • Postfix name: e.g. Dev::Android.name()
  • Glyph preview image, visible in the documentation, and by hovering over the glyphs in your IDE!

You can also get the actual char from the enum, with char::from(Dev::Android), or Dev::Android.to_string()


If you use iced there are some QOL features built-in:
**NOTE: ** you will need to activate the iced crate-level feature to use these!

  • NerdFont::FONT_BYTES is the raw bytes of the font, for loading into iced
  • IcedExt provides the helper functions for using the font in iced
  • NerdFont also implements Into<iced::Element>, which will use the default font size
use nerd_font::{IcedExt, categories::Dev};

// A text widget configured to use the icon font, with the selected glyph, and a font size of 24
let text_widget = Dev::Android.into_text(24);

You will additionally need to load the font, by calling .font(NerdFont::FONT_BYTES) on your iced::Application.

Crate Features

iced

Default: Off
Provides some QOL features for using the font in iced, including a font definition, and conversion to an iced Text widget.

Dependencies

~3–22MB
~407K SLoC