Skip to content

Commit

Permalink
Use HarmonyOS Sans on OpenHarmony
Browse files Browse the repository at this point in the history
[HarmonyOS Sans], which despite the name is also available in
[OpenHarmony](https://gitee.com/openharmony/utils_system_resources),
is really the default and only font on OpenHarmony besides some
language specific NotoSans fonts.

[HarmonyOS Sans]: https://developer.huawei.com/consumer/en/doc/design-guides-V1/font-0000001157868583-V1
  • Loading branch information
jschwe committed Apr 17, 2024
1 parent 15b85bf commit be693a5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ pub use crate::sources::fs::FsSource as SystemSource;
const DEFAULT_FONT_FAMILY_SERIF: &'static str = "Times New Roman";
#[cfg(any(target_family = "windows", target_os = "macos", target_os = "ios"))]
const DEFAULT_FONT_FAMILY_SANS_SERIF: &'static str = "Arial";
#[cfg(target_env = "ohos")]
const DEFAULT_FONT_FAMILY_SANS_SERIF: &str = "HarmonyOS Sans";
#[cfg(any(target_family = "windows", target_os = "macos", target_os = "ios"))]
const DEFAULT_FONT_FAMILY_MONOSPACE: &'static str = "Courier New";
#[cfg(target_env = "ohos")]
const DEFAULT_FONT_FAMILY_MONOSPACE: &str = "HarmonyOS Sans";
#[cfg(any(target_family = "windows", target_os = "macos", target_os = "ios"))]
const DEFAULT_FONT_FAMILY_CURSIVE: &'static str = "Comic Sans MS";
#[cfg(target_family = "windows")]
Expand All @@ -63,9 +67,19 @@ const DEFAULT_FONT_FAMILY_FANTASY: &'static str = "Papyrus";

#[cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios")))]
const DEFAULT_FONT_FAMILY_SERIF: &str = "serif";
#[cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios")))]
#[cfg(not(any(
target_family = "windows",
target_os = "macos",
target_os = "ios",
target_env = "ohos"
)))]
const DEFAULT_FONT_FAMILY_SANS_SERIF: &str = "sans-serif";
#[cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios")))]
#[cfg(not(any(
target_family = "windows",
target_os = "macos",
target_os = "ios",
target_env = "ohos"
)))]
const DEFAULT_FONT_FAMILY_MONOSPACE: &str = "monospace";
#[cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios")))]
const DEFAULT_FONT_FAMILY_CURSIVE: &str = "cursive";
Expand Down

0 comments on commit be693a5

Please sign in to comment.