mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 19:02:07 +00:00
Allow setting font features on TextStyle
This commit is contained in:
parent
7d13b00914
commit
76167ca65c
2 changed files with 9 additions and 2 deletions
|
@ -78,6 +78,8 @@ thread_local! {
|
||||||
struct TextStyleJson {
|
struct TextStyleJson {
|
||||||
color: Color,
|
color: Color,
|
||||||
family: String,
|
family: String,
|
||||||
|
#[serde(default)]
|
||||||
|
features: Features,
|
||||||
weight: Option<WeightJson>,
|
weight: Option<WeightJson>,
|
||||||
size: f32,
|
size: f32,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
@ -184,7 +186,7 @@ impl TextStyle {
|
||||||
json.family,
|
json.family,
|
||||||
json.size,
|
json.size,
|
||||||
font_properties,
|
font_properties,
|
||||||
Default::default(),
|
json.features,
|
||||||
underline_from_json(json.underline),
|
underline_from_json(json.underline),
|
||||||
json.color,
|
json.color,
|
||||||
font_cache,
|
font_cache,
|
||||||
|
|
|
@ -97,7 +97,12 @@ export interface TextProperties {
|
||||||
size?: keyof typeof fontSizes
|
size?: keyof typeof fontSizes
|
||||||
weight?: FontWeight
|
weight?: FontWeight
|
||||||
underline?: boolean
|
underline?: boolean
|
||||||
color?: string
|
color?: string,
|
||||||
|
features?: TextFeatures,
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TextFeatures {
|
||||||
|
calt?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export function text(
|
export function text(
|
||||||
|
|
Loading…
Reference in a new issue