Skip to content

Commit

Permalink
[gpos] Fix unsafe-to-break of mark-attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Feb 9, 2024
1 parent 38c4adc commit ffbcfa8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ot/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ impl MarkArrayExt for MarkArray<'_> {
let (mark_x, mark_y) = mark_anchor.get(ctx.face);
let (base_x, base_y) = base_anchor.get(ctx.face);

ctx.buffer.unsafe_to_break(glyph_pos, ctx.buffer.idx);
ctx.buffer.unsafe_to_break(glyph_pos, ctx.buffer.idx + 1);

let idx = ctx.buffer.idx;
let pos = ctx.buffer.cur_pos_mut();
Expand Down
30 changes: 30 additions & 0 deletions tests/shaping/aots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,21 @@ fn gpos4_lookupflag_002() {
);
}

#[test]
fn gpos4_simple_001() {
assert_eq!(
shape(
"tests/fonts/aots/gpos4_simple_1.otf",
"\u{0011}\u{0012}\u{0013}\u{0011}",
"--features=\"test\" --single-par --no-clusters --no-glyph-names --ned",
),
"17|\
18@1500,0|\
19@1400,-80|\
17@3000,0"
);
}

#[test]
fn gpos4_simple_002() {
assert_eq!(
Expand Down Expand Up @@ -877,6 +892,21 @@ fn gpos5_001() {
);
}

#[test]
fn gpos5_002() {
assert_eq!(
shape(
"tests/fonts/aots/gpos5_font1.otf",
"\u{0011}\u{001E}\u{001F}\u{0013}\u{0011}",
"--features=\"test\" --single-par --no-clusters --no-glyph-names --ned",
),
"17|\
18@1500,0|\
19@1401,-79|\
17@3000,0"
);
}

#[test]
fn gpos6_002() {
assert_eq!(
Expand Down

0 comments on commit ffbcfa8

Please sign in to comment.