feat: retrieve system fonts on iOS and Android and show font weight variants, closes #949 and closes #557 (#976)

This commit is contained in:
Huang Xin 2025-04-26 23:37:04 +08:00 committed by GitHub
parent 9303ec8c5f
commit a424ae8b15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 254 additions and 84 deletions

View file

@ -47,4 +47,13 @@ impl<R: Runtime> NativeBridge<R> {
pub fn get_status_bar_height(&self) -> crate::Result<GetStatusBarHeightResponse> {
Err(crate::Error::UnsupportedPlatformError)
}
pub fn get_sys_fonts_list(&self) -> crate::Result<GetSysFontsListResponse> {
let font_collection = font_enumeration::Collection::new().unwrap();
let mut fonts = Vec::new();
for font in font_collection.all() {
fonts.push(font.font_name.clone());
}
Ok(GetSysFontsListResponse { fonts, error: None })
}
}