@@ -139,7 +139,7 @@ impl ControlPanel {
139139
140140 self . top_bar_ui ( ctx) ;
141141
142- let window = egui:: Window :: new ( "Settings" )
142+ let window = egui:: Window :: new ( " Settings" )
143143 . id ( egui:: Id :: new ( "particles_window_options" ) ) // required since we change the title
144144 . resizable ( false )
145145 . collapsible ( true )
@@ -181,21 +181,25 @@ impl ControlPanel {
181181 } ) ;
182182 }
183183
184+ /// 顶部菜单栏
185+ ///
186+ /// # NOTE:
187+ /// 下边的 字符不是乱码,它是 iconfont 中的一个图标,编辑器中无法正确显示
184188 fn top_bar_ui ( & mut self , ctx : & Context ) {
185189 let mut menu_items = vec ! [
186- ( "🌾 Vector Field" , SimuType :: Field ) ,
187- ( "💦 LBM Fluid" , SimuType :: Fluid ) ,
188- ( "💥 Perlin Noise" , SimuType :: Noise ) ,
189- ( "👗 Position-based Dynamics" , SimuType :: PBDynamic ) ,
190+ ( "Vector Field" , SimuType :: Field ) ,
191+ ( "LBM Fluid" , SimuType :: Fluid ) ,
192+ ( "Perlin Noise" , SimuType :: Noise ) ,
193+ ( "Position-based Dynamics" , SimuType :: PBDynamic ) ,
190194 ] ;
191195 if cfg ! ( not( target_arch = "wasm32" ) ) {
192- menu_items. push ( ( "🚚 CAD Kenel" , SimuType :: CAD ) ) ;
196+ menu_items. push ( ( " CAD Kenel" , SimuType :: CAD ) ) ;
193197 }
194198 egui:: TopBottomPanel :: top ( "simuverse_top_bar" ) . show ( ctx, |ui| {
195199 ui. horizontal_wrapped ( |ui| {
196200 ui. visuals_mut ( ) . button_frame = false ;
197201 if ui
198- . hyperlink_to ( "🌌 Wgpu Simuverse" , "https://github.com/jinleili/simuverse" )
202+ . hyperlink_to ( " Wgpu Simuverse" , "https://github.com/jinleili/simuverse" )
199203 . clicked ( )
200204 {
201205 webbrowser:: open ( "https://github.com/jinleili/simuverse" ) . unwrap ( ) ;
@@ -362,39 +366,20 @@ pub fn setup_custom_fonts(ctx: &egui::Context) {
362366 } )
363367 . into ( ) ,
364368 ) ;
365- // Some good looking emojis.
366369 fonts. font_data . insert (
367- "NotoEmoji-Regular" . to_owned ( ) ,
368- egui:: FontData :: from_static ( include_bytes ! (
369- "../../../assets/fonts/NotoEmoji-Regular.ttf"
370- ) )
371- . tweak ( egui:: FontTweak {
372- scale : 0.91 , // make it smaller
373- y_offset_factor : -0.15 , // move it up
374- y_offset : 0.0 ,
375- ..Default :: default ( )
376- } )
377- . into ( ) ,
378- ) ;
379- // Bigger emojis, and more. <http://jslegers.github.io/emoji-icon-font/>:
380- fonts. font_data . insert (
381- "emoji-icon-font" . to_owned ( ) ,
382- egui:: FontData :: from_static ( include_bytes ! ( "../../../assets/fonts/emoji-icon-font.ttf" ) )
370+ "iconfont" . to_owned ( ) ,
371+ egui:: FontData :: from_static ( include_bytes ! ( "../../../assets/fonts/iconfont.ttf" ) )
383372 . tweak ( egui:: FontTweak {
384- scale : 0.88 , // make it smaller
385- y_offset_factor : 0.07 , // move it down slightly
373+ scale : 0.91 , // make it smaller
374+ y_offset_factor : 0. , // move it up
386375 y_offset : 0.0 ,
387376 ..Default :: default ( )
388377 } )
389378 . into ( ) ,
390379 ) ;
391380 fonts. families . insert (
392381 egui:: FontFamily :: Proportional ,
393- vec ! [
394- ZH_TINY . to_owned( ) ,
395- "NotoEmoji-Regular" . to_owned( ) ,
396- "emoji-icon-font" . to_owned( ) ,
397- ] ,
382+ vec ! [ ZH_TINY . to_owned( ) , "iconfont" . to_owned( ) ] ,
398383 ) ;
399384
400385 // 如果没有这项设置,`syntax_highlighting::code_view_ui` 无法渲染任何字符
0 commit comments