@pdfa-lab/fontkit / BoundingBox
Class: BoundingBox ​
Defined in: src/glyph/bounding-box.ts:4
Represents a glyph bounding box.
Extended by ​
Constructors ​
Constructor ​
new BoundingBox(
minX?,minY?,maxX?,maxY?):BoundingBox
Defined in: src/glyph/bounding-box.ts:25
Creates an instance of a bounding box.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
minX | number | Infinity | The initial minimum X position. Defaults to Infinity. |
minY | number | Infinity | The initial minimum Y position. Defaults to Infinity. |
maxX | number | -Infinity | The initial maximum X position. Defaults to -Infinity. |
maxY | number | -Infinity | The initial maximum Y position. Defaults to -Infinity. |
Returns ​
BoundingBox
Accessors ​
height ​
Get Signature ​
get height():
number
Defined in: src/glyph/bounding-box.ts:79
The height of the bounding box.
Returns ​
number
maxX ​
Get Signature ​
get maxX():
number
Defined in: src/glyph/bounding-box.ts:53
Returns ​
number
Set Signature ​
set maxX(
x):void
Defined in: src/glyph/bounding-box.ts:57
Parameters ​
| Parameter | Type |
|---|---|
x | number |
Returns ​
void
maxY ​
Get Signature ​
get maxY():
number
Defined in: src/glyph/bounding-box.ts:61
Returns ​
number
Set Signature ​
set maxY(
y):void
Defined in: src/glyph/bounding-box.ts:65
Parameters ​
| Parameter | Type |
|---|---|
y | number |
Returns ​
void
minX ​
Get Signature ​
get minX():
number
Defined in: src/glyph/bounding-box.ts:37
Returns ​
number
Set Signature ​
set minX(
x):void
Defined in: src/glyph/bounding-box.ts:41
Parameters ​
| Parameter | Type |
|---|---|
x | number |
Returns ​
void
minY ​
Get Signature ​
get minY():
number
Defined in: src/glyph/bounding-box.ts:45
Returns ​
number
Set Signature ​
set minY(
y):void
Defined in: src/glyph/bounding-box.ts:49
Parameters ​
| Parameter | Type |
|---|---|
y | number |
Returns ​
void
width ​
Get Signature ​
get width():
number
Defined in: src/glyph/bounding-box.ts:72
The width of the bounding box.
Returns ​
number
Methods ​
addPoint() ​
addPoint(
x,y):void
Defined in: src/glyph/bounding-box.ts:91
Expands the bounding box to include the specified coordinate point. Finite coordinates are ignored if they don't expand the current bounds. Infinite values are explicitly ignored.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
x | number | The X coordinate of the point to add. |
y | number | The Y coordinate of the point to add. |
Returns ​
void
copy() ​
copy():
BoundingBox
Defined in: src/glyph/bounding-box.ts:118
Creates a deep copy of the current bounding box instance.
Returns ​
BoundingBox
A new BoundingBox instance with matching dimensions.