Allow setting font features on TextStyle

This commit is contained in:
Antonio Scandurra 2023-03-17 11:44:29 +01:00
parent 7d13b00914
commit 76167ca65c
2 changed files with 9 additions and 2 deletions

View file

@ -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,

View file

@ -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(