Skip to content

Commit

Permalink
add an example for smallcaps show rule, and adjust the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Coekjan committed Apr 30, 2024
1 parent 983e6b2 commit 03b64e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/typst/src/text/smallcaps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::text::TextElem;
/// _Note:_ This enables the OpenType `smcp` feature for the font. Not all fonts
/// support this feature. Sometimes smallcaps are part of a dedicated font and
/// sometimes they are not available at all. In the future, this function will
/// support selecting a dedicated smallcaps font as well as synthesizing
/// smallcaps from normal letters, but this is not yet implemented.
/// support synthesizing smallcaps from normal letters, but this is not yet
/// implemented.
///
/// # Example
/// ```example
Expand All @@ -25,8 +25,16 @@ use crate::text::TextElem;
/// = Introduction
/// #lorem(40)
/// ```
///
/// You can use show rule to customize the appearance of the text in smallcaps,
/// which allows selecting a dedicated smallcaps font.
/// ```example
/// #show smallcaps: set text(font: "linux libertine")
/// #smallcaps[Use Show Rule For Smallcaps]
/// ```
#[elem(title = "Small Capitals", Show)]
pub struct SmallcapsElem {
/// The content to display to small capitals.
#[required]
pub body: Content,
}
Expand Down

0 comments on commit 03b64e7

Please sign in to comment.