First commit

This commit is contained in:
2026-01-12 13:12:46 +01:00
parent b2d9501f6d
commit a1fbd8acf5
4413 changed files with 1245183 additions and 0 deletions

72
node_modules/fontkit/src/glyph/BBox.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
/**
* Represents a glyph bounding box
*/
export default class BBox {
constructor(minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity) {
/**
* The minimum X position in the bounding box
* @type {number}
*/
this.minX = minX;
/**
* The minimum Y position in the bounding box
* @type {number}
*/
this.minY = minY;
/**
* The maxmimum X position in the bounding box
* @type {number}
*/
this.maxX = maxX;
/**
* The maxmimum Y position in the bounding box
* @type {number}
*/
this.maxY = maxY;
}
/**
* The width of the bounding box
* @type {number}
*/
get width() {
return this.maxX - this.minX;
}
/**
* The height of the bounding box
* @type {number}
*/
get height() {
return this.maxY - this.minY;
}
addPoint(x, y) {
if (Math.abs(x) !== Infinity) {
if (x < this.minX) {
this.minX = x;
}
if (x > this.maxX) {
this.maxX = x;
}
}
if (Math.abs(y) !== Infinity) {
if (y < this.minY) {
this.minY = y;
}
if (y > this.maxY) {
this.maxY = y;
}
}
}
copy() {
return new BBox(this.minX, this.minY, this.maxX, this.maxY);
}
}