Skip to content

Commit 747e85e

Browse files
committed
fixes #143, load egui font from assets
1 parent 3c81fdf commit 747e85e

37 files changed

+286
-173
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/notation_kb/assets/fonts/FiraMono-Medium.font

Whitespace-only changes.
169 KB
Binary file not shown.

apps/notation_kb/src/assets.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ impl ExtraAssets for NotationKnowledgeBaseAssets {
2121
self.kb_scale.clone_untyped(),
2222
]
2323
}
24+
fn get_latin_font() -> &'static str {
25+
"fonts/FiraMono-Medium.ttf.egui"
26+
}
27+
fn get_lyrics_font() -> &'static str {
28+
"fonts/FiraMono-Medium.ttf.egui"
29+
}
2430
}

apps/notation_kb/src/kb.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use notation_bevy::bevy::prelude::*;
55

66
use notation_bevy::prelude::*;
77

8-
use crate::assets::NotationKnowledgeBaseAssets;
98
use crate::index_panel::IndexPanel;
109

1110
pub struct NotationKnowledgeBase();
@@ -28,8 +27,8 @@ impl NotationKnowledgeBase {
2827
.with_system(Self::on_window_resized)
2928
);
3029
}
31-
pub fn run() {
32-
notation_bevy::prelude::NotationApp::run_with_extra::<NotationKnowledgeBaseAssets, _>(vec![], Self::extra);
30+
pub fn run<A: ExtraAssets>() {
31+
notation_bevy::prelude::NotationApp::run_with_extra::<A, _>(vec![], Self::extra);
3332
}
3433
fn setup_state(
3534
mut state: ResMut<NotationState>,

apps/notation_kb/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use notation_bevy::bevy::prelude::bevy_main;
22

3+
use notation_kb::assets::NotationKnowledgeBaseAssets;
4+
35
#[bevy_main]
46
fn main() {
5-
notation_kb::kb::NotationKnowledgeBase::run();
7+
notation_kb::kb::NotationKnowledgeBase::run::<NotationKnowledgeBaseAssets>();
68
}
79

apps/notation_kb_cn/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ resources = ["assets"]
1010

1111
[features]
1212
default = [
13-
"notation_bevy/chinese",
1413
]
1514
native = [
1615
"notation_kb/native",

apps/notation_kb_cn/assets/fonts/FiraMono-Medium.font

Whitespace-only changes.
169 KB
Binary file not shown.

apps/notation_kb_cn/assets/fonts/NotoSansSC-Medium.font

Whitespace-only changes.

0 commit comments

Comments
 (0)