From 63d53761fae567c279d04455ff901124ced76d1d Mon Sep 17 00:00:00 2001 From: mkorje Date: Tue, 10 Jun 2025 14:18:22 +1000 Subject: [PATCH] Add doc comments to methods --- crates/typst-layout/src/math/fragment.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/typst-layout/src/math/fragment.rs b/crates/typst-layout/src/math/fragment.rs index 2f87e99f1..e7026de60 100644 --- a/crates/typst-layout/src/math/fragment.rs +++ b/crates/typst-layout/src/math/fragment.rs @@ -258,10 +258,14 @@ pub struct GlyphFragment { } impl GlyphFragment { + /// Calls `try_new` with the given character, assuming the font has a glyph + /// for it. pub fn new(font: &Font, styles: StyleChain, c: char, span: Span) -> Self { Self::try_new(font, styles, c.encode_utf8(&mut [0; 4]), span).unwrap() } + /// Try to create a new glyph out of the given string. Will return None if + /// the result from shaping the string is not a single glyph or is a tofu. pub fn try_new( font: &Font, styles: StyleChain,