Skip to content

Commit e4f901c

Browse files
committedApr 20, 2021
Loosen text measurement expectation.
Cherry-picked out of f0974bc. Ref #1776 (review)
1 parent 12e671d commit e4f901c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎test/canvas.test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,9 @@ describe('Canvas', function () {
934934

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

0 commit comments

Comments
 (0)
Please sign in to comment.