Prevent broken glyph assemblies when font data is incorrect (#6688)
This commit is contained in:
parent
ef862654c2
commit
cd1a786539
|
|
@ -739,7 +739,9 @@ fn assemble(
|
||||||
}
|
}
|
||||||
|
|
||||||
advance -= max_overlap;
|
advance -= max_overlap;
|
||||||
growable += max_overlap - min_overlap;
|
// In case we have that max_overlap < min_overlap, ensure we
|
||||||
|
// don't decrease the value of growable.
|
||||||
|
growable += (max_overlap - min_overlap).max(Abs::zero());
|
||||||
}
|
}
|
||||||
|
|
||||||
full += advance;
|
full += advance;
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 585 B |
|
|
@ -91,3 +91,12 @@ $ body^"text" $
|
||||||
}
|
}
|
||||||
$body^"long text"$
|
$body^"long text"$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- math-stretch-min-overlap-exceeds-max ---
|
||||||
|
// Test that glyph assembly doesn't end up with negative lengths if the max
|
||||||
|
// overlap calculated is less than the minConnectorOverlap.
|
||||||
|
#show math.equation: set text(font: "STIX Two Math")
|
||||||
|
// Warning: glyph has assembly parts with overlap less than minConnectorOverlap
|
||||||
|
// Hint: its rendering may appear broken - this is probably a font bug
|
||||||
|
// Hint: please file an issue at https://github.com/typst/typst/issues
|
||||||
|
$ stretch(->)^"Gauss-Jordan Elimination" $
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue