mirror of
https://github.com/mapbox/node-fontnik.git
synced 2026-01-25 16:02:44 +00:00
fix tests
This commit is contained in:
parent
f7e209eda6
commit
ffa9fd3fa3
2
index.js
2
index.js
@ -19,7 +19,7 @@ module.exports.convert = convert;
|
||||
function convert(zdata, options, callback) {
|
||||
'use strict';
|
||||
options = options || {};
|
||||
options.fontstack = options.fontstack || 'Open Sans';
|
||||
options.fontstack = options.fontstack || 'Open Sans Regular';
|
||||
|
||||
var tile;
|
||||
|
||||
|
||||
@ -459,9 +459,7 @@ void Tile::AsyncShape(uv_work_t* req) {
|
||||
fontserver::glyph_info const& glyph = glyph_pos.second;
|
||||
|
||||
// DEBUG: This makes segfaults.
|
||||
font_engine_.mutex_.lock();
|
||||
FT_Face font_face = glyph.face->get_face();
|
||||
font_engine_.mutex_.unlock();
|
||||
|
||||
// std::cout<<glyph->format<<'\n';
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@ var fs = require('fs');
|
||||
var zdata = fs.readFileSync(__dirname + '/fixtures/mapbox-streets-v4.13.1306.3163.vector.pbf');
|
||||
var Protobuf = require('./format/protobuf');
|
||||
var VectorTile = require('./format/vectortile');
|
||||
var diff = require('deep-diff');
|
||||
|
||||
function nobuffer(key, val) {
|
||||
return key !== '_buffer' && key !== 'bitmap' ? val : undefined;
|
||||
@ -12,7 +13,7 @@ function nobuffer(key, val) {
|
||||
|
||||
function jsonEqual(key, json) {
|
||||
fs.writeFileSync(__dirname + '/expected/'+key+'.json', JSON.stringify(json, null, 2));
|
||||
assert.deepEqual(json, require('./expected/'+key+'.json'));
|
||||
assert.deepEqual(json, JSON.parse(fs.readFileSync(__dirname + '/expected/'+key+'.json')));
|
||||
}
|
||||
|
||||
describe('convert', function() {
|
||||
@ -61,7 +62,7 @@ describe('convert', function() {
|
||||
|
||||
it('shape', function(done) {
|
||||
var tile = new fontserver.Tile(data);
|
||||
tile.shape('Open Sans', function(err) {
|
||||
tile.shape('Open Sans Regular', function(err) {
|
||||
assert.ifError(err);
|
||||
var vt = new VectorTile(new Protobuf(new Uint8Array(tile.serialize())));
|
||||
var json = JSON.parse(JSON.stringify(vt, nobuffer));
|
||||
@ -75,7 +76,7 @@ describe('convert', function() {
|
||||
var remaining = 10;
|
||||
for (var i = 0; i < 10; i++) (function() {
|
||||
var tile = new fontserver.Tile(data);
|
||||
tile.shape('Open Sans', function(err) {
|
||||
tile.shape('Open Sans Regular', function(err) {
|
||||
assert.ifError(err);
|
||||
var vt = new VectorTile(new Protobuf(new Uint8Array(tile.serialize())));
|
||||
var json = JSON.parse(JSON.stringify(vt, nobuffer));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user