// Copyright 2026 Tree xie.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use gpui::SharedString;

pub fn get_font_family() -> String {
    if cfg!(target_os = "macos") {
        "Menlo".to_string()
    } else if cfg!(target_os = "windows") {
        "Cascadia Code".to_string()
    } else {
        "monospace".to_string()
    }
}

pub fn get_default_font_family() -> SharedString {
    #[cfg(target_os = "macos")]
    {
        ".AppleSystemUIFont, PingFang SC, Helvetica Neue".into()
    }

    #[cfg(target_os = "windows")]
    {
        // 确保你的 add_fonts 已经把 HarmonyOS 或其他中文字体加载进去了
        "Segoe UI, HarmonyOS Sans SC, Microsoft YaHei UI".into()
    }

    #[cfg(target_os = "linux")]
    {
        "Ubuntu, Noto Sans CJK SC".into()
    }
}
