summaryrefslogtreecommitdiff
path: root/src/library/text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/text.rs')
-rw-r--r--src/library/text.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index b8810ac6..6d7be323 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -150,6 +150,26 @@ impl Debug for TextNode {
}
}
+/// Strong text, rendered in boldface.
+pub struct StrongNode;
+
+#[class]
+impl StrongNode {
+ fn construct(_: &mut EvalContext, args: &mut Args) -> TypResult<Node> {
+ Ok(args.expect::<Node>("body")?.styled(TextNode::STRONG, true))
+ }
+}
+
+/// Emphasized text, rendered with an italic face.
+pub struct EmphNode;
+
+#[class]
+impl EmphNode {
+ fn construct(_: &mut EvalContext, args: &mut Args) -> TypResult<Node> {
+ Ok(args.expect::<Node>("body")?.styled(TextNode::EMPH, true))
+ }
+}
+
/// A generic or named font family.
#[derive(Clone, Eq, PartialEq, Hash)]
pub enum FontFamily {