Repository: typst/typst
File: crates/typst-library/src/text/mod.rs (Rust)

Code before:
    /// ```
    #[default(false)]
    #[ghost]
    pub slashed_zero: bool,

    /// Whether to turn numbers into fractions. Setting this to `{true}`
    /// enables the OpenType `frac` font feature.
    ///
    /// It is not advisable to enable this property globally as it will mess
    /// with all appearances of numbers after a slash (e.g., in URLs). Instead,
    /// enable it locally when you want a fraction.
    ///
    /// ```example
    /// 1/2 \
    /// #text(fractions: true)[1/2]
    /// ```
    #[default(false)]
    #[ghost]
    pub fractions: bool,

    /// Raw OpenType features to apply.
    ///
    /// - If given an array of strings, sets the features identified by the
    ///   strings to `{1}`.
    /// - If given a dictionary mapping to numbers, sets the features
    ///   identified by the keys to the values. This allows interacting with
    ///   non-boolean features such as `swsh`.
    ///
    /// ```example:"Give an array of strings"
    /// // Enable the `frac` feature manually.
    /// #set text(features: ("frac",))
    /// 1/2
    /// ```
    ///
    /// ```example:"Give a dictionary mapping to numbers"
    /// #set text(font: "Cascadia Code")
    /// =>
    /// // Disable the contextual alternates (`calt`) feature.
    /// #set text(features: (calt: 0))
    /// =>
    /// ```
    #[fold]
    #[ghost]
    pub features: FontFeatures,

    /// Content in which all text is styled according to the other arguments.
    #[external]
    #[required]
    pub body: Content,

    /// The text.

Review comment (suggestion):
"non-boolean" is also used by MDN / W3C: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-feature-settings#values

We don't have a font with `swsh` sadly

Code after:
    #[default(false)]
    #[ghost]
    pub slashed_zero: bool,

    /// Whether to turn numbers into fractions. Setting this to `{true}`
    /// enables the OpenType `frac` font feature.
    ///
    /// It is not advisable to enable this property globally as it will mess
    /// with all appearances of numbers after a slash (e.g., in URLs). Instead,
    /// enable it locally when you want a fraction.
    ///
    /// ```example
    /// 1/2 \
    /// #text(fractions: true)[1/2]
    /// ```
    #[default(false)]
    #[ghost]
    pub fractions: bool,

    /// Raw OpenType features to apply.
    ///
    /// - If given an array of strings, sets the features identified by the
    ///   strings to `{1}`.
    /// - If given a dictionary mapping to numbers, sets the features
    ///   identified by the keys to the values. This allows interacting with
    ///   non-boolean features such as `swsh`.
    ///
    /// ```example:"Give an array of strings"
    /// // Enable the `frac` feature manually.
    /// #set text(features: ("frac",))
    /// 1/2
    /// ```
    ///
    /// ```example:"Give a dictionary mapping to numbers"
    /// #set text(font: "Cascadia Code")
    /// =>
    /// // Disable the contextual alternates (`calt`) feature.
    /// #set text(features: (calt: 0))
    /// =>
    /// ```
    #[fold]
    #[ghost]
    pub features: FontFeatures,

    /// Content in which all text is styled according to the other arguments.
    #[external]
    #[required]
    pub body: Content,

    /// The text.
    #[required]