Skip to content

Commit 1888e9a

Browse files
Rephrase documentation for RcText
1 parent 8575019 commit 1888e9a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/graphics/rc_text.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@ const PANIC_ERROR_MSG: &str = "Text does not hold a font! Return value cannot be
1818
/// `RcText` is a drawable type that allows to easily
1919
/// display some text with custom style and color on a render target.
2020
///
21-
/// __Note:__
22-
/// Currently, it is not feasible to store text long term.
23-
/// A common pattern with rust-sfml is to create a `Text` right before you start drawing,
24-
/// and draw all the text you want with it. You can change its properties using
25-
/// `set_font`, `set_position`, `set_string`, etc., before drawing it, as many times as you need
26-
/// to.
27-
/// This is an improvement upon the [`sfml::graphics::Text`] module which dissallows seperation from the [`Font`]
28-
/// lifetime. The `RcText` allows for complete seperation from the [`RcFont`] while still
29-
/// referencing it. Underneath, it uses reference counting to ensure that the [`RcFont`] is alive,
30-
/// and will throw errors messages if you try to perform function on the sprite while the
31-
/// [`RcFont`] is no longer alive. the only functions that allow usage while the [`RcFont`] is not alive are
21+
/// This is an alternative to [`Text`], allowing for complete seperation from the font's lifetime.
22+
///
23+
/// Underneath, it uses reference counting to ensure that the [`RcFont`] is alive,
24+
/// and disallows performing certain actions on the text if the
25+
/// [`RcFont`] is no longer alive. It will print an error message in these cases.
26+
///
27+
/// The only functions that allow usage while the [`RcFont`] is not alive are
3228
/// `set_string`, `string`, `character_size`, `set_style`, `set_font`, `set_character_size`, `style`, `font`,
3329
/// `fill-color`, `outline_color`, `outline_thickness`, `line_spacing`, `set_line_spacing`, `letter_spacing`,
3430
/// `set_letter_spacing`
31+
///
32+
/// [`Text`]: crate::graphics::Text
3533
#[derive(Debug)]
3634
pub struct RcText {
3735
text: NonNull<ffi::sfText>,

0 commit comments

Comments
 (0)