summaryrefslogtreecommitdiff
path: root/src/library/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/text')
-rw-r--r--src/library/text/deco.rs12
-rw-r--r--src/library/text/mod.rs2
-rw-r--r--src/library/text/par.rs6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/library/text/deco.rs b/src/library/text/deco.rs
index a81f0374..da1a1141 100644
--- a/src/library/text/deco.rs
+++ b/src/library/text/deco.rs
@@ -26,13 +26,13 @@ impl<const L: DecoLine> DecoNode<L> {
/// Thickness of the line's strokes (dependent on scaled font size), read
/// from the font tables if `None`.
#[property(shorthand)]
- pub const THICKNESS: Option<Relative> = None;
+ pub const THICKNESS: Option<Relative<Length>> = None;
/// Position of the line relative to the baseline (dependent on scaled font
/// size), read from the font tables if `None`.
- pub const OFFSET: Option<Relative> = None;
+ pub const OFFSET: Option<Relative<Length>> = None;
/// Amount that the line will be longer or shorter than its associated text
/// (dependent on scaled font size).
- pub const EXTENT: Relative = Relative::zero();
+ pub const EXTENT: Relative<Length> = Relative::zero();
/// Whether the line skips sections in which it would collide
/// with the glyphs. Does not apply to strikethrough.
pub const EVADE: bool = true;
@@ -66,9 +66,9 @@ impl<const L: DecoLine> Show for DecoNode<L> {
pub struct Decoration {
pub line: DecoLine,
pub stroke: Option<Paint>,
- pub thickness: Option<Relative>,
- pub offset: Option<Relative>,
- pub extent: Relative,
+ pub thickness: Option<Relative<Length>>,
+ pub offset: Option<Relative<Length>>,
+ pub extent: Relative<Length>,
pub evade: bool,
}
diff --git a/src/library/text/mod.rs b/src/library/text/mod.rs
index 975a4805..4a139fb3 100644
--- a/src/library/text/mod.rs
+++ b/src/library/text/mod.rs
@@ -188,7 +188,7 @@ castable! {
/// The size of text.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
-pub struct FontSize(pub Relative);
+pub struct FontSize(pub Relative<Length>);
impl Fold for FontSize {
type Output = Length;
diff --git a/src/library/text/par.rs b/src/library/text/par.rs
index a05aff44..2d31cd11 100644
--- a/src/library/text/par.rs
+++ b/src/library/text/par.rs
@@ -42,11 +42,11 @@ impl ParNode {
/// will will be hyphenated if and only if justification is enabled.
pub const HYPHENATE: Smart<bool> = Smart::Auto;
/// The spacing between lines (dependent on scaled font size).
- pub const LEADING: Relative = Ratio::new(0.65).into();
+ pub const LEADING: Relative<Length> = Ratio::new(0.65).into();
/// The extra spacing between paragraphs (dependent on scaled font size).
- pub const SPACING: Relative = Ratio::new(0.55).into();
+ pub const SPACING: Relative<Length> = Ratio::new(0.55).into();
/// The indent the first line of a consecutive paragraph should have.
- pub const INDENT: Relative = Relative::zero();
+ pub const INDENT: Relative<Length> = Relative::zero();
fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> {
// The paragraph constructor is special: It doesn't create a paragraph