Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Allow setting font features on `TextStyle`

Antonio Scandurra76167ca65c03
diff --git a/crates/gpui/src/fonts.rs b/crates/gpui/src/fonts.rs
index 298bc27d21a..cd7d4e0444b 100644
--- a/crates/gpui/src/fonts.rs
+++ b/crates/gpui/src/fonts.rs
@@ -78,6 +78,8 @@ thread_local! {
struct TextStyleJson {
color: Color,
family: String,
+ #[serde(default)]
+ features: Features,
weight: Option<WeightJson>,
size: f32,
#[serde(default)]
@@ -184,7 +186,7 @@ impl TextStyle {
json.family,
json.size,
font_properties,
- Default::default(),
+ json.features,
underline_from_json(json.underline),
json.color,
font_cache,
diff --git a/styles/src/styleTree/components.ts b/styles/src/styleTree/components.ts
index 3f69df981e8..033c0c87254 100644
--- a/styles/src/styleTree/components.ts
+++ b/styles/src/styleTree/components.ts
@@ -97,7 +97,12 @@ export interface TextProperties {
size?: keyof typeof fontSizes
weight?: FontWeight
underline?: boolean
- color?: string
+ color?: string,
+ features?: TextFeatures,
+}
+
+interface TextFeatures {
+ calt?: boolean
}
export function text(