diff --git a/src/library/text.rs b/src/library/text.rs index 78de55fd4..b8810ac62 100644 --- a/src/library/text.rs +++ b/src/library/text.rs @@ -426,6 +426,11 @@ fn shape_segment<'a>( dir: Dir, tags: &[rustybuzz::Feature], ) { + // No font has newlines. + if text.chars().all(|c| c == '\n') { + return; + } + // Select the font family. let (face_id, fallback) = loop { // Try to load the next available font family.