From 9e559e150d991609e338170e2100d5bceccbe81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 21 Apr 2023 20:26:08 +0200 Subject: [PATCH] Write docs for `Shaping` enum --- src/shape.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/shape.rs b/src/shape.rs index 7183618..c6b7a37 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -11,9 +11,22 @@ use unicode_segmentation::UnicodeSegmentation; use crate::fallback::FontFallbackIter; use crate::{Align, AttrsList, CacheKey, Color, Font, FontSystem, LayoutGlyph, LayoutLine, Wrap}; +/// The shaping strategy of some text. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum Shaping { + /// Basic shaping with no font fallback. + /// + /// This shaping strategy is very cheap, but it will not display complex + /// scripts properly nor try to find missing glyphs in your system fonts. + /// + /// You should use this strategy when you have complete control of the text + /// and the font you are displaying in your application. Basic, + /// Advanced text shaping and font fallback. + /// + /// You will need to enable this strategy if the text contains a complex + /// script, the font used needs it, and/or multiple fonts in your system + /// may be needed to display all of the glyphs. Advanced, }