Custom font not applying
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start by comparing the custom font example with the code in the external app.rs PR, especially the app struct's new function. Read the linked Cargo.toml change involving the default_fonts feature and trace how the eframe template initializes egui. Done means identifying why the font configuration is not taking effect and documenting or fixing the issue in the appropriate project location.
Written by the indexing model from the issue text.
Description
Hi there,
I am trying out eframe/egui for the first time (thanks for all the docs and examples!).
I'm following the custom font example to add a custom font to my own eframe app, but my custom font is not applying. I'm guessing that I'm making a simple mistake. PR here, and here's the code I added to the new fn in my app struct impl in app.rs:
let mut fonts = egui::FontDefinitions::default();
fonts.font_data.insert(
"EBGaramond".to_owned(),
egui::FontData::from_static(include_bytes!("../assets/EBGaramond-Regular.ttf"))
);
fonts.families.entry(egui::FontFamily::Proportional).or_default().insert(0,"EBGaramond".to_owned());
fonts.families.entry(egui::FontFamily::Monospace).or_default().insert(0,"EBGaramond".to_owned());
cc.egui_ctx.set_fonts(fonts);
I also tried removing the default_fonts feature in Cargo.toml to break fonts altogether, but my app still built and ran.
Thank you.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 235
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emilk/eframe_template
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
emilk/eframe_template#218 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 64/100
emilk/eframe_template#84 · 6 comments ·
-
Doesn't runOpen
Difficulty 3/5 1-2 days Newbie friendliness 38/100
emilk/eframe_template#229 ·
-
Name empty?Open
Difficulty 1/5 Under an hour Newbie friendliness 55/100
emilk/eframe_template#228 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
emilk/eframe_template#217 ·
All issues in emilk/eframe_template
Similar issues
-
claim
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Nixitov/Riptide-Native#946 ·
Maintainers usually reply within 1 day
-
area: ai-assistants documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BetaBots-LLC/latticegate#17 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
storytold/craft-libs#5594 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
听歌识曲历史跳转后对应音源界面无法返回Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
LingyunStudio/RustMusic#16 ·