cosmic-text/src/font/fallback/other.rs

42 lines
919 B
Rust
Raw Normal View History

2022-10-24 08:56:48 -06:00
// SPDX-License-Identifier: MIT OR Apache-2.0
2022-10-18 12:07:22 -06:00
use unicode_script::Script;
use super::Fallback;
/// An empty platform-specific font fallback list.
pub struct PlatformFallback;
impl Fallback for PlatformFallback {
fn common_fallback(&self) -> &'static [&'static str] {
common_fallback()
}
fn forbidden_fallback(&self) -> &'static [&'static str] {
forbidden_fallback()
}
fn script_fallback(
&self,
script: unicode_script::Script,
locale: &str,
) -> &'static [&'static str] {
script_fallback(script, locale)
}
}
2022-10-18 12:07:22 -06:00
// Fallbacks to use after any script specific fallbacks
fn common_fallback() -> &'static [&'static str] {
2022-10-18 12:07:22 -06:00
&[]
}
// Fallbacks to never use
fn forbidden_fallback() -> &'static [&'static str] {
2022-10-18 12:07:22 -06:00
&[]
}
// Fallbacks to use per script
fn script_fallback(_script: Script, _locale: &str) -> &'static [&'static str] {
2022-10-18 12:07:22 -06:00
&[]
}