use chinese font ZCOOLQingKeHuangYou-Regular.ttf
This commit is contained in:
parent
68d19c3a6a
commit
0506e773b8
2 changed files with 12 additions and 17 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
target
|
||||
assets/raw
|
||||
assets/restricted
|
||||
assets/tmp
|
||||
|
|
26
src/hud.rs
26
src/hud.rs
|
@ -20,6 +20,7 @@ struct FPSUpdateTimer(Timer);
|
|||
fn setup(
|
||||
mut commands: Commands,
|
||||
settings: Res<settings::Settings>,
|
||||
asset_server: Res<AssetServer>,
|
||||
) {
|
||||
let visibility = if settings.ar_active {
|
||||
Visibility::Inherited
|
||||
|
@ -28,28 +29,23 @@ fn setup(
|
|||
};
|
||||
let mut bundle_fps = TextBundle::from_sections([
|
||||
TextSection::new(
|
||||
"FPS: ",
|
||||
"帧率 ",
|
||||
TextStyle {
|
||||
//font: asset_server.load("fonts/FiraSans-Bold.ttf"),
|
||||
font_size: 30.0,
|
||||
font: asset_server.load("tmp/fonts/ZCOOLQingKeHuangYou-Regular.ttf"),
|
||||
font_size: 50.0,
|
||||
color: Color::GRAY,
|
||||
..default()
|
||||
},
|
||||
),
|
||||
TextSection::from_style(if cfg!(feature = "default_font") {
|
||||
TextSection::new(
|
||||
"",
|
||||
TextStyle {
|
||||
font_size: 30.0,
|
||||
color: Color::GOLD,
|
||||
font: asset_server.load("tmp/fonts/ZCOOLQingKeHuangYou-Regular.ttf"),
|
||||
font_size: 50.0,
|
||||
color: Color::GRAY,
|
||||
..default()
|
||||
}
|
||||
} else {
|
||||
// "default_font" feature is unavailable, load a font to use instead.
|
||||
TextStyle {
|
||||
//font: asset_server.load("fonts/FiraMono-Medium.ttf"),
|
||||
font_size: 30.0,
|
||||
color: Color::GOLD,
|
||||
..default()
|
||||
}
|
||||
}),
|
||||
),
|
||||
]);
|
||||
bundle_fps.visibility = visibility;
|
||||
commands.spawn((
|
||||
|
|
Loading…
Add table
Reference in a new issue