Write docs for Shaping enum

This commit is contained in:
Héctor Ramón Jiménez 2023-04-21 20:26:08 +02:00
parent 0f055c0a13
commit 9e559e150d
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -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,
}