Skip to content

Commit

Permalink
Allow Shaping::Basic only if swash feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Apr 21, 2023
1 parent 0dce8b7 commit 87d7553
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl Buffer {
redraw: false,
wrap: Wrap::Word,
};
buffer.set_text(font_system, "", Attrs::new(), Shaping::Basic);
buffer.set_text(font_system, "", Attrs::new(), Shaping::Advanced);
buffer
}

Expand Down
3 changes: 3 additions & 0 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum Shaping {
///
/// You should use this strategy when you have complete control of the text
/// and the font you are displaying in your application.
#[cfg(feature = "swash")]
Basic,
/// Advanced text shaping and font fallback.
///
Expand All @@ -41,6 +42,7 @@ impl Shaping {
span_rtl: bool,
) -> Vec<ShapeGlyph> {
match self {
#[cfg(feature = "swash")]
Self::Basic => shape_skip(font_system, line, attrs_list, start_run, end_run),
Self::Advanced => {
shape_run(font_system, line, attrs_list, start_run, end_run, span_rtl)
Expand Down Expand Up @@ -251,6 +253,7 @@ fn shape_run(
glyphs
}

#[cfg(feature = "swash")]
fn shape_skip(
font_system: &mut FontSystem,
line: &str,
Expand Down

0 comments on commit 87d7553

Please sign in to comment.