summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/text/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-02-10 15:37:19 +0100
committerGitHub <noreply@github.com>2025-02-10 14:37:19 +0000
commit89e71acecd4a3a06943d0bd4443fc80a9b8f41e4 (patch)
tree7a7f01e6aaf10d85edc06162e8aab700e76647b4 /crates/typst-library/src/text/mod.rs
parentee47cb846924235be6eae968a7853ea7860ccc51 (diff)
Respect `par` constructor arguments (#5842)
Diffstat (limited to 'crates/typst-library/src/text/mod.rs')
-rw-r--r--crates/typst-library/src/text/mod.rs25
1 files changed, 1 insertions, 24 deletions
diff --git a/crates/typst-library/src/text/mod.rs b/crates/typst-library/src/text/mod.rs
index 12f4e4c5..30c2ea1d 100644
--- a/crates/typst-library/src/text/mod.rs
+++ b/crates/typst-library/src/text/mod.rs
@@ -51,7 +51,6 @@ use crate::foundations::{
};
use crate::layout::{Abs, Axis, Dir, Em, Length, Ratio, Rel};
use crate::math::{EquationElem, MathSize};
-use crate::model::ParElem;
use crate::visualize::{Color, Paint, RelativeTo, Stroke};
use crate::World;
@@ -504,9 +503,8 @@ pub struct TextElem {
/// enabling hyphenation can
/// improve justification.
/// ```
- #[resolve]
#[ghost]
- pub hyphenate: Hyphenate,
+ pub hyphenate: Smart<bool>,
/// The "cost" of various choices when laying out text. A higher cost means
/// the layout engine will make the choice less often. Costs are specified
@@ -1110,27 +1108,6 @@ impl Resolve for TextDir {
}
}
-/// Whether to hyphenate text.
-#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Hash)]
-pub struct Hyphenate(pub Smart<bool>);
-
-cast! {
- Hyphenate,
- self => self.0.into_value(),
- v: Smart<bool> => Self(v),
-}
-
-impl Resolve for Hyphenate {
- type Output = bool;
-
- fn resolve(self, styles: StyleChain) -> Self::Output {
- match self.0 {
- Smart::Auto => ParElem::justify_in(styles),
- Smart::Custom(v) => v,
- }
- }
-}
-
/// A set of stylistic sets to enable.
#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Hash)]
pub struct StylisticSets(u32);