mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-09-11 03:55:27 +03:00
feat: use @jsse/pbfont
instead of @mapbox/glyph-pbf-composite
(#1294)
* feat: use `@jsse/pbfont` instead of `@mapbox/glyph-pbf-composite` Signed-off-by: prashis <prashis.meshram@hotmail.com> * refactor: use named import for `@jsse/pbfont` Signed-off-by: prashis <prashis.meshram@hotmail.com> --------- Signed-off-by: prashis <prashis.meshram@hotmail.com>
This commit is contained in:
parent
fa988ea28b
commit
401f891866
85
package-lock.json
generated
85
package-lock.json
generated
@ -9,7 +9,7 @@
|
|||||||
"version": "4.11.1",
|
"version": "4.11.1",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/glyph-pbf-composite": "0.0.3",
|
"@jsse/pbfont": "^0.1.2",
|
||||||
"@mapbox/mbtiles": "0.12.1",
|
"@mapbox/mbtiles": "0.12.1",
|
||||||
"@mapbox/polyline": "^1.2.1",
|
"@mapbox/polyline": "^1.2.1",
|
||||||
"@mapbox/sphericalmercator": "1.2.0",
|
"@mapbox/sphericalmercator": "1.2.0",
|
||||||
@ -207,6 +207,11 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@bufbuild/protobuf": {
|
||||||
|
"version": "1.10.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz",
|
||||||
|
"integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag=="
|
||||||
|
},
|
||||||
"node_modules/@commitlint/cli": {
|
"node_modules/@commitlint/cli": {
|
||||||
"version": "19.3.0",
|
"version": "19.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.3.0.tgz",
|
||||||
@ -1185,12 +1190,15 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mapbox/glyph-pbf-composite": {
|
"node_modules/@jsse/pbfont": {
|
||||||
"version": "0.0.3",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@mapbox/glyph-pbf-composite/-/glyph-pbf-composite-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@jsse/pbfont/-/pbfont-0.1.2.tgz",
|
||||||
"integrity": "sha512-VcsYpDcFDuly8P4sbqBpFKpTrNsOqyvCkuAsoaQrQv9Y4cQnwrwdWgY3zBXJdS6OgukWfVaRwcUE6dwrDC0URA==",
|
"integrity": "sha512-XnkFvibB2yW9t83FW17BbKUcTqXcVEu49SuC9MlbQ/6MTh43WOl4YmYj0z3waeNUmuebtn7bllVOYjx+8idnNw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protocol-buffers": "^2.4.7"
|
"@bufbuild/protobuf": "^1.10.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mapbox/jsonlint-lines-primitives": {
|
"node_modules/@mapbox/jsonlint-lines-primitives": {
|
||||||
@ -3865,22 +3873,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/generate-function": {
|
|
||||||
"version": "2.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
|
|
||||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"is-property": "^1.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/generate-object-property": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"is-property": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/get-caller-file": {
|
"node_modules/get-caller-file": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
@ -4694,11 +4686,6 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-property": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g=="
|
|
||||||
},
|
|
||||||
"node_modules/is-regex": {
|
"node_modules/is-regex": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
||||||
@ -6762,37 +6749,11 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/protobuf-schema": {
|
|
||||||
"version": "1.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/protobuf-schema/-/protobuf-schema-1.5.1.tgz",
|
|
||||||
"integrity": "sha512-jPi6WrJQeqr717Fd42bY9L+rKb6VwGA3ZMAe9X3hwaIrCqW+bM+K+wu+DlVnP5MY2QoS6mqNIiOf9elymWdT6A=="
|
|
||||||
},
|
|
||||||
"node_modules/protocol-buffers": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/protocol-buffers/-/protocol-buffers-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-uaQMT6i8KHUFA/vrSGb97tGXzgoWYxnf/Ledpx7x6vQPjbxRp4muN8DRz0PMi/IuNjB8Uq79h3Y24MFS+jYz3Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"generate-function": "^2.0.0",
|
|
||||||
"generate-object-property": "^1.1.0",
|
|
||||||
"protobuf-schema": "^1.5.0",
|
|
||||||
"resolve-protobuf-schema": "^1.0.2",
|
|
||||||
"signed-varint": "^2.0.0",
|
|
||||||
"varint": "^4.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/protocol-buffers-schema": {
|
"node_modules/protocol-buffers-schema": {
|
||||||
"version": "3.6.0",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||||
"integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
|
"integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
|
||||||
},
|
},
|
||||||
"node_modules/protocol-buffers/node_modules/resolve-protobuf-schema": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-x9optLjaRApo9b/CKahouGGpkUYbsBfEp3TpmwQCZUcu4t7c6hTXPWVwpDdy4Y4e5wKtg/G15rp1btIAQG2waA==",
|
|
||||||
"dependencies": {
|
|
||||||
"protobuf-schema": "^1.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/proxy-addr": {
|
"node_modules/proxy-addr": {
|
||||||
"version": "2.0.7",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
@ -7520,19 +7481,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
||||||
},
|
},
|
||||||
"node_modules/signed-varint": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-abgDPg1106vuZZOvw7cFwdCABddfJRz5akcCcchzTbhyhYnsG31y4AlZEgp315T7W3nQq5P4xeOm186ZiPVFzw==",
|
|
||||||
"dependencies": {
|
|
||||||
"varint": "~5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/signed-varint/node_modules/varint": {
|
|
||||||
"version": "5.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz",
|
|
||||||
"integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow=="
|
|
||||||
},
|
|
||||||
"node_modules/simple-concat": {
|
"node_modules/simple-concat": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
|
||||||
@ -8378,11 +8326,6 @@
|
|||||||
"spdx-expression-parse": "^3.0.0"
|
"spdx-expression-parse": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/varint": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/varint/-/varint-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-vu4cpCqZHA4u77jWdOZlXtXHJofIIyq51DtzstbrvI9e1I1ELseAJLxYr47N/DdLPFGfYMLY1HqAURSTKKJ6ww=="
|
|
||||||
},
|
|
||||||
"node_modules/vary": {
|
"node_modules/vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){ process.exit(1) } \" || husky"
|
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){ process.exit(1) } \" || husky"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/glyph-pbf-composite": "0.0.3",
|
"@jsse/pbfont": "^0.1.2",
|
||||||
"@mapbox/mbtiles": "0.12.1",
|
"@mapbox/mbtiles": "0.12.1",
|
||||||
"@mapbox/polyline": "^1.2.1",
|
"@mapbox/polyline": "^1.2.1",
|
||||||
"@mapbox/sphericalmercator": "1.2.0",
|
"@mapbox/sphericalmercator": "1.2.0",
|
||||||
|
@ -4,7 +4,7 @@ import path from 'path';
|
|||||||
import fsPromises from 'fs/promises';
|
import fsPromises from 'fs/promises';
|
||||||
import fs, { existsSync } from 'node:fs';
|
import fs, { existsSync } from 'node:fs';
|
||||||
import clone from 'clone';
|
import clone from 'clone';
|
||||||
import glyphCompose from '@mapbox/glyph-pbf-composite';
|
import { combine } from '@jsse/pbfont';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restrict user input to an allowed set of options.
|
* Restrict user input to an allowed set of options.
|
||||||
@ -213,8 +213,8 @@ export const getFontsPbf = async (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const values = await Promise.all(queue);
|
const combined = combine(await Promise.all(queue), names);
|
||||||
return glyphCompose.combine(values);
|
return Buffer.from(combined.buffer, 0, combined.buffer.length);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const listFonts = async (fontPath) => {
|
export const listFonts = async (fontPath) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user