figma_api/models/
text_path_properties_trait.rs

1/*
2 * Figma API
3 *
4 * This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api).  Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TextPathPropertiesTrait {
16    /// The raw characters in the text path node.
17    #[serde(rename = "characters")]
18    pub characters: String,
19    /// Style of text including font family and weight.
20    #[serde(rename = "style")]
21    pub style: Box<models::TextPathTypeStyle>,
22    /// The array corresponds to characters in the text box, where each element references the 'styleOverrideTable' to apply specific styles to each character. The array's length can be less than or equal to the number of characters due to the removal of trailing zeros. Elements with a value of 0 indicate characters that use the default type style. If the array is shorter than the total number of characters, the characters beyond the array's length also use the default style.
23    #[serde(rename = "characterStyleOverrides")]
24    pub character_style_overrides: Vec<f64>,
25    /// Internal property, preserved for backward compatibility. Avoid using this value.
26    #[serde(rename = "layoutVersion", skip_serializing_if = "Option::is_none")]
27    pub layout_version: Option<f64>,
28    /// Map from ID to TextPathTypeStyle for looking up style overrides.
29    #[serde(rename = "styleOverrideTable")]
30    pub style_override_table: std::collections::HashMap<String, models::TextPathTypeStyle>,
31}
32
33impl TextPathPropertiesTrait {
34    pub fn new(characters: String, style: models::TextPathTypeStyle, character_style_overrides: Vec<f64>, style_override_table: std::collections::HashMap<String, models::TextPathTypeStyle>) -> TextPathPropertiesTrait {
35        TextPathPropertiesTrait {
36            characters,
37            style: Box::new(style),
38            character_style_overrides,
39            layout_version: None,
40            style_override_table,
41        }
42    }
43}
44