Skip to content

Allow setting retain_ignorables in SimpleShapeOptions #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/shape/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ pub trait ShapeOptions {
fn insert_dotted_circles(&self) -> bool {
false
}

/// Returns true if characters defined as default ignorable should be
/// retained by the shaper.
fn retain_ignorables(&self) -> bool {
false
}
}

/// Simple implementation of the shape options trait.
Expand All @@ -92,6 +98,9 @@ pub struct SimpleShapeOptions<'a> {
pub variations: &'a [Setting<f32>],
/// True if the shaper should insert dotted circles for broken clusters.
pub insert_dotted_circles: bool,
/// True if characters defined as default ignorable should be retained by
/// the shaper.
pub retain_ignorables: bool,
}

impl Default for SimpleShapeOptions<'_> {
Expand All @@ -104,6 +113,7 @@ impl Default for SimpleShapeOptions<'_> {
features: &[],
variations: &[],
insert_dotted_circles: false,
retain_ignorables: false,
}
}
}
Expand Down Expand Up @@ -233,6 +243,7 @@ where
)
.variations(options.variations())
.insert_dotted_circles(options.insert_dotted_circles())
.retain_ignorables(options.retain_ignorables())
.build();
loop {
shaper.add_cluster(cluster);
Expand Down
Loading