three-text 0.2.16 → 0.2.17
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.
- package/README.md +8 -2
- package/dist/index.cjs +407 -215
- package/dist/index.js +407 -215
- package/dist/index.min.cjs +632 -618
- package/dist/index.min.js +624 -610
- package/dist/index.umd.js +407 -215
- package/dist/index.umd.min.js +632 -618
- package/dist/types/core/cache/GlyphGeometryBuilder.d.ts +1 -0
- package/dist/types/core/geometry/Tessellator.d.ts +3 -2
- package/dist/types/core/layout/LineBreak.d.ts +2 -1
- package/dist/types/core/layout/TextLayout.d.ts +15 -0
- package/dist/types/core/shaping/TextMeasurer.d.ts +1 -0
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ export declare class GlyphGeometryBuilder {
|
|
|
34
34
|
private wordCache;
|
|
35
35
|
private contourCache;
|
|
36
36
|
private clusteringCache;
|
|
37
|
+
private emptyGlyphs;
|
|
37
38
|
constructor(cache: LRUCache<string, GlyphData>, loadedFont: LoadedFont);
|
|
38
39
|
getOptimizationStats(): import("../geometry/PathOptimizer").OptimizationStats;
|
|
39
40
|
setCurveFidelityConfig(config?: CurveFidelityConfig): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Path, ProcessedGeometry } from '../types';
|
|
2
2
|
export declare class Tessellator {
|
|
3
|
-
process(paths: Path[], removeOverlaps?: boolean, isCFF?: boolean): ProcessedGeometry;
|
|
3
|
+
process(paths: Path[], removeOverlaps?: boolean, isCFF?: boolean, needsExtrusionContours?: boolean): ProcessedGeometry;
|
|
4
4
|
private tessellate;
|
|
5
5
|
private pathsToContours;
|
|
6
6
|
private performTessellation;
|
|
7
7
|
private boundaryToContours;
|
|
8
|
-
private
|
|
8
|
+
private needsWindingNormalization;
|
|
9
|
+
private signedArea;
|
|
9
10
|
}
|
|
@@ -47,6 +47,7 @@ export interface LineBreakOptions {
|
|
|
47
47
|
hyphenate?: boolean;
|
|
48
48
|
language?: string;
|
|
49
49
|
measureText: (text: string) => number;
|
|
50
|
+
measureTextWidths?: (text: string) => number[];
|
|
50
51
|
respectExistingBreaks?: boolean;
|
|
51
52
|
hyphenationPatterns?: HyphenationPatternsMap;
|
|
52
53
|
unitsPerEm?: number;
|
|
@@ -80,7 +81,7 @@ export declare class LineBreak {
|
|
|
80
81
|
private static badness;
|
|
81
82
|
static findHyphenationPoints(word: string, language?: string, availablePatterns?: HyphenationPatternsMap, lefthyphenmin?: number, righthyphenmin?: number): number[];
|
|
82
83
|
static itemizeText(text: string, measureText: (text: string) => number, // function to measure text width
|
|
83
|
-
hyphenate?: boolean, language?: string, availablePatterns?: HyphenationPatternsMap, lefthyphenmin?: number, righthyphenmin?: number, context?: LineBreakContext): Item[];
|
|
84
|
+
measureTextWidths: ((text: string) => number[]) | undefined, hyphenate?: boolean, language?: string, availablePatterns?: HyphenationPatternsMap, lefthyphenmin?: number, righthyphenmin?: number, context?: LineBreakContext): Item[];
|
|
84
85
|
static isCJK(char: string): boolean;
|
|
85
86
|
static isCJClosingPunctuation(char: string): boolean;
|
|
86
87
|
static isCJOpeningPunctuation(char: string): boolean;
|
|
@@ -41,4 +41,19 @@ export declare class TextLayout {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
+
computeAlignmentOffset(options: AlignmentOptions): {
|
|
45
|
+
offset: number;
|
|
46
|
+
adjustedBounds: {
|
|
47
|
+
min: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
z: number;
|
|
51
|
+
};
|
|
52
|
+
max: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
z: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
44
59
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LoadedFont } from '../types';
|
|
2
2
|
export declare class TextMeasurer {
|
|
3
|
+
static measureTextWidths(loadedFont: LoadedFont, text: string, letterSpacing?: number): number[];
|
|
3
4
|
static measureTextWidth(loadedFont: LoadedFont, text: string, letterSpacing?: number): number;
|
|
4
5
|
}
|