Skip to content

Commit

Permalink
Expose unsupported lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Jul 18, 2024
1 parent 8d892f5 commit d8c4472
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 185 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "font"
version = "0.35.1"
version = "0.36.0"
edition = "2021"
license = "Apache-2.0/MIT"
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"]
Expand Down
10 changes: 5 additions & 5 deletions src/formats/opentype/features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct Directory {
/// Features to samples.
pub features: Vec<(Feature, Vec<usize>)>,
/// Samples.
pub samples: Vec<Option<Vec<BTreeSet<Sample>>>>,
pub samples: Vec<Vec<Option<BTreeSet<Sample>>>>,
}

pub(crate) fn read<T: crate::Read>(cache: &mut Cache<T>) -> Result<Directory> {
Expand Down Expand Up @@ -97,8 +97,8 @@ fn process_table<T>(
HashMap<(Feature, Vec<usize>), usize>,
),
samples: &mut (
Vec<Option<Vec<BTreeSet<Sample>>>>,
HashMap<Option<Vec<BTreeSet<Sample>>>, usize>,
Vec<Vec<Option<BTreeSet<Sample>>>>,
HashMap<Vec<Option<BTreeSet<Sample>>>, usize>,
),
) -> Option<()>
where
Expand All @@ -125,8 +125,8 @@ fn process_graphs<T>(
directory: &layout::Directory<T>,
mapping: &Mapping,
samples: &mut (
Vec<Option<Vec<BTreeSet<Sample>>>>,
HashMap<Option<Vec<BTreeSet<Sample>>>, usize>,
Vec<Vec<Option<BTreeSet<Sample>>>>,
HashMap<Vec<Option<BTreeSet<Sample>>>, usize>,
),
) -> Vec<usize>
where
Expand Down
10 changes: 4 additions & 6 deletions src/formats/opentype/features/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,11 @@ impl Table for opentype::tables::glyph_substitution::Type {
table.glyph_ids.iter().cloned().map(Into::into).collect(),
)));
}
_ => {}
}
if !values.is_empty() {
Some(values)
} else {
None
_ => {
return None;
}
}
Some(values)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/formats/opentype/features/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait Transform<'l> {
}

impl<'l> Transform<'l> for &[Option<Rules>] {
type Target = Option<Vec<BTreeSet<Sample>>>;
type Target = Vec<Option<BTreeSet<Sample>>>;
type Parameter = &'l [Vec<Option<Rules>>];

fn transform(self, mapping: &Mapping, rules: Self::Parameter) -> Self::Target {
Expand Down
Loading

0 comments on commit d8c4472

Please sign in to comment.