use chinese font ZCOOLQingKeHuangYou-Regular.ttf

This commit is contained in:
yuni 2024-03-17 20:04:16 +01:00
parent 68d19c3a6a
commit 0506e773b8
2 changed files with 12 additions and 17 deletions

3
.gitignore vendored
View file

@ -1,3 +1,2 @@
target target
assets/raw assets/tmp
assets/restricted

View file

@ -20,6 +20,7 @@ struct FPSUpdateTimer(Timer);
fn setup( fn setup(
mut commands: Commands, mut commands: Commands,
settings: Res<settings::Settings>, settings: Res<settings::Settings>,
asset_server: Res<AssetServer>,
) { ) {
let visibility = if settings.ar_active { let visibility = if settings.ar_active {
Visibility::Inherited Visibility::Inherited
@ -28,28 +29,23 @@ fn setup(
}; };
let mut bundle_fps = TextBundle::from_sections([ let mut bundle_fps = TextBundle::from_sections([
TextSection::new( TextSection::new(
"FPS: ", "帧率 ",
TextStyle { TextStyle {
//font: asset_server.load("fonts/FiraSans-Bold.ttf"), font: asset_server.load("tmp/fonts/ZCOOLQingKeHuangYou-Regular.ttf"),
font_size: 30.0, font_size: 50.0,
color: Color::GRAY,
..default() ..default()
}, },
), ),
TextSection::from_style(if cfg!(feature = "default_font") { TextSection::new(
"",
TextStyle { TextStyle {
font_size: 30.0, font: asset_server.load("tmp/fonts/ZCOOLQingKeHuangYou-Regular.ttf"),
color: Color::GOLD, font_size: 50.0,
color: Color::GRAY,
..default() ..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; bundle_fps.visibility = visibility;
commands.spawn(( commands.spawn((