damus-io / notedeck

A multiplatform nostr client
Other
93 stars 16 forks source link

Missing Thai font #283

Closed vazw closed 4 weeks ago

vazw commented 4 weeks ago

Hi, I'm just tested notedeck and found that it's missing thai fonts

Missing Font

I've try added NotoSansThai Font into the project and it's look great.

Added Font here is my patch if you agree to apply them I can make a pull request later

diff --git a/src/fonts.rs b/src/fonts.rs
index 5cf3821..9e8d863 100644
--- a/src/fonts.rs
+++ b/src/fonts.rs
@@ -99,11 +99,24 @@ pub fn setup_fonts(ctx: &egui::Context) {
             },
         ),
     );
+    font_data.insert(
+        "NotoSansThai".to_owned(),
+        FontData::from_static(include_bytes!(
+            "../assets/fonts/NotoSansThai-VariableFont.ttf"
+        ))
+        .tweak(FontTweak {
+            scale: 1.1, // make them a touch larger
+            y_offset_factor: 0.0,
+            y_offset: 0.0,
+            baseline_offset_factor: 0.0,
+        }),
+    );

     let base_fonts = vec![
         "DejaVuSans".to_owned(),
         "NotoEmoji".to_owned(),
         "NotoSansCJK".to_owned(),
+        "NotoSansThai".to_owned(),
     ];

     let mut proportional = vec!["Onest".to_owned()];
jb55 commented 4 weeks ago

thanks for catching this!

jb55 commented 4 weeks ago

whats your account? I want to test

jb55 commented 4 weeks ago

thanks! fixed in 989f88c989f5d6ec85f719efab6f80fb1a95ee00