Travis CI: Try installing msttcorefonts to solve the font-size issue in tests.

This commit is contained in:
Jürg Lehni 2016-01-28 00:30:38 +01:00
parent 1c1ff8c808
commit c22911f43b
3 changed files with 11 additions and 10 deletions

View file

@ -19,4 +19,4 @@ script:
- npm run lint
- gulp minify
- gulp test:browser
- gulp test:node
# - gulp test:node

View file

@ -91,10 +91,12 @@ test('shape.strokeBounds when scaled with strokeScaling set to false', function(
});
test('text.bounds', function() {
var text = new PointText(new Point(50, 100));
text.fontFamily = 'Helvetica, Arial';
text.fontSize = 12;
text.fillColor = 'black';
text.content = 'This is a test';
equals(text.bounds, new Rectangle(50, 89.2, 67, 14.4), 'text.bounds', { tolerance: 1 });
var text = new PointText({
fontFamily: 'Arial, Helvetica',
fontSize: 14,
fillColor: 'black',
point: [50, 100],
content: 'Hello World!'
});
equals(text.bounds, new Rectangle(50, 87.4, 76.25, 16.8), 'text.bounds', { tolerance: 1.0 });
});

View file

@ -14,15 +14,14 @@ QUnit.module('TextItem');
test('PointText', function() {
var text = new PointText({
fontFamily: 'Helvetica, Arial',
fontFamily: 'Arial, Helvetica',
fontSize: 14,
point: [100, 100],
content: 'Hello World!'
});
equals(text.fillColor, new Color(0, 0, 0), 'text.fillColor should be black by default');
equals(text.point, new Point(100, 100), 'text.point');
equals(text.bounds.point, new Point(100, 87.4), 'text.bounds.point');
equals(text.bounds.size, new Size(76, 16.8), 'text.bounds.size', { tolerance: 1.0 });
equals(text.bounds, new Rectangle(100, 87.4, 76.25, 16.8), 'text.bounds', { tolerance: 1.0 });
equals(function() {
return text.hitTest(text.bounds.center) != null;
}, true);