Allow Shaping::Basic only if swash feature is enabled
This commit is contained in:
parent
0dce8b75d1
commit
87d75531b7
2 changed files with 4 additions and 1 deletions
|
|
@ -331,7 +331,7 @@ impl Buffer {
|
||||||
redraw: false,
|
redraw: false,
|
||||||
wrap: Wrap::Word,
|
wrap: Wrap::Word,
|
||||||
};
|
};
|
||||||
buffer.set_text(font_system, "", Attrs::new(), Shaping::Basic);
|
buffer.set_text(font_system, "", Attrs::new(), Shaping::Advanced);
|
||||||
buffer
|
buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ pub enum Shaping {
|
||||||
///
|
///
|
||||||
/// You should use this strategy when you have complete control of the text
|
/// You should use this strategy when you have complete control of the text
|
||||||
/// and the font you are displaying in your application.
|
/// and the font you are displaying in your application.
|
||||||
|
#[cfg(feature = "swash")]
|
||||||
Basic,
|
Basic,
|
||||||
/// Advanced text shaping and font fallback.
|
/// Advanced text shaping and font fallback.
|
||||||
///
|
///
|
||||||
|
|
@ -41,6 +42,7 @@ impl Shaping {
|
||||||
span_rtl: bool,
|
span_rtl: bool,
|
||||||
) -> Vec<ShapeGlyph> {
|
) -> Vec<ShapeGlyph> {
|
||||||
match self {
|
match self {
|
||||||
|
#[cfg(feature = "swash")]
|
||||||
Self::Basic => shape_skip(font_system, line, attrs_list, start_run, end_run),
|
Self::Basic => shape_skip(font_system, line, attrs_list, start_run, end_run),
|
||||||
Self::Advanced => {
|
Self::Advanced => {
|
||||||
shape_run(font_system, line, attrs_list, start_run, end_run, span_rtl)
|
shape_run(font_system, line, attrs_list, start_run, end_run, span_rtl)
|
||||||
|
|
@ -251,6 +253,7 @@ fn shape_run(
|
||||||
glyphs
|
glyphs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "swash")]
|
||||||
fn shape_skip(
|
fn shape_skip(
|
||||||
font_system: &mut FontSystem,
|
font_system: &mut FontSystem,
|
||||||
line: &str,
|
line: &str,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue