Skip to content

Commit

Permalink
Loosen text measurement expectation.
Browse files Browse the repository at this point in the history
Cherry-picked out of f0974bc.
Ref #1776 (review)
  • Loading branch information
zbjornson committed Apr 20, 2021
1 parent 12e671d commit e4f901c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/canvas.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,9 @@ describe('Canvas', function () {

ctx.textBaseline = "alphabetic"
var metrics = ctx.measureText("Alphabet")
// Zero if the given baseline is the alphabetic baseline
assert.equal(metrics.alphabeticBaseline, 0)
// Actual value depends on font library version. Have observed values
// between 0 and 0.769.
assert.ok(metrics.alphabeticBaseline >= 0 && metrics.alphabeticBaseline <= 1);
// Positive = going up from the baseline
assert.ok(metrics.actualBoundingBoxAscent > 0)
// Positive = going down from the baseline
Expand Down

0 comments on commit e4f901c

Please sign in to comment.