summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-17 16:48:16 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-17 16:48:16 +0100
commitcd7630415f52578b414803935437aaef0fe20eda (patch)
tree904db5a574499696c157c85a45009f81e376c7ff
parent43e30717ab9e65ff43e435eb4bb86f6b21077164 (diff)
Don't do font fallback for unshapable newlines
-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.