MCPcopy Index your code
hub / github.com/amPerl/egui-phosphor

github.com/amPerl/egui-phosphor @v0.12.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.12.0 ↗ · + Follow
16 symbols 25 edges 11 files 0 documented · 0% updated 3mo ago★ 1591 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

egui_phosphor

Bundles Phosphor icons with boilerplate to use in your egui app.

Installation

Add the crate as a dependency in Cargo.toml:

egui-phosphor = "0.12"

On startup, update the fonts in your egui context:

let mut fonts = egui::FontDefinitions::default();
egui_phosphor::add_to_fonts(&mut fonts, egui_phosphor::Variant::Regular);

cc.egui_ctx.set_fonts(fonts);

The above add_to_fonts helper adds the chosen variant (Regular) as a fallback to the primary egui Proportional font so that when you use Phosphor icons mixed with plain text in labels, the icon font will take over where necessary. If you want to add multiple variants of Phosphor icons, see this example which shows all variants in use.

Usage

Use the constants provided by the crate in your text:

ui.label(egui::RichText::new(format!("FILE_CODE {}", egui_phosphor::regular::FILE_CODE)).size(32.0));

Note: Make sure to use the appropriate character codes for your chosen variant! This means for Variant::Regular you should use regular::FILE_CODE, for Variant::Fill you should use fill::FILE_CODE etc.

License

egui-phosphor is licensed under MIT OR Apache-2.0. Phosphor Icons are licensed under MIT.

Core symbols most depended-on inside this repo

font_data
called by 6
src/variants/mod.rs
add_to_fonts
called by 2
src/lib.rs
font_bytes
called by 1
src/variants/mod.rs
main
called by 0
examples/multiple_variants.rs
new
called by 0
examples/multiple_variants.rs
ui
called by 0
examples/multiple_variants.rs
main
called by 0
examples/list_all.rs
new
called by 0
examples/list_all.rs

Shape

Method 8
Function 4
Class 3
Enum 1

Languages

Rust100%

Modules by API surface

examples/multiple_variants.rs4 symbols
examples/list_all.rs4 symbols
examples/debug_alignment.rs4 symbols
src/variants/mod.rs3 symbols
src/lib.rs1 symbols

For agents

$ claude mcp add egui-phosphor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact