summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library/text.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index 78de55fd..b8810ac6 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.