Skip to content

Commit

Permalink
Add format2 parsing test for copying ignored entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
garretrieger committed Sep 19, 2024
1 parent ec6c87e commit 9f77255
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion font-test-data/src/ift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ pub fn copy_indices_format2() -> BeBuffer {
// Entries Array

// Entry id = 1
{0b00100000u8: "entries"}, // format
{0b01100000u8: "entries"}, // format = CODEPOINT_BIT_2 | IGNORED
5u16, // bias = 5
[0b00001101, 0b00000011, 0b00110001u8], // codepoints = [5..22]

Expand Down
8 changes: 2 additions & 6 deletions skrifa/src/patchmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ mod tests {
let font = FontRef::new(&font_bytes).unwrap();

test_intersection(&font, [], [], []);
test_intersection(&font, [0x05], [], [1, 5, 9]);
test_intersection(&font, [0x05], [], [5, 9]);
test_intersection(&font, [0x65], [], [9]);

test_design_space_intersection(
Expand All @@ -1194,7 +1194,7 @@ mod tests {
[0x05],
[Tag::new(b"rlig")],
[(Tag::new(b"wght"), vec![500.0..=500.0])],
[1, 3, 5, 6, 7, 8, 9],
[3, 5, 6, 7, 8, 9],
);
}

Expand Down Expand Up @@ -1414,8 +1414,4 @@ mod tests {
)
.is_err());
}

// TODO(garretrieger): test decoding of other entry features for format 2
// - no codepoints
// - ignored entries can still be copied
}

0 comments on commit 9f77255

Please sign in to comment.