presenter 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import { Size } from '../../../../types/Size';
2
+ import { TextUnitMeasurement } from './getTextUnitMeasurements';
3
+ export interface TextLineLayout extends Size {
4
+ readonly baselineY: number;
5
+ readonly bottom: number;
6
+ readonly lineAdvance: number;
7
+ readonly top: number;
8
+ }
9
+ export interface TextLayout {
10
+ readonly lines: readonly TextLineLayout[];
11
+ readonly size: Size;
12
+ }
13
+ /**
14
+ * Computes text block bounds and per-line baseline positions.
15
+ *
16
+ * Accepts as input per-line measurements for each text unit, plus a desired line spacing.
17
+ */
18
+ export declare function getTextLayout(lineMeasurements: readonly (readonly TextUnitMeasurement[])[], lineSpacing?: number): TextLayout;
@@ -5,6 +5,7 @@ import { UnifiedCanvasContext } from '../../types/UnifiedCanvasContext';
5
5
  export interface TextUnitMeasurement extends Size {
6
6
  readonly baselineShift: number;
7
7
  readonly bottom: number;
8
+ readonly lineAdvance: number;
8
9
  readonly top: number;
9
10
  }
10
11
  export declare function getTextUnitMeasurements(textUnits: TextUnit[][], style: TextStyle, ctx: UnifiedCanvasContext): TextUnitMeasurement[][];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presenter",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "A JavaScript presentation library",
5
5
  "main": "dist/presenter.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { Size } from '../../types/Size';
2
- /**
3
- * Computes the combined size of a 2D array of sizes.
4
- *
5
- * If a line spacing is provided, it's added
6
- */
7
- export declare function getCombinedSizes2D(sizes: Size[][], lineSpacing?: number): Size;