Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
emoji support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofixrs committed Aug 19, 2022
1 parent b4aa606 commit 63bb908
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/App
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
name = "discord_presence"
version = "0.3.0"
edition = "2021"
authors= ["Tofix.rs"]
description = "A cross-platform application for custom presence on discord"

# repo stuff
readme = "README.md"
homepage = "https://github.com/Tofix26/discord_presence"
repository = "https://github.com/Tofix26/discord_presence"
license-file = "LICENSE"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Binary file added assets/fonts/TwitterColorEmoji.ttf
Binary file not shown.
16 changes: 16 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,24 @@ impl Default for App {
}
}

fn setup_font(ctx: &egui::Context) {
let mut fonts = egui::FontDefinitions::default();
fonts.font_data.insert(
"Emoji".to_owned(),
egui::FontData::from_static(include_bytes!("../assets/fonts/TwitterColorEmoji.ttf")),
);
fonts
.families
.entry(egui::FontFamily::Proportional)
.or_default()
.insert(0, "Emoji".to_owned());

ctx.set_fonts(fonts);
}

impl App {
fn new(cc: &eframe::CreationContext<'_>) -> Self {
setup_font(&cc.egui_ctx);
let storage = match cc.storage.unwrap().get_string("settings") {
None => "".to_string(),
Some(value) => value,
Expand Down

0 comments on commit 63bb908

Please sign in to comment.