Skip to content

Commit

Permalink
Explicitly set cosmic_text wrapping to Glyph, as there is no fallback…
Browse files Browse the repository at this point in the history
… from Word -> Glyph in cases where a long uninterrupted string of characters is inserted and overflows the buffer bounds.
  • Loading branch information
bungoboingo committed Mar 30, 2024
1 parent 385a449 commit 846791e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions graphics/src/text/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ impl editor::Editor for Editor {
cosmic_text::Shaping::Advanced,
);

// There is no graceful fallback from word -> glyph wrapping in cosmic_text, so if you type
// a bunch of letters in a row they will overflow the text bounds. For now, we explicitly
// set glyph wrapping to avoid overflow issues.
//see: https://github.com/pop-os/cosmic-text/issues/219
buffer.set_wrap(font_system.raw(), cosmic_text::Wrap::Glyph);

Editor(Some(Arc::new(Internal {
editor: cosmic_text::Editor::new(buffer),
version: font_system.version(),
Expand Down

0 comments on commit 846791e

Please sign in to comment.