Skip to content

Commit 0051137

Browse files
committed
Use regular native font handle
1 parent 92722ff commit 0051137

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

webrender/src/resource_cache.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,21 +2301,14 @@ impl ResourceCache {
23012301
index,
23022302
}
23032303
}
2304-
#[cfg(feature = "font_backend_swash")]
2305-
FontTemplate::Native(native) => {
2306-
PlainFontTemplate {
2307-
data: native.0.to_string(),
2308-
index: 0,
2309-
}
2310-
}
2311-
#[cfg(not(any(feature = "font_backend_swash", target_os = "macos", target_os = "ios")))]
2304+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
23122305
FontTemplate::Native(native) => {
23132306
PlainFontTemplate {
23142307
data: native.path.to_string_lossy().to_string(),
23152308
index: native.index,
23162309
}
23172310
}
2318-
#[cfg(all(not(feature = "font_backend_swash"), any(target_os = "macos", target_os = "ios")))]
2311+
#[cfg(any(target_os = "macos", target_os = "ios"))]
23192312
FontTemplate::Native(native) => {
23202313
PlainFontTemplate {
23212314
data: native.name,

webrender_api/src/font.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use peek_poke::PeekPoke;
66
use std::cmp::Ordering;
77
use std::hash::{Hash, Hasher};
8+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
9+
use std::path::PathBuf;
810
use std::sync::Arc;
911
// local imports
1012
use crate::IdNamespace;
@@ -50,19 +52,14 @@ impl FontSize {
5052
pub fn to_f64_px(&self) -> f64 { self.0 as f64 }
5153
}
5254

53-
/// Using Rust crate swash and font-index over native fonts
54-
#[cfg(feature = "font_backend_swash")]
55-
#[derive(Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
56-
pub struct NativeFontHandle(pub u32);
57-
58-
#[cfg(not(any(feature = "font_backend_swash", target_os = "macos", target_os = "ios")))]
55+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
5956
#[derive(Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
6057
pub struct NativeFontHandle {
61-
pub path: std::path::PathBuf,
58+
pub path: PathBuf,
6259
pub index: u32,
6360
}
6461

65-
#[cfg(all(not(feature = "font_backend_swash"), any(target_os = "macos", target_os = "ios")))]
62+
#[cfg(any(target_os = "macos", target_os = "ios"))]
6663
#[derive(Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
6764
pub struct NativeFontHandle {
6865
pub name: String,

0 commit comments

Comments
 (0)