diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-17 16:48:16 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-17 16:48:16 +0100 |
| commit | cd7630415f52578b414803935437aaef0fe20eda (patch) | |
| tree | 904db5a574499696c157c85a45009f81e376c7ff /src | |
| parent | 43e30717ab9e65ff43e435eb4bb86f6b21077164 (diff) | |
Don't do font fallback for unshapable newlines
Diffstat (limited to 'src')
| -rw-r--r-- | src/library/text.rs | 5 |
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. |
